1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
<!--
***********************************************************************************************
FSharp.SRGen.targets
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
Copyright (C) Microsoft Corporation. All rights reserved.
***********************************************************************************************
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="FsSrGen" AssemblyFile="FSharp.SRGen.Build.Tasks.dll"/>
<PropertyGroup>
<PrepareForBuildDependsOn>ProcessFsSrGen;$(PrepareForBuildDependsOn)</PrepareForBuildDependsOn>
</PropertyGroup>
<!-- Build FsSrGen files. -->
<Target
Name="CallFsSrGen"
Inputs="@(FsSrGen)"
Outputs="@(FsSrGen->'$(IntermediateOutputPath)%(Filename).fs');@(FsSrGen->'$(IntermediateOutputPath)%(Filename).resx')"
Condition="'@(FsSrGen)'!=''">
<!-- Create the output directory in case it doesn't exist yet -->
<MakeDir Directories="$(IntermediateOutputPath)"/>
<!-- Run the tool -->
<FsSrGen
InputFile="%(FsSrGen.FullPath)"
ToolPath="$(FsSrGenToolPath)"
OutputFsFile="$(IntermediateOutputPath)%(FsSrGen.Filename).fs"
OutputResxFile="$(IntermediateOutputPath)%(FsSrGen.Filename).resx"
>
</FsSrGen>
</Target>
<!-- Process FsSrGen rules. No 'Inputs' and 'Outputs' means this rule always runs if there is any @FsSrGen, even if up-to-date. -->
<Target
Name="ProcessFsSrGen"
DependsOnTargets="CallFsSrGen"
Condition="'@(FsSrGen)'!=''">
<!-- Make the outputs magically part of the project -->
<CreateItem Include="$(IntermediateOutputPath)%(FsSrGen.Filename).fs">
<Output TaskParameter="Include" ItemName="CompileBefore"/>
</CreateItem>
<CreateItem Include="$(IntermediateOutputPath)%(FsSrGen.Filename).resx"
AdditionalMetadata="ManifestResourceName=%(FsSrGen.Filename)">
<!-- Note AdditionalMetadata above; we need the name in the manifest to be Foo.resources and not e.g. obj.Debug.Foo.resources -->
<Output TaskParameter="Include" ItemName="EmbeddedResource"/>
</CreateItem>
<!-- Add them to the list of things under the IntermediateOutputPath that should be 'clean'ed -->
<CreateItem Include="$(IntermediateOutputPath)%(FsSrGen.Filename).fs">
<Output TaskParameter="Include" ItemName="FileWrites"/>
</CreateItem>
<CreateItem Include="$(IntermediateOutputPath)%(FsSrGen.Filename).resx">
<Output TaskParameter="Include" ItemName="FileWrites"/>
</CreateItem>
</Target>
<ItemGroup>
<AvailableItemName Include="FsSrGen">
<Visible>false</Visible>
</AvailableItemName>
</ItemGroup>
</Project>
|