|
| 1 | +<?xml version="1.0" encoding="utf-8"?> |
| 2 | +<!-- Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. --> |
| 3 | +<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
| 4 | + |
| 5 | + <PropertyGroup> |
| 6 | + <FSCoreVersion>4.4.1.0</FSCoreVersion> |
| 7 | + <OutputPath>$(MSBuildThisFileDirectory)../BuildFromSource/$(Configuration)/bin</OutputPath> |
| 8 | + |
| 9 | + <DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference> |
| 10 | + <DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference> |
| 11 | + <EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems> |
| 12 | + |
| 13 | + <!-- Signing flags currently done using OtherFlags. Can migrate to properties once build target updated --> |
| 14 | + <DefineConstants>$(DefineConstants);STRONG_NAME_AND_DELAY_SIGN_FSHARP_COMPILER_WITH_MSFT_KEY</DefineConstants> |
| 15 | + <KeyFile>$(MSBuildThisFileDirectory)buildtools/keys/MSFT.snk</KeyFile> |
| 16 | + <PublicSign>true</PublicSign> |
| 17 | + <OtherFlags>$(OtherFlags) --publicsign --keyfile:$(KeyFile)</OtherFlags> |
| 18 | + <OtherFlags>$(OtherFlags) --nocopyfsharpcore</OtherFlags> |
| 19 | + |
| 20 | + <DotNetExe Condition=" '$(OS)' == 'Unix' ">dotnet</DotNetExe> |
| 21 | + <DotNetExe Condition=" '$(OS)' != 'Unix' ">dotnet.exe</DotNetExe> |
| 22 | + <DotNetExePath>$(MSBuildThisFileDirectory)../Tools/dotnet20/$(DotNetExe)</DotNetExePath> |
| 23 | + <DotNetExePath Condition="!Exists($(DotNetExe))">$(MSBuildBinPath)/../../$(DotNetExe)</DotNetExePath> |
| 24 | + |
| 25 | + <PreReleaseLabel></PreReleaseLabel> |
| 26 | + <BuildVersionFilePath Condition="'$(BuildVersionFilePath)'==''" >$(IntermediateOutputFile)\BuildVersionFile.props</BuildVersionFilePath> |
| 27 | + |
| 28 | + </PropertyGroup> |
| 29 | + |
| 30 | + <PropertyGroup> |
| 31 | + <TargetDotnetProfile Condition=" $(TargetFramework.StartsWith('netstandard')) or $(TargetFramework.StartsWith('netcoreapp1.0')) ">coreclr</TargetDotnetProfile> |
| 32 | + <TargetDotnetProfile Condition=" $(TargetFramework.StartsWith('netframework')) ">net40</TargetDotnetProfile> |
| 33 | + </PropertyGroup> |
| 34 | + |
| 35 | + <Import Project="FSharpSource.Profiles.targets" /> |
| 36 | + <Import Project="$(BuildVersionFilePath)" Condition="Exists('$(BuildVersionFilePath)')" /> |
| 37 | + |
| 38 | + <Target Name="CopyAndSubstituteTextFiles" |
| 39 | + BeforeTargets="Compile" |
| 40 | + Inputs="@(CopyAndSubstituteText)" |
| 41 | + Outputs="@(CopyAndSubstituteText->'$(OutDir)%(TargetFilename)')" > |
| 42 | + |
| 43 | + <PropertyGroup> |
| 44 | + <FileText> |
| 45 | + $([System.Text.RegularExpressions.Regex]::Replace($([System.IO.File]::ReadAllText("%(CopyAndSubstituteText.FullPath)")), "%(CopyAndSubstituteText.Pattern1)", "%(CopyAndSubstituteText.Replacement1)")) |
| 46 | + </FileText> |
| 47 | + |
| 48 | + <FileText Condition = "'%(CopyAndSubstituteText.Pattern2)' != ''"> |
| 49 | + $([System.Text.RegularExpressions.Regex]::Replace($(FileText), "%(CopyAndSubstituteText.Pattern2)", "%(CopyAndSubstituteText.Replacement2)")) |
| 50 | + </FileText> |
| 51 | + </PropertyGroup> |
| 52 | + <WriteLinesToFile File="$(OutDir)%(CopyAndSubstituteText.TargetFilename)" Lines="$(FileText)" Overwrite="true" /> |
| 53 | + </Target> |
| 54 | + |
| 55 | + <!-- |
| 56 | + ========================================================================= |
| 57 | + Build FsSrGen files. |
| 58 | + ========================================================================= |
| 59 | + --> |
| 60 | + <Target Name="CallFsSrGen" |
| 61 | + Inputs="@(FsSrGen)" |
| 62 | + Outputs="@(FsSrGen->'$(IntermediateOutputPath)%(Filename).fs');@(FsSrGen->'$(IntermediateOutputPath)%(Filename).resx')" |
| 63 | + Condition="'@(FsSrGen)' != ''"> |
| 64 | + |
| 65 | + <PropertyGroup> |
| 66 | + <FsSrGenPath>$(MSBuildThisFileDirectory)../Tools/fssrgen/fssrgen.dll</FsSrGenPath> |
| 67 | + </PropertyGroup> |
| 68 | + |
| 69 | + <!-- Create the output directory in case it doesn't exist yet --> |
| 70 | + <MakeDir Directories="$(IntermediateOutputPath)" /> |
| 71 | + |
| 72 | + <!-- Run the tool --> |
| 73 | + <Exec Command=""$(DotNetExePath)" "$(FsSrGenPath)" "%(FsSrGen.FullPath)" "$(IntermediateOutputPath)%(FsSrGen.Filename).fs" "$(IntermediateOutputPath)%(FsSrGen.Filename).resx" $(FsSrGenProjectName)" /> |
| 74 | + </Target> |
| 75 | + |
| 76 | + <Target Name="ProcessFsSrGen" |
| 77 | + DependsOnTargets="CallFsSrGen" |
| 78 | + Condition="'@(FsSrGen)'!=''" |
| 79 | + BeforeTargets="CoreResGen"> |
| 80 | + |
| 81 | + <CreateItem Include="$(IntermediateOutputPath)%(FsSrGen.Filename).fs"> |
| 82 | + <Output TaskParameter="Include" ItemName="CompileBefore"/> |
| 83 | + </CreateItem> |
| 84 | + <CreateItem Include="$(IntermediateOutputPath)%(FsSrGen.Filename).resx" AdditionalMetadata="ManifestResourceName=%(FsSrGen.Filename)"> |
| 85 | + <Output TaskParameter="Include" ItemName="EmbeddedResource"/> |
| 86 | + </CreateItem> |
| 87 | + <CreateItem Include="$(IntermediateOutputPath)%(FsSrGen.Filename).fs"> |
| 88 | + <Output TaskParameter="Include" ItemName="FileWrites"/> |
| 89 | + </CreateItem> |
| 90 | + <CreateItem Include="$(IntermediateOutputPath)%(FsSrGen.Filename).resx"> |
| 91 | + <Output TaskParameter="Include" ItemName="FileWrites"/> |
| 92 | + </CreateItem> |
| 93 | + </Target> |
| 94 | + |
| 95 | + <ItemGroup> |
| 96 | + <AvailableItemName Include="FsLex"> |
| 97 | + <Visible>false</Visible> |
| 98 | + </AvailableItemName> |
| 99 | + <AvailableItemName Include="FsYacc"> |
| 100 | + <Visible>false</Visible> |
| 101 | + </AvailableItemName> |
| 102 | + </ItemGroup> |
| 103 | + |
| 104 | + <!-- Build FsLex files. --> |
| 105 | + <Target Name="CallFsLex" |
| 106 | + Inputs="@(FsLex)" |
| 107 | + Outputs="@(FsLex->'$(FsLexOutputFolder)%(Filename).fs')" |
| 108 | + Condition="'@(FsLex)'!=''" |
| 109 | + BeforeTargets="CoreCompile"> |
| 110 | + |
| 111 | + <PropertyGroup> |
| 112 | + <FsLexPath>$(MSBuildThisFileDirectory)../Tools/fslex/fslex.dll</FsLexPath> |
| 113 | + </PropertyGroup> |
| 114 | + |
| 115 | + <!-- Create the output directory --> |
| 116 | + <MakeDir Directories="$(FsLexOutputFolder)"/> |
| 117 | + |
| 118 | + <!-- Run the tool --> |
| 119 | + <Exec Command=""$(DotNetExePath)" "$(FsLexPath)" -o "$(FsLexOutputFolder)%(FsLex.Filename).fs" %(FsLex.OtherFlags) %(FsLex.Identity)" /> |
| 120 | + |
| 121 | + <!-- Make sure it will get cleaned --> |
| 122 | + <CreateItem Include="$(FsLexOutputFolder)%(FsLex.Filename).fs"> |
| 123 | + <Output TaskParameter="Include" ItemName="FileWrites"/> |
| 124 | + </CreateItem> |
| 125 | + </Target> |
| 126 | + |
| 127 | + <!-- Build FsYacc files. --> |
| 128 | + <Target Name="CallFsYacc" |
| 129 | + Inputs="@(FsYacc)" |
| 130 | + Outputs="@(FsYacc->'$(FsYaccOutputFolder)%(Filename).fs')" |
| 131 | + Condition="'@(FsYacc)'!=''" |
| 132 | + BeforeTargets="CoreCompile"> |
| 133 | + |
| 134 | + <PropertyGroup> |
| 135 | + <FsYaccPath>$(MSBuildThisFileDirectory)../Tools/fsyacc/fsyacc.dll</FsYaccPath> |
| 136 | + </PropertyGroup> |
| 137 | + |
| 138 | + <!-- Create the output directory --> |
| 139 | + <MakeDir Directories="$(FsYaccOutputFolder)" /> |
| 140 | + |
| 141 | + <!-- Run the tool --> |
| 142 | + <Exec Command=""$(DotNetExePath)" "$(FsYaccPath)" -o "$(FsYaccOutputFolder)%(FsYacc.Filename).fs" %(FsYacc.OtherFlags) %(FsYacc.Identity)" /> |
| 143 | + |
| 144 | + <!-- Make sure it will get cleaned --> |
| 145 | + <CreateItem Include="$(FsYaccOutputFolder)%(FsYacc.Filename).fs"> |
| 146 | + <Output TaskParameter="Include" ItemName="FileWrites"/> |
| 147 | + </CreateItem> |
| 148 | + </Target> |
| 149 | + |
| 150 | +</Project> |
0 commit comments