Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3c49693

Browse files
committed
Update Microsoft.FSharp.targets in bootstrap to handle resources correctly
1 parent4e22c7c commit3c49693

File tree

1 file changed

+175
-107
lines changed

1 file changed

+175
-107
lines changed

‎lib/bootstrap/4.0/Microsoft.FSharp.targets‎

Lines changed: 175 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,37 @@ Copyright (C) Microsoft Corporation. Apache 2.0 License.
1818
<Projectxmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1919

2020

21-
<UsingTaskTaskName="Fsc"AssemblyFile="FSharp.Build.dll"Condition="Exists('$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll')" />
22-
<UsingTaskTaskName="CreateFSharpManifestResourceName"AssemblyFile="FSharp.Build.dll"Condition="Exists('$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll')" />
21+
<UsingTaskTaskName="Fsc"AssemblyFile="FSharp.Build.dll"Condition="Exists('$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll')" />
22+
<UsingTaskTaskName="CreateFSharpManifestResourceName"AssemblyFile="FSharp.Build.dll"Condition="Exists('$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll')" />
2323

24-
<!-- The next two are for when the ToolsVersion is 3.5, i.e. we're referencing .NET 2.0-->
25-
<UsingTaskTaskName="Fsc"AssemblyFile="$(MSBuildExtensionsPath32)\..\2.0\FSharp.Build.dll"Condition="!Exists('$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll') AND Exists('$(MSBuildExtensionsPath32)\..\2.0\FSharp.Build.dll')" />
26-
<UsingTaskTaskName="CreateFSharpManifestResourceName"AssemblyFile="$(MSBuildExtensionsPath32)\..\2.0\FSharp.Build.dll"Condition="!Exists('$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll') AND Exists('$(MSBuildExtensionsPath32)\..\2.0\FSharp.Build.dll')" />
24+
<!-- The next two are for when the ToolsVersion is 3.5, i.e. we're referencing .NET 2.0-->
25+
<UsingTaskTaskName="Fsc"AssemblyFile="$(MSBuildExtensionsPath32)\..\2.0\FSharp.Build.dll"Condition="!Exists('$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll') AND Exists('$(MSBuildExtensionsPath32)\..\2.0\FSharp.Build.dll')" />
26+
<UsingTaskTaskName="CreateFSharpManifestResourceName"AssemblyFile="$(MSBuildExtensionsPath32)\..\2.0\FSharp.Build.dll"Condition="!Exists('$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll') AND Exists('$(MSBuildExtensionsPath32)\..\2.0\FSharp.Build.dll')" />
2727

2828

2929

3030

31-
<PropertyGroup>
32-
<DefaultLanguageSourceExtension>.fs</DefaultLanguageSourceExtension>
33-
<Language>F#</Language>
34-
<TailcallsCondition="'$(Tailcalls)'==''">$(Optimize)</Tailcalls>
35-
<FrameworkRegistryBaseCondition="'$(TargetFrameworkIdentifier)'=='Silverlight'">Software\Microsoft\Microsoft SDKs\$(TargetFrameworkIdentifier)</FrameworkRegistryBase>
36-
<!-- Visual studio requires a non-empty RootNamespace value for "Add New Item" to work.-->
37-
<RootNamespaceCondition="'$(RootNamespace)'==''">RootNamespace</RootNamespace>
38-
</PropertyGroup>
31+
<PropertyGroup>
32+
<ImportByWildcardBeforeMicrosoftFSharpTargetsCondition="'$(ImportByWildcardBeforeMicrosoftFSharpTargets)' == ''">true</ImportByWildcardBeforeMicrosoftFSharpTargets>
33+
<ImportByWildcardAfterMicrosoftFSharpTargetsCondition="'$(ImportByWildcardAfterMicrosoftFSharpTargets)' == ''">true</ImportByWildcardAfterMicrosoftFSharpTargets>
34+
</PropertyGroup>
3935

40-
<!--
36+
<ImportProject="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\$(MSBuildThisFile)\ImportBefore\*"Condition="'$(ImportByWildcardBeforeMicrosoftFSharpTargets)' == 'true' and exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\$(MSBuildThisFile)\ImportBefore')"/>
37+
38+
<PropertyGroup>
39+
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
40+
<DefaultLanguageSourceExtension>.fs</DefaultLanguageSourceExtension>
41+
<Language>F#</Language>
42+
<TargetRuntime>Managed</TargetRuntime>
43+
<TailcallsCondition="'$(Tailcalls)'==''">$(Optimize)</Tailcalls>
44+
<FrameworkRegistryBaseCondition="'$(TargetFrameworkIdentifier)'=='Silverlight'">Software\Microsoft\Microsoft SDKs\$(TargetFrameworkIdentifier)</FrameworkRegistryBase>
45+
<!-- Visual studio requires a non-empty RootNamespace value for "Add New Item" to work.-->
46+
<RootNamespaceCondition="'$(RootNamespace)'==''">RootNamespace</RootNamespace>
47+
<Actual32BitCondition="'$(TargetFrameworkVersion)'=='v2.0' or '$(TargetFrameworkVersion)'=='v3.0' or '$(TargetFrameworkVersion)'=='v3.5' or '$(TargetFrameworkVersion)'=='v4.0'">false</Actual32Bit>
48+
<Actual32BitCondition="!('$(TargetFrameworkVersion)'=='v2.0' or '$(TargetFrameworkVersion)'=='v3.0' or '$(TargetFrameworkVersion)'=='v3.5' or '$(TargetFrameworkVersion)'=='v4.0')">$(Prefer32Bit)</Actual32Bit>
49+
</PropertyGroup>
50+
51+
<!--
4152
The CreateManifestResourceNames target create the manifest resource names from the .RESX
4253
files.
4354
@@ -57,59 +68,109 @@ Copyright (C) Microsoft Corporation. Apache 2.0 License.
5768
5869
For other project systems, this transformation may be different.
5970
-->
60-
<PropertyGroup>
61-
<CreateManifestResourceNamesDependsOn></CreateManifestResourceNamesDependsOn>
62-
</PropertyGroup>
63-
64-
<TargetName="CreateManifestResourceNames"
65-
Condition="'@(EmbeddedResource)' != ''"
66-
DependsOnTargets="$(CreateManifestResourceNamesDependsOn)">
67-
<CreateFSharpManifestResourceNameCondition="'@(ResxWithNoCulture)' != ''"
68-
ResourceFiles="@(ResxWithNoCulture)"RootNamespace="$(RootNamespace)">
69-
<Output TaskParameter ="ManifestResourceNames" ItemName ="ManifestResourceWithNoCultureName" />
70-
</CreateFSharpManifestResourceName>
71-
72-
<CreateFSharpManifestResourceNameCondition="'@(NonResxWithNoCulture)' != ''"
73-
ResourceFiles="@(NonResxWithNoCulture)"RootNamespace="$(RootNamespace)">
74-
<Output TaskParameter ="ManifestResourceNames" ItemName ="ManifestNonResxWithNoCulture" />
75-
</CreateFSharpManifestResourceName>
76-
77-
<CreateFSharpManifestResourceNameCondition="'@(ResxWithCulture)' != ''"
78-
ResourceFiles="@(ResxWithCulture)"RootNamespace="$(RootNamespace)">
79-
<Output TaskParameter ="ManifestResourceNames" ItemName ="ManifestResourceWithCultureName" />
80-
</CreateFSharpManifestResourceName>
81-
82-
<CreateFSharpManifestResourceNameCondition="'@(NonResxWithCulture)' != ''"
83-
ResourceFiles="@(NonResxWithCulture)"RootNamespace="$(RootNamespace)">
84-
<Output TaskParameter ="ManifestResourceNames" ItemName ="ManifestNonResxWithCulture" />
85-
</CreateFSharpManifestResourceName>
86-
87-
88-
<ItemGroup>
89-
<EmbeddedResourceRemove="@(EmbeddedResource)"Condition="'%(EmbeddedResource.ManifestResourceName)' == ''"/>
90-
<EmbeddedResourceInclude="@(_Temporary)" />
91-
<_TemporaryRemove="@(_Temporary)" />
92-
</ItemGroup>
93-
94-
</Target>
95-
71+
<PropertyGroup>
72+
<CreateManifestResourceNamesDependsOn></CreateManifestResourceNamesDependsOn>
73+
</PropertyGroup>
74+
75+
<PropertyGroup>
76+
<UsingXBuild>false</UsingXBuild>
77+
<UsingXBuildCondition="Exists('$(MSBuildExtensionsPath32)\..\4.0\Mono.Posix.dll')">true</UsingXBuild>
78+
</PropertyGroup>
79+
80+
81+
<Target
82+
Name="CreateManifestResourceNames"
83+
Condition="'@(EmbeddedResource)' != ''"
84+
DependsOnTargets="$(CreateManifestResourceNamesDependsOn)"
85+
>
9686
<ItemGroup>
97-
<DocFileItemInclude="$(DocumentationFile)"Condition="'$(DocumentationFile)'!=''"/>
87+
<_TemporaryRemove="@(_Temporary)" />
9888
</ItemGroup>
9989

