@@ -17,20 +17,31 @@ Copyright (C) Microsoft Corporation. Apache 2.0 License.
1717
1818<Project xmlns =" http://schemas.microsoft.com/developer/msbuild/2003" >
1919
20- <UsingTask TaskName =" Fsc" AssemblyFile =" FSharp.Build-proto.dll" />
21- <UsingTask TaskName =" CreateFSharpManifestResourceName" AssemblyFile =" FSharp.Build-proto.dll" />
22-
23-
24- <PropertyGroup >
25- <DefaultLanguageSourceExtension >.fs</DefaultLanguageSourceExtension >
26- <Language >F#</Language >
27- <Tailcalls Condition =" '$(Tailcalls)'==''" >$(Optimize)</Tailcalls >
28- <FrameworkRegistryBase Condition =" '$(TargetFrameworkIdentifier)'=='Silverlight'" >Software\Microsoft\Microsoft SDKs\$(TargetFrameworkIdentifier)</FrameworkRegistryBase >
29- <!-- Visual studio requires a non-empty RootNamespace value for "Add New Item" to work.-->
30- <RootNamespace Condition =" '$(RootNamespace)'==''" >RootNamespace</RootNamespace >
31- </PropertyGroup >
32-
33- <!--
20+ <UsingTask TaskName =" Fsc" AssemblyFile =" FSharp.Build-proto.dll" />
21+ <UsingTask TaskName =" CreateFSharpManifestResourceName" AssemblyFile =" FSharp.Build-proto.dll" />
22+
23+
24+ <PropertyGroup >
25+ <ImportByWildcardBeforeMicrosoftFSharpTargets Condition =" '$(ImportByWildcardBeforeMicrosoftFSharpTargets)' == ''" >true</ImportByWildcardBeforeMicrosoftFSharpTargets >
26+ <ImportByWildcardAfterMicrosoftFSharpTargets Condition =" '$(ImportByWildcardAfterMicrosoftFSharpTargets)' == ''" >true</ImportByWildcardAfterMicrosoftFSharpTargets >
27+ </PropertyGroup >
28+
29+ <Import Project =" $(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\$(MSBuildThisFile)\ImportBefore\*" Condition =" '$(ImportByWildcardBeforeMicrosoftFSharpTargets)' == 'true' and exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\$(MSBuildThisFile)\ImportBefore')" />
30+
31+ <PropertyGroup >
32+ <MSBuildAllProjects >$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects >
33+ <DefaultLanguageSourceExtension >.fs</DefaultLanguageSourceExtension >
34+ <Language >F#</Language >
35+ <TargetRuntime >Managed</TargetRuntime >
36+ <Tailcalls Condition =" '$(Tailcalls)'==''" >$(Optimize)</Tailcalls >
37+ <FrameworkRegistryBase Condition =" '$(TargetFrameworkIdentifier)'=='Silverlight'" >Software\Microsoft\Microsoft SDKs\$(TargetFrameworkIdentifier)</FrameworkRegistryBase >
38+ <!-- Visual studio requires a non-empty RootNamespace value for "Add New Item" to work.-->
39+ <RootNamespace Condition =" '$(RootNamespace)'==''" >RootNamespace</RootNamespace >
40+ <Actual32Bit Condition =" '$(TargetFrameworkVersion)'=='v2.0' or '$(TargetFrameworkVersion)'=='v3.0' or '$(TargetFrameworkVersion)'=='v3.5' or '$(TargetFrameworkVersion)'=='v4.0'" >false</Actual32Bit >
41+ <Actual32Bit Condition =" !('$(TargetFrameworkVersion)'=='v2.0' or '$(TargetFrameworkVersion)'=='v3.0' or '$(TargetFrameworkVersion)'=='v3.5' or '$(TargetFrameworkVersion)'=='v4.0')" >$(Prefer32Bit)</Actual32Bit >
42+ </PropertyGroup >
43+
44+ <!--
3445 The CreateManifestResourceNames target create the manifest resource names from the .RESX
3546 files.
3647
@@ -50,63 +61,105 @@ Copyright (C) Microsoft Corporation. Apache 2.0 License.
5061
5162 For other project systems, this transformation may be different.
5263-->
53- <PropertyGroup >
54- <CreateManifestResourceNamesDependsOn ></CreateManifestResourceNamesDependsOn >
55- </PropertyGroup >
56-
57- <Target Name =" CreateManifestResourceNames"
58- Condition =" '@(EmbeddedResource)' != ''"
59- DependsOnTargets =" $(CreateManifestResourceNamesDependsOn)" >
60- <CreateFSharpManifestResourceName Condition =" '@(ResxWithNoCulture)' != ''"
64+ <PropertyGroup >
65+ <CreateManifestResourceNamesDependsOn ></CreateManifestResourceNamesDependsOn >
66+ </PropertyGroup >
67+
68+ <!-- This is the implementation of CreateManifestResourceNames which is compatible with the way-->
69+ <!-- xbuild processes resource names-->
70+ <Target
71+ Name =" CreateManifestResourceNames"
72+ Condition =" '@(EmbeddedResource)' != '' AND Exists('$(MSBuildToolsPath)\..\4.0\Mono.Posix.dll')"
73+ DependsOnTargets =" $(CreateManifestResourceNamesDependsOn)"
74+ >
75+ <CreateFSharpManifestResourceName Condition =" '@(ResxWithNoCulture)' != ''"
6176ResourceFiles=" @(ResxWithNoCulture)" RootNamespace =" $(RootNamespace)" >
62- <Output TaskParameter =" ManifestResourceNames" ItemName =" ManifestResourceWithNoCultureName" />
63- </CreateFSharpManifestResourceName >
77+ <Output TaskParameter =" ManifestResourceNames" ItemName =" ManifestResourceWithNoCultureName" />
78+ </CreateFSharpManifestResourceName >
6479
65- <CreateFSharpManifestResourceName Condition =" '@(NonResxWithNoCulture)' != ''"
80+ <CreateFSharpManifestResourceName Condition =" '@(NonResxWithNoCulture)' != ''"
6681ResourceFiles=" @(NonResxWithNoCulture)" RootNamespace =" $(RootNamespace)" >
67- <Output TaskParameter =" ManifestResourceNames" ItemName =" ManifestNonResxWithNoCulture" />
68- </CreateFSharpManifestResourceName >
82+ <Output TaskParameter =" ManifestResourceNames" ItemName =" ManifestNonResxWithNoCulture" />
83+ </CreateFSharpManifestResourceName >
6984
70- <CreateFSharpManifestResourceName Condition =" '@(ResxWithCulture)' != ''"
85+ <CreateFSharpManifestResourceName Condition =" '@(ResxWithCulture)' != ''"
7186ResourceFiles=" @(ResxWithCulture)" RootNamespace =" $(RootNamespace)" >
72- <Output TaskParameter =" ManifestResourceNames" ItemName =" ManifestResourceWithCultureName" />
73- </CreateFSharpManifestResourceName >
87+ <Output TaskParameter =" ManifestResourceNames" ItemName =" ManifestResourceWithCultureName" />
88+ </CreateFSharpManifestResourceName >
7489
75- <CreateFSharpManifestResourceName Condition =" '@(NonResxWithCulture)' != ''"
90+ <CreateFSharpManifestResourceName Condition =" '@(NonResxWithCulture)' != ''"
7691ResourceFiles=" @(NonResxWithCulture)" RootNamespace =" $(RootNamespace)" >
77- <Output TaskParameter =" ManifestResourceNames" ItemName =" ManifestNonResxWithCulture" />
78- </CreateFSharpManifestResourceName >
92+ <Output TaskParameter =" ManifestResourceNames" ItemName =" ManifestNonResxWithCulture" />
93+ </CreateFSharpManifestResourceName >
94+
7995
96+ <ItemGroup >
97+ <EmbeddedResource Remove =" @(EmbeddedResource)" Condition =" '%(EmbeddedResource.ManifestResourceName)' == ''" />
98+ </ItemGroup >
8099
81- <ItemGroup >
82- <EmbeddedResource Remove =" @(EmbeddedResource)" Condition =" '%(EmbeddedResource.ManifestResourceName)' == ''" />
83- <EmbeddedResource Include =" @(_Temporary)" />
84- <_Temporary Remove =" @(_Temporary)" />
85- </ItemGroup >
100+ </Target >
86101
87- </Target >
102+ <!-- This is the implementation of CreateManifestResourceNames which is compatible with the way-->
103+ <!-- msbuild processes resource names-->
104+ <Target
105+ Name =" CreateManifestResourceNames"
106+ Condition =" '@(EmbeddedResource)' != '' AND !Exists('$(MSBuildToolsPath)\..\4.0\Mono.Posix.dll')"
107+ DependsOnTargets =" $(CreateManifestResourceNamesDependsOn)" >
88108
89109 <ItemGroup >
90- < DocFileItem Include = " $(DocumentationFile )" Condition = " '$(DocumentationFile)'!='' " />
110+ < _Temporary Remove = " @(_Temporary )" />
91111 </ItemGroup >
92112
93- <ItemGroup Condition =" '$(_DebugSymbolsProduced)' == 'true' and '$(PdbFile)' != ''" >
94- <_DebugSymbolsIntermediatePathTemporary Include =" $(PdbFile)" />
95- <!-- Add any missing .pdb extension, as the compiler does-->
96- <_DebugSymbolsIntermediatePath Include =" @(_DebugSymbolsIntermediatePathTemporary->'%(RootDir)%(Directory)%(Filename).pdb')" />
113+ <!-- Create manifest names for culture and non-culture Resx files, and for non-culture Non-Resx resources-->
114+ <CreateFSharpManifestResourceName
115+ ResourceFiles =" @(EmbeddedResource)"
116+ RootNamespace =" $(RootNamespace)"
117+ Condition =" '%(EmbeddedResource.ManifestResourceName)' == '' and ('%(EmbeddedResource.WithCulture)' == 'false' or '%(EmbeddedResource.Type)' == 'Resx')" >
118+
119+ <Output TaskParameter =" ResourceFilesWithManifestResourceNames" ItemName =" _Temporary" />
120+
121+ </CreateFSharpManifestResourceName >
122+
123+ <!-- Create manifest names for all culture non-resx resources-->
124+ <CreateFSharpManifestResourceName
125+ ResourceFiles =" @(EmbeddedResource)"
126+ RootNamespace =" $(RootNamespace)"
127+ PrependCultureAsDirectory =" false"
128+ Condition =" '%(EmbeddedResource.ManifestResourceName)' == '' and '%(EmbeddedResource.WithCulture)' == 'true' and '%(EmbeddedResource.Type)' == 'Non-Resx'" >
129+
130+ <Output TaskParameter =" ResourceFilesWithManifestResourceNames" ItemName =" _Temporary" />
131+
132+ </CreateFSharpManifestResourceName >
133+
134+ <ItemGroup >
135+ <EmbeddedResource Remove =" @(EmbeddedResource)" Condition =" '%(EmbeddedResource.ManifestResourceName)' == ''" />
136+ <EmbeddedResource Include =" @(_Temporary)" />
137+ <_Temporary Remove =" @(_Temporary)" />
97138 </ItemGroup >
139+ </Target >
140+
141+ <ItemGroup >
142+ <DocFileItem Include =" $(DocumentationFile)" Condition =" '$(DocumentationFile)'!=''" />
143+ </ItemGroup >
98144
99- <PropertyGroup >
100- <CoreCompileDependsOn >_ComputeNonExistentFileProperty</CoreCompileDependsOn >
101- </PropertyGroup >
145+ <ItemGroup Condition =" '$(_DebugSymbolsProduced)' == 'true' and '$(PdbFile)' != ''" >
146+ <_DebugSymbolsIntermediatePathTemporary Include =" $(PdbFile)" />
147+ <!-- Add any missing .pdb extension, as the compiler does-->
148+ <_DebugSymbolsIntermediatePath Include =" @(_DebugSymbolsIntermediatePathTemporary->'%(RootDir)%(Directory)%(Filename).pdb')" />
149+ </ItemGroup >
102150
103- <Target
104- Name =" CoreCompile"
105- Inputs =" $(MSBuildAllProjects);
151+ <PropertyGroup >
152+ <CoreCompileDependsOn ></CoreCompileDependsOn >
153+ </PropertyGroup >
154+
155+ <Target
156+ Name =" CoreCompile"
157+ Inputs =" $(MSBuildAllProjects);
106158 @(CompileBefore);
107159 @(Compile);
108160 @(CompileAfter);
109161 @(_CoreCompileResourceInputs);
162+ @(ManifestNonResxWithNoCultureOnDisk);
110163 $(ApplicationIcon);
111164 $(AssemblyOriginatorKeyFile);
112165 @(ReferencePath);
@@ -117,70 +170,77 @@ Copyright (C) Microsoft Corporation. Apache 2.0 License.
117170 @(CustomAdditionalCompileInputs);
118171 $(VersionFile);
119172 $(KeyOriginatorFile)"
120- Outputs =" @(DocFileItem);
173+ Outputs =" @(DocFileItem);
121174 @(IntermediateAssembly);
122175 @(_DebugSymbolsIntermediatePath);
123176 $(NonExistentFile);
124177 @(CustomAdditionalCompileOutputs)"
125- DependsOnTargets =" $(CoreCompileDependsOn)"
178+ DependsOnTargets =" $(CoreCompileDependsOn)"
126179 >
127180
128- <!-- See bug 6053
181+ <!-- See bug 6053
129182 <Error
130183 Condition="'$(SilverlightVersion)' != '' and !(Exists('$(ProgramFiles)\Microsoft F#\Silverlight\Libraries\Client\$(SilverlightVersion)\FSharp.Core.dll'))"
131184 Text="F# runtime for Silverlight version $(SilverlightVersion) is not installed. Please go to http://go.microsoft.com/fwlink/?LinkId=177463 to download and install matching F# runtime"
132185 />
133186-->
134187
135- <Warning
136- Condition =" '$(Win32ResourceFile)' != ''"
137- Text =" The property< Win32ResourceFile> has been renamed to< Win32Resource>. Update your project file to ensure that the correct value is passed via the --win32res option to the F# compiler."
188+ <Warning
189+ Condition =" '$(Win32ResourceFile)' != ''"
190+ Text =" The property< Win32ResourceFile> has been renamed to< Win32Resource>. Update your project file to ensure that the correct value is passed via the --win32res option to the F# compiler."
138191 />
139192
140- <!-- Condition is to filter out the _CoreCompileResourceInputs so that it doesn't pass in culture resources to the compiler-->
141- <Fsc Condition =" '%(_CoreCompileResourceInputs.WithCulture)' != 'true'"
142- BaseAddress =" $(BaseAddress)"
143- CodePage =" $(CodePage)"
144- DebugSymbols =" $(DebugSymbols)"
145- DebugType =" $(DebugType)"
146- DefineConstants =" $(DefineConstants)"
147- DisabledWarnings =" $(NoWarn)"
148- DocumentationFile =" $(DocumentationFile)"
149- GenerateInterfaceFile =" $(GenerateInterfaceFile)"
150- KeyFile =" $(KeyOriginatorFile)"
151- LCID =" $(LCID)"
152- NoFramework =" true"
153- Optimize =" $(Optimize)"
154- OtherFlags =" $(OtherFlags)"
155- OutputAssembly =" @(IntermediateAssembly)"
156- PdbFile =" $(PdbFile)"
157- Platform =" $(PlatformTarget)"
158- References =" @(ReferencePath)"
159- ReferencePath =" $(ReferencePath)"
160- Resources =" @(ManifestResourceWithNoCulture);@(ManifestNonResxWithNoCultureOnDisk);@(CompiledLicenseFile);@(AdditionalEmbeddedResource)"
161- Sources =" @(CompileBefore);@(Compile);@(CompileAfter)"
162- Tailcalls =" $(Tailcalls)"
163- TargetType =" $(OutputType)"
164- ToolExe =" $(FscToolExe)"
165- ToolPath =" $(FscToolPath)"
166- TreatWarningsAsErrors =" $(TreatWarningsAsErrors)"
167- Utf8Output =" $(Utf8Output)"
168- ValidateTypeProviders =" $(ValidateTypeProviders)"
169- VersionFile =" $(VersionFile)"
170- VisualStudioStyleErrors =" $(VisualStudioStyleErrors)"
171- WarningLevel =" $(WarningLevel)"
172- WarningsAsErrors =" $(WarningsAsErrors)"
173- Win32ManifestFile =" $(Win32Manifest)"
174- Win32ResourceFile =" $(Win32Resource)"
193+ <!-- Condition is to filter out the _CoreCompileResourceInputs so that it doesn't pass in culture resources to the compiler-->
194+ <Fsc Condition =" '%(_CoreCompileResourceInputs.WithCulture)' != 'true'"
195+ BaseAddress =" $(BaseAddress)"
196+ CodePage =" $(CodePage)"
197+ DebugSymbols =" $(DebugSymbols)"
198+ DebugType =" $(DebugType)"
199+ DefineConstants =" $(DefineConstants)"
200+ DisabledWarnings =" $(NoWarn)"
201+ DocumentationFile =" $(DocumentationFile)"
202+ GenerateInterfaceFile =" $(GenerateInterfaceFile)"
203+ KeyFile =" $(KeyOriginatorFile)"
204+ LCID =" $(LCID)"
205+ NoFramework =" true"
206+ Optimize =" $(Optimize)"
207+ OtherFlags =" $(OtherFlags)"
208+ OutputAssembly =" @(IntermediateAssembly)"
209+ PdbFile =" $(PdbFile)"
210+ Platform =" $(PlatformTarget)"
211+ References =" @(ReferencePath)"
212+ ReferencePath =" $(ReferencePath)"
213+ Resources =" @(ManifestResourceWithNoCulture);@(ManifestNonResxWithNoCultureOnDisk);@(CompiledLicenseFile);@(AdditionalEmbeddedResource)"
214+ Sources =" @(CompileBefore);@(Compile);@(CompileAfter)"
215+ Tailcalls =" $(Tailcalls)"
216+ TargetType =" $(OutputType)"
217+ ToolExe =" $(FscToolExe)"
218+ ToolPath =" $(FscToolPath)"
219+ TreatWarningsAsErrors =" $(TreatWarningsAsErrors)"
220+ Utf8Output =" $(Utf8Output)"
221+ ValidateTypeProviders =" $(ValidateTypeProviders)"
222+ VersionFile =" $(VersionFile)"
223+ VisualStudioStyleErrors =" $(VisualStudioStyleErrors)"
224+ WarningLevel =" $(WarningLevel)"
225+ WarningsAsErrors =" $(WarningsAsErrors)"
226+ Win32ManifestFile =" $(Win32Manifest)"
227+ Win32ResourceFile =" $(Win32Resource)"
175228 />
176229
177- <ItemGroup >
178- <_CoreCompileResourceInputs Remove =" @(_CoreCompileResourceInputs)" />
179- </ItemGroup >
230+ <!-- These parameters are supported by F# 3.0 but not yet supported by the F# open source edition:
231+ Prefer32Bit="$(Actual32Bit)"
232+ SubsystemVersion="$(SubsystemVersion)"
233+ HighEntropyVA="$(HighEntropyVA)"-->
234+
235+ <ItemGroup >
236+ <_CoreCompileResourceInputs Remove =" @(_CoreCompileResourceInputs)" />
237+ </ItemGroup >
238+
239+ </Target >
180240
181- </ Target >
241+ < Import Project = " $(MSBuildBinPath)\Microsoft.Common.targets " / >
182242
183- <Import Project =" $(MSBuildBinPath)\Microsoft.Common.targets " />
243+ <Import Project =" $(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\$(MSBuildThisFile)\ImportAfter\* " Condition = " '$(ImportByWildcardAfterMicrosoftFSharpTargets)' == 'true' and exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\$(MSBuildThisFile)\ImportAfter') " />
184244
185245</Project >
186246