Skip to content

Commit 89275d2

Browse files
authored
Fix #4075 - Replace Embed property with EmbeddedFiles item group in Microsoft.FSharp.Targets (#5487)
* Fix #4075 * EmbeddedFiles
1 parent 46b758f commit 89275d2

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/fsharp/FSharp.Build/Fsc.fs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ type public Fsc () as this =
3838
let mutable documentationFile : string = null
3939
let mutable dotnetFscCompilerPath : string = null
4040
let mutable embedAllSources = false
41-
let mutable embed : string = null
41+
let mutable embeddedFiles : ITaskItem[] = [||]
4242
let mutable generateInterfaceFile : string = null
4343
let mutable highEntropyVA : bool = false
4444
let mutable keyFile : string = null
@@ -106,7 +106,9 @@ type public Fsc () as this =
106106
| _ -> null)
107107
if embedAllSources then
108108
builder.AppendSwitch("--embed+")
109-
builder.AppendSwitchIfNotNull("--embed:", embed)
109+
if embeddedFiles <> null then
110+
for item in embeddedFiles do
111+
builder.AppendSwitchIfNotNull("--embed:", item.ItemSpec)
110112
builder.AppendSwitchIfNotNull("--sourcelink:", sourceLink)
111113
// NoFramework
112114
if noFramework then
@@ -290,9 +292,9 @@ type public Fsc () as this =
290292
with get() = embedAllSources
291293
and set(s) = embedAllSources <- s
292294

293-
member fsc.Embed
294-
with get() = embed
295-
and set(e) = embed <- e
295+
member fsc.EmbeddedFiles
296+
with get() = embeddedFiles
297+
and set(e) = embeddedFiles <- e
296298

297299
// --generate-interface-file <string>:
298300
// Print the inferred interface of the

src/fsharp/FSharp.Build/Microsoft.FSharp.Targets

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,10 @@ this file.
260260
Include="@(_CoreCompileResourceInputs);@(CompiledLicenseFile);@(AdditionalEmbeddedResource)" />
261261
</ItemGroup>
262262

263+
<ItemGroup>
264+
<EmbeddedFiles Include="@(Embed)" KeepDuplicates="false" />
265+
</ItemGroup>
266+
263267
<!-- Condition is to filter out the _CoreCompileResourceInputs so that it doesn't pass in culture resources to the compiler -->
264268
<!-- NOTE: ManifestResourceWithNoCulture and ManifestNonResxWithNoCultureOnDisk are generated by Mono targets files -->
265269
<Fsc Condition=" '%(_CoreCompileResourceInputs.WithCulture)' != 'true' "
@@ -273,7 +277,7 @@ this file.
273277
DocumentationFile="$(DocumentationFile)"
274278
DotnetFscCompilerPath="$(DotnetFscCompilerPath)"
275279
EmbedAllSources="$(EmbedAllSources)"
276-
Embed="$(Embed)"
280+
EmbeddedFiles="@(EmbeddedFiles)"
277281
GenerateInterfaceFile="$(GenerateInterfaceFile)"
278282
HighEntropyVA="$(HighEntropyVA)"
279283
KeyFile="$(KeyOriginatorFile)"

0 commit comments

Comments
 (0)