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

Commit8018564

Browse files
jack-pappasKevinRansom
authored andcommitted
Fix for #2595, ported from fsharp/fsharp (#2605)
* Fix for #2595, ported from fsharp/fsharp.* Fix .targets to work with xbuild and msbuildFix Microsoft.FSharp.targets with a workaround so resources are includedcorrectly when building with either msbuild or xbuild.
1 parent5e0b963 commit8018564

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

‎src/fsharp/FSharp.Build/Microsoft.FSharp.targets‎

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,25 @@ this file.
197197
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."
198198
/>
199199

200+
<!-- Workaround for differences between how msbuild and xbuild handle embedded resources.
201+
If we just naively include the additional items needed for mono, that leads to issues
202+
on msbuild/Windows due to double-including resources.
203+
Here, we use the $(UsingXBuild) property to conditionally set another property containing the
204+
correct list of resources based on the build system being used.
205+
This could be a bit simpler, but xbuild doesn't seem to support msbuild 4.0 'item functions'
206+
like Distinct().
207+
Reference: https://github.com/Microsoft/visualfsharp/pull/2595
208+
https://github.com/Microsoft/visualfsharp/pull/2605
209+
-->
210+
<ItemGroup>
211+
<ActualEmbeddedResources
212+
Condition=" '$(UsingXBuild)' == true"
213+
Include="@(_CoreCompileResourceInputs);@(ManifestResourceWithNoCulture);@(ManifestNonResxWithNoCultureOnDisk);@(CompiledLicenseFile);@(AdditionalEmbeddedResource)" />
214+
<ActualEmbeddedResources
215+
Condition=" '$(UsingXBuild)' != true"
216+
Include="@(_CoreCompileResourceInputs);@(CompiledLicenseFile);@(AdditionalEmbeddedResource)" />
217+
</ItemGroup>
218+
200219
<!-- Condition is to filter out the _CoreCompileResourceInputs so that it doesn't pass in culture resources to the compiler-->
201220
<!-- NOTE: ManifestResourceWithNoCulture and ManifestNonResxWithNoCultureOnDisk are generated by Mono targets files-->
202221
<FscCondition=" '%(_CoreCompileResourceInputs.WithCulture)' != 'true'"
@@ -221,7 +240,7 @@ this file.
221240
Prefer32Bit="$(Actual32Bit)"
222241
References="@(ReferencePath)"
223242
ReferencePath="$(ReferencePath)"
224-
Resources="@(_CoreCompileResourceInputs);@(CompiledLicenseFile);@(AdditionalEmbeddedResource)"
243+
Resources="@(ActualEmbeddedResources)"
225244
SourceLink="$(SourceLink)"
226245
Sources="@(CompileBefore);@(Compile);@(CompileAfter)"
227246
Tailcalls="$(Tailcalls)"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp