Skip to content

Commit

Permalink
Fix #4075 - Replace Embed property with EmbeddedFiles item group in M…
Browse files Browse the repository at this point in the history
…icrosoft.FSharp.Targets (#5487)

* Fix #4075

* EmbeddedFiles
  • Loading branch information
KevinRansom committed Aug 22, 2018
1 parent 46b758f commit 89275d2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
12 changes: 7 additions & 5 deletions src/fsharp/FSharp.Build/Fsc.fs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type public Fsc () as this =
let mutable documentationFile : string = null
let mutable dotnetFscCompilerPath : string = null
let mutable embedAllSources = false
let mutable embed : string = null
let mutable embeddedFiles : ITaskItem[] = [||]
let mutable generateInterfaceFile : string = null
let mutable highEntropyVA : bool = false
let mutable keyFile : string = null
Expand Down Expand Up @@ -106,7 +106,9 @@ type public Fsc () as this =
| _ -> null)
if embedAllSources then
builder.AppendSwitch("--embed+")
builder.AppendSwitchIfNotNull("--embed:", embed)
if embeddedFiles <> null then
for item in embeddedFiles do
builder.AppendSwitchIfNotNull("--embed:", item.ItemSpec)
builder.AppendSwitchIfNotNull("--sourcelink:", sourceLink)
// NoFramework
if noFramework then
Expand Down Expand Up @@ -290,9 +292,9 @@ type public Fsc () as this =
with get() = embedAllSources
and set(s) = embedAllSources <- s

member fsc.Embed
with get() = embed
and set(e) = embed <- e
member fsc.EmbeddedFiles
with get() = embeddedFiles
and set(e) = embeddedFiles <- e

// --generate-interface-file <string>:
// Print the inferred interface of the
Expand Down
6 changes: 5 additions & 1 deletion src/fsharp/FSharp.Build/Microsoft.FSharp.Targets
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,10 @@ this file.
Include="@(_CoreCompileResourceInputs);@(CompiledLicenseFile);@(AdditionalEmbeddedResource)" />
</ItemGroup>

<ItemGroup>
<EmbeddedFiles Include="@(Embed)" KeepDuplicates="false" />
</ItemGroup>

<!-- Condition is to filter out the _CoreCompileResourceInputs so that it doesn't pass in culture resources to the compiler -->
<!-- NOTE: ManifestResourceWithNoCulture and ManifestNonResxWithNoCultureOnDisk are generated by Mono targets files -->
<Fsc Condition=" '%(_CoreCompileResourceInputs.WithCulture)' != 'true' "
Expand All @@ -273,7 +277,7 @@ this file.
DocumentationFile="$(DocumentationFile)"
DotnetFscCompilerPath="$(DotnetFscCompilerPath)"
EmbedAllSources="$(EmbedAllSources)"
Embed="$(Embed)"
EmbeddedFiles="@(EmbeddedFiles)"
GenerateInterfaceFile="$(GenerateInterfaceFile)"
HighEntropyVA="$(HighEntropyVA)"
KeyFile="$(KeyOriginatorFile)"
Expand Down

0 comments on commit 89275d2

Please sign in to comment.