100-
<ItemGroupCondition="'$(_DebugSymbolsProduced)' == 'true' and '$(PdbFile)' != ''">
101-
<_DebugSymbolsIntermediatePathTemporaryInclude="$(PdbFile)"/>
102-
<!-- Add any missing .pdb extension, as the compiler does-->
103-
<_DebugSymbolsIntermediatePathInclude="@(_DebugSymbolsIntermediatePathTemporary->'%(RootDir)%(Directory)%(Filename).pdb')"/>
90+
<!-- START XBUILD-->
91+
92+
<!-- This is the implementation of CreateManifestResourceNames which is compatible with the way-->
93+
<!-- xbuild processes resource names-->
94+
95+
<CreateFSharpManifestResourceName
96+
Condition="'@(ResxWithNoCulture)' != '' AND '$(UsingXBuild)' == 'true'"
97+
ResourceFiles="@(ResxWithNoCulture)"RootNamespace="$(RootNamespace)">
98+
<Output TaskParameter ="ManifestResourceNames" ItemName ="ManifestResourceWithNoCultureName" />
99+
</CreateFSharpManifestResourceName>
100+
101+
<CreateFSharpManifestResourceName
102+
Condition="'@(NonResxWithNoCulture)' != '' AND '$(UsingXBuild)' == 'true'"
103+
ResourceFiles="@(NonResxWithNoCulture)"RootNamespace="$(RootNamespace)">
104+
<Output TaskParameter ="ManifestResourceNames" ItemName ="ManifestNonResxWithNoCulture" />
105+
</CreateFSharpManifestResourceName>
106+
107+
<CreateFSharpManifestResourceName
108+
Condition="'@(ResxWithCulture)' != '' AND '$(UsingXBuild)' == 'true'"
109+
ResourceFiles="@(ResxWithCulture)"RootNamespace="$(RootNamespace)">
110+
<Output TaskParameter ="ManifestResourceNames" ItemName ="ManifestResourceWithCultureName" />
111+
</CreateFSharpManifestResourceName>
112+
113+
<CreateFSharpManifestResourceName
114+
Condition="'@(NonResxWithCulture)' != '' AND '$(UsingXBuild)' == 'true'"
115+
ResourceFiles="@(NonResxWithCulture)"RootNamespace="$(RootNamespace)">
116+
<Output TaskParameter ="ManifestResourceNames" ItemName ="ManifestNonResxWithCulture" />
117+
</CreateFSharpManifestResourceName>
118+
119+
<!-- END XBUILD-->
120+
121+
122+
<!-- START MSBUILD-->
123+
124+
<!-- This is the implementation of CreateManifestResourceNames which is compatible with the way-->
125+
<!-- msbuild processes resource names-->
126+
127+
<CreateFSharpManifestResourceName
128+
ResourceFiles="@(EmbeddedResource)"
129+
RootNamespace="$(RootNamespace)"
130+
Condition="'%(EmbeddedResource.ManifestResourceName)' == '' and ('%(EmbeddedResource.WithCulture)' == 'false' or '%(EmbeddedResource.Type)' == 'Resx') AND '$(UsingXBuild)' == 'false'">
131+
132+
<OutputTaskParameter="ResourceFilesWithManifestResourceNames"ItemName="_Temporary" />
133+
134+
</CreateFSharpManifestResourceName>
135+
136+
<CreateFSharpManifestResourceName
137+
ResourceFiles="@(EmbeddedResource)"
138+
RootNamespace="$(RootNamespace)"
139+
PrependCultureAsDirectory="false"
140+
Condition="'%(EmbeddedResource.ManifestResourceName)' == '' and '%(EmbeddedResource.WithCulture)' == 'true' and '%(EmbeddedResource.Type)' == 'Non-Resx' AND '$(UsingXBuild)' == 'false'">
141+
142+
<OutputTaskParameter="ResourceFilesWithManifestResourceNames"ItemName="_Temporary" />
143+
144+
</CreateFSharpManifestResourceName>
145+
146+
<!-- END MSBUILD-->
147+
148+
149+
<ItemGroup>
150+
<EmbeddedResourceRemove="@(EmbeddedResource)"Condition="'%(EmbeddedResource.ManifestResourceName)' == ''"/>
151+
<EmbeddedResourceInclude="@(_Temporary)" />
152+
<_TemporaryRemove="@(_Temporary)" />
104153
</ItemGroup>
105154

