Skip to content

Commit

Permalink
Added clean support to Weave templates.
Browse files Browse the repository at this point in the history
  • Loading branch information
otac0n committed Apr 10, 2021
1 parent 45fa603 commit 526c9a8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Weave/Weave.targets
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<Project ToolsVersion="4.0" TreatAsLocalProperty="WeaveAssemblyPath" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<CompileDependsOn>$(CompileDependsOn);CompileWeaveTemplates</CompileDependsOn>
<CoreBuildDependsOn>$(CoreBuildDependsOn);CompileWeaveTemplates</CoreBuildDependsOn>
</PropertyGroup>
<ItemGroup>
<AvailableItemName Include="WeaveTemplate" />
</ItemGroup>
Expand All @@ -15,7 +11,7 @@
</PropertyGroup>
<UsingTask AssemblyFile="$(WeaveAssemblyPath)" TaskName="CompileWeaveTemplate" />

<Target Name="CompileWeaveTemplates" BeforeTargets="CoreCompile" DependsOnTargets="_CompileWeaveTemplates" Condition=" '@(WeaveTemplate)' != '' ">
<Target Name="CompileWeaveTemplates" DependsOnTargets="_CompileWeaveTemplates" BeforeTargets="Compile;CoreCompile;Build;CoreBuild" Condition=" '@(WeaveTemplate)' != '' ">
<ItemGroup>
<Compile Include="%(WeaveTemplate.OutputPath)" />
</ItemGroup>
Expand All @@ -32,8 +28,12 @@
</ItemGroup>
</Target>

<Target Name="CleanWeaveTemplates" DependsOnTargets="_UpdateWeaveTemplatesMetatdata" BeforeTargets="Clean;CoreClean">
<Delete Files="@(WeaveTemplate -> '%(OutputPath)')" ContinueOnError="true" />
</Target>

<Target Name="_CompileWeaveTemplates" DependsOnTargets="_UpdateWeaveTemplatesMetatdata" Inputs="$(MSBuildThisFileFullPath);$(MSBuildProjectFile);@(WeaveTemplate)" Outputs="@(WeaveTemplate -> '%(OutputPath)')">
<CompileWeaveTemplate InputFile="%(WeaveTemplate.FullPath)" OutputFile="%(WeaveTemplate.OutputPath)" />
<Message Text="%(WeaveTemplate.Identity) -> %(WeaveTemplate.OutputPath)" />
<Message Text="%(WeaveTemplate.FullPath) -> %(WeaveTemplate.OutputPath)" />
</Target>
</Project>

0 comments on commit 526c9a8

Please sign in to comment.