Skip to content

Commit

Permalink
pure XML msbuild integration 2/N
Browse files Browse the repository at this point in the history
  • Loading branch information
krauthaufen committed Sep 26, 2024
1 parent 9a16ab1 commit e492180
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 29 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 1.3.0-prerelease3
* pure XML msbuild integration 2/N

### 1.3.0-prerelease2
* pure XML msbuild integration

Expand Down
44 changes: 15 additions & 29 deletions src/Adaptify.MSBuild/Adaptify.MSBuild.targets
Original file line number Diff line number Diff line change
@@ -1,40 +1,23 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TaskAssembly Condition=" '$(MSBuildRuntimeType)' == 'Core'">Adaptify.MSBuild.dll</TaskAssembly>
<TaskAssembly Condition=" '$(MSBuildRuntimeType)' != 'Core'">Adaptify.MSBuild.Framework.dll</TaskAssembly>
</PropertyGroup>

<ItemGroup Condition="$(TargetFramework.StartsWith('net4')) Or '$(TargetFramework)' == ''">
<Reference Include="netstandard" />
</ItemGroup>

<UsingTask TaskName="Adaptify.MSBuild.AdaptifyTask" AssemblyFile="$(TaskAssembly)" />
<Target Name="UpdateGeneratedFiles" DependsOnTargets="ResolveProjectReferences;ResolveAssemblyReferences" BeforeTargets="CoreCompile" Condition="'@(Compile)' != '' And '$(GenerateDomainTypes)' != 'false'">
<ItemGroup>
<OldItems Include="@(Compile)" />
</ItemGroup>

<PropertyGroup>
<AdaptifyCommand Condition="'$(AdaptifyCommand)' != ''">dotnet adaptify</AdaptifyCommand>
</PropertyGroup>

<Exec Command="
$(AdaptifyCommand) msbuild --lenses '$(GenerateLenses)' --targetFramework '$(TargetFramework)' --debugHate '$(DebugHate)' --touchFiles '$(TouchFiles)' --projectFile '$(MSBuildProjectFullPath)' --designTime '$(DesignTimeBuild)' --defines '$(DefineConstants)' --outputPath '$(IntermediateOutputPath)' --outputType '$(OutputType)' --files '@(OldItems, ';')' --references '@(_ResolveAssemblyReferenceResolvedFiles, ';')'" Condition="$(MSBuildProjectFullPath.EndsWith('.fsproj'))" />

<Exec Command="/bin/ls -la">
<Output TaskParameter="ToolOut" />
</Exec>

<Message Text="$(ToolOut)" />

<AdaptifyTask
GenerateLenses="$(GenerateLenses)"
TargetFramework="$(TargetFramework)"
Debug="$(DebugHate)"
TouchFiles="$(TouchFiles)"
Files="@(OldItems)"
References="@(_ResolveAssemblyReferenceResolvedFiles)"
ProjectFile="$(MSBuildProjectFullPath)"
DesignTime="$(DesignTimeBuild)"
Defines="$(DefineConstants)"
OutputPath="$(IntermediateOutputPath)"
OutputType="$(OutputType)" >
<Output TaskParameter="Results" ItemName="Results" />
</AdaptifyTask>
<ItemGroup>
<ReadLinesFromFile File="$(IntermediateOutputPath)\adaptify.files">
<Output TaskParameter="Lines" ItemName="Results"/>
</ReadLinesFromFile>

<ItemGroup>
<Compile Remove="@(OldItems)" />
<Compile Include="@(Results)" />
<OldItems Remove="@(OldItems)" />
Expand All @@ -44,9 +27,12 @@
<ItemGroup>
<FilesToClean Include="$(IntermediateOutputPath)\.adaptifycache" />
<FilesToClean Include="$(IntermediateOutputPath)\**\*.g.fs" />
<FilesToClean Include="$(IntermediateOutputPath)\adaptify.files" />
</ItemGroup>
<Target Name="DeleteAdaptifyCache" BeforeTargets="Clean;Rebuild">
<Delete Files="@(FilesToClean)" />
</Target>



</Project>

0 comments on commit e492180

Please sign in to comment.