106-
<PropertyGroup>
107-
<CoreCompileDependsOn></CoreCompileDependsOn>
108-
</PropertyGroup>
155+
</Target>
156+
157+
<ItemGroup>
158+
<DocFileItemInclude="$(DocumentationFile)"Condition="'$(DocumentationFile)'!=''"/>
159+
</ItemGroup>
160+
161+
<ItemGroupCondition="'$(_DebugSymbolsProduced)' == 'true' and '$(PdbFile)' != ''">
162+
<_DebugSymbolsIntermediatePathTemporaryInclude="$(PdbFile)"/>
163+
<!-- Add any missing .pdb extension, as the compiler does-->
164+
<_DebugSymbolsIntermediatePathInclude="@(_DebugSymbolsIntermediatePathTemporary->'%(RootDir)%(Directory)%(Filename).pdb')"/>
165+
</ItemGroup>
166+
167+
<PropertyGroup>
168+
<CoreCompileDependsOn></CoreCompileDependsOn>
169+
</PropertyGroup>
109170

110-
<Target
111-
Name="CoreCompile"
112-
Inputs="$(MSBuildAllProjects);
171+
<Target
172+
Name="CoreCompile"
173+
Inputs="$(MSBuildAllProjects);
113174
@(CompileBefore);
114175
@(Compile);
115176
@(CompileAfter);
@@ -125,70 +186,77 @@ Copyright (C) Microsoft Corporation. Apache 2.0 License.
125186
@(CustomAdditionalCompileInputs);
126187
$(VersionFile);
127188
$(KeyOriginatorFile)"
128-
Outputs="@(DocFileItem);
189+
Outputs="@(DocFileItem);
129190
@(IntermediateAssembly);
130191
@(_DebugSymbolsIntermediatePath);
131192
$(NonExistentFile);
132193
@(CustomAdditionalCompileOutputs)"
133-
DependsOnTargets="$(CoreCompileDependsOn)"
194+
DependsOnTargets="$(CoreCompileDependsOn)"
134195
>
135196

136-
<!-- See bug 6053
197+
<!-- See bug 6053
137198
<Error
138199
Condition="'$(SilverlightVersion)' != '' and !(Exists('$(ProgramFiles)\Microsoft F#\Silverlight\Libraries\Client\$(SilverlightVersion)\FSharp.Core.dll'))"
139200
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"
140201
/>
141202
-->
142203

143-
<Warning
144-
Condition="'$(Win32ResourceFile)' != ''"
145-
Text="The property&lt;Win32ResourceFile> has been renamed to&lt;Win32Resource>. Update your project file to ensure that the correct value is passed via the --win32res option to the F# compiler."
204+
<Warning
205+
Condition="'$(Win32ResourceFile)' != ''"
206+
Text="The property&lt;Win32ResourceFile> has been renamed to&lt;Win32Resource>. Update your project file to ensure that the correct value is passed via the --win32res option to the F# compiler."
146207
/>
147208

148-
<!-- Condition is to filter out the _CoreCompileResourceInputs so that it doesn't pass in culture resources to the compiler-->
149-
<FscCondition=" '%(_CoreCompileResourceInputs.WithCulture)' != 'true'"
150-
BaseAddress="$(BaseAddress)"
151-
CodePage="$(CodePage)"
152-
DebugSymbols="$(DebugSymbols)"
153-
DebugType="$(DebugType)"
154-
DefineConstants="$(DefineConstants)"
155-
DisabledWarnings="$(NoWarn)"
156-
DocumentationFile="$(DocumentationFile)"
157-
GenerateInterfaceFile="$(GenerateInterfaceFile)"
158-
KeyFile="$(KeyOriginatorFile)"
159-
LCID="$(LCID)"
160-
NoFramework="true"
161-
Optimize="$(Optimize)"
162-
OtherFlags="$(OtherFlags)"
163-
OutputAssembly="@(IntermediateAssembly)"
164-
PdbFile="$(PdbFile)"
165-
Platform="$(PlatformTarget)"
166-
References="@(ReferencePath)"
167-
ReferencePath="$(ReferencePath)"
168-
Resources="@(ManifestResourceWithNoCulture);@(ManifestNonResxWithNoCultureOnDisk);@(CompiledLicenseFile);@(AdditionalEmbeddedResource)"
169-
Sources="@(CompileBefore);@(Compile);@(CompileAfter)"
170-
Tailcalls="$(Tailcalls)"
171-
TargetType="$(OutputType)"
172-
ToolExe="$(FscToolExe)"
173-
ToolPath="$(FscToolPath)"
174-
TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
175-
Utf8Output="$(Utf8Output)"
176-
ValidateTypeProviders="$(ValidateTypeProviders)"
177-
VersionFile="$(VersionFile)"
178-
VisualStudioStyleErrors="$(VisualStudioStyleErrors)"
179-
WarningLevel="$(WarningLevel)"
180-
WarningsAsErrors="$(WarningsAsErrors)"
181-
Win32ManifestFile="$(Win32Manifest)"
182-
Win32ResourceFile="$(Win32Resource)"
209+
<!-- Condition is to filter out the _CoreCompileResourceInputs so that it doesn't pass in culture resources to the compiler-->
210+
<FscCondition=" '%(_CoreCompileResourceInputs.WithCulture)' != 'true'"
211+
BaseAddress="$(BaseAddress)"
212+
CodePage="$(CodePage)"
213+
DebugSymbols="$(DebugSymbols)"
214+
DebugType="$(DebugType)"
215+
DefineConstants="$(DefineConstants)"
216+
DisabledWarnings="$(NoWarn)"
217+
DocumentationFile="$(DocumentationFile)"
218+
GenerateInterfaceFile="$(GenerateInterfaceFile)"
219+
KeyFile="$(KeyOriginatorFile)"
220+
LCID="$(LCID)"
221+
NoFramework="true"
222+
Optimize="$(Optimize)"
223+
OtherFlags="$(OtherFlags)"
224+
OutputAssembly="@(IntermediateAssembly)"
225+
PdbFile="$(PdbFile)"
226+
Platform="$(PlatformTarget)"
227+
References="@(ReferencePath)"
228+
ReferencePath="$(ReferencePath)"
229+
Resources="@(ManifestResourceWithNoCulture);@(ManifestNonResxWithNoCultureOnDisk);@(CompiledLicenseFile);@(AdditionalEmbeddedResource)"
230+
Sources="@(CompileBefore);@(Compile);@(CompileAfter)"
231+
Tailcalls="$(Tailcalls)"
232+
TargetType="$(OutputType)"
233+
ToolExe="$(FscToolExe)"
234+
ToolPath="$(FscToolPath)"
235+
TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
236+
Utf8Output="$(Utf8Output)"
237+
ValidateTypeProviders="$(ValidateTypeProviders)"
238+
VersionFile="$(VersionFile)"
239+
VisualStudioStyleErrors="$(VisualStudioStyleErrors)"
240+
WarningLevel="$(WarningLevel)"
241+
WarningsAsErrors="$(WarningsAsErrors)"
242+
Win32ManifestFile="$(Win32Manifest)"
243+
Win32ResourceFile="$(Win32Resource)"
183244
/>
184245

185-
<ItemGroup>
186-
<_CoreCompileResourceInputsRemove="@(_CoreCompileResourceInputs)" />
187-
</ItemGroup>
246+
<!-- These parameters are supported by F# 3.0 but not yet supported by the F# open source edition:
247+
Prefer32Bit="$(Actual32Bit)"
248+
SubsystemVersion="$(SubsystemVersion)"
249+
HighEntropyVA="$(HighEntropyVA)"-->
250+
251+
<ItemGroup>
252+
<_CoreCompileResourceInputsRemove="@(_CoreCompileResourceInputs)" />
253+
</ItemGroup>
254+
255+
</Target>
188256

189-
</Target>
257+
<ImportProject="$(MSBuildBinPath)\Microsoft.Common.targets"/>
190258

191-
<ImportProject="$(MSBuildBinPath)\Microsoft.Common.targets"/>
259+
<ImportProject="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\$(MSBuildThisFile)\ImportAfter\*"Condition="'$(ImportByWildcardAfterMicrosoftFSharpTargets)' == 'true' and exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\$(MSBuildThisFile)\ImportAfter')"/>
192260

193261
</Project>
194262

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp