Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FSharp ms build task to support new fsc command line options #1616

Merged
merged 1 commit into from
Oct 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/FSharpSource.Settings.targets
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
<DebugType Condition=" '$(DebugType)' == '' and '$(TargetFramework)' == 'coreclr' ">embedded</DebugType>
<Optimize Condition=" '$(Optimize)' == '' ">false</Optimize>
<ErrorReport Condition=" '$(ErrorReport)' == '' ">prompt</ErrorReport>
<OtherFlags Condition=" '$(DebugType)' == '' and '$(TargetFramework)' != 'coreclr' ">$(OtherFlags) --no-jit-optimize</OtherFlags>
<OtherFlags Condition=" '$(DebugType)' == '' and '$(TargetFramework)' == 'coreclr' ">$(OtherFlags) --no-jit-optimize --embed</OtherFlags>
<OtherFlags>$(OtherFlags) --no-jit-optimize</OtherFlags>
<EmbedAllSource Condition=" '$(DebugType)' == 'portable' or '$(DebugType)' == 'embedded' ">true</EmbedAllSource>
<SourceLink Condition=" '$(DebugType)' == 'portable' or '$(DebugType)' == 'embedded' ">$(IntermediateOutputPath)source_link.json</SourceLink>
<DefineConstants Condition=" '$(ProjectLanguage)' != 'VisualBasic' ">DEBUG;TRACE;CODE_ANALYSIS;$(DefineConstants)</DefineConstants>
<DefineConstants Condition=" '$(ProjectLanguage)' == 'VisualBasic' ">DEBUG=True,TRACE=True,CODE_ANALYSIS=True,$(DefineConstants)</DefineConstants>
<SIGN_WITH_MSFT_KEY Condition=" '$(SIGN_WITH_MSFT_KEY)' == '' ">false</SIGN_WITH_MSFT_KEY>
Expand All @@ -42,6 +43,7 @@
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugType Condition=" '$(DebugType)' == '' ">pdbonly</DebugType>
<Optimize Condition=" '$(Optimize)' == '' ">true</Optimize>
<EmbedAllSource>false</EmbedAllSource>
<ErrorReport Condition=" '$(ErrorReport)' == '' ">prompt</ErrorReport>
<DefineConstants Condition=" '$(ProjectLanguage)' != 'VisualBasic' ">TRACE;$(DefineConstants)</DefineConstants>
<DefineConstants Condition=" '$(ProjectLanguage)' == 'VisualBasic' ">TRACE=True,$(DefineConstants)</DefineConstants>
Expand Down
19 changes: 18 additions & 1 deletion src/fsharp/FSharp.Build/Fsc.fs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden
let mutable defineConstants : ITaskItem[] = [||]
let mutable disabledWarnings : string = null
let mutable documentationFile : string = null
let mutable embedAllSources = false
let mutable embed : string = null
let mutable generateInterfaceFile : string = null
let mutable keyFile : string = null
let mutable noFramework = false
Expand All @@ -136,6 +138,7 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden
let mutable referencePath : string = null
let mutable resources : ITaskItem[] = [||]
let mutable sources : ITaskItem[] = [||]
let mutable sourceLink : string = null
let mutable targetType : string = null
#if FX_ATLEAST_35
#else
Expand Down Expand Up @@ -183,6 +186,10 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden
| "EMBEDDED" -> "embedded"
| "FULL" -> "full"
| _ -> null)
if embedAllSources then
builder.AppendSwitch("--embed+")
builder.AppendSwitchIfNotNull("--embed:", embed)
builder.AppendSwitchIfNotNull("--sourcelink:", sourceLink)
// NoFramework
if noFramework then
builder.AppendSwitch("--noframework")
Expand Down Expand Up @@ -316,7 +323,7 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden
member fsc.DebugSymbols
with get() = debugSymbols
and set(b) = debugSymbols <- b
// --debug <none/portable/pdbonly/full>: Emit debugging information
// --debug <none/portable/embedded/pdbonly/full>: Emit debugging information
member fsc.DebugType
with get() = debugType
and set(s) = debugType <- s
Expand All @@ -332,6 +339,12 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden
member fsc.DocumentationFile
with get() = documentationFile
and set(s) = documentationFile <- s
member fsc.EmbedAllSources
with get() = embedAllSources
and set(s) = embedAllSources <- s
member fsc.Embed
with get() = embed
and set(e) = embed <- e
// --generate-interface-file <string>:
// Print the inferred interface of the
// assembly to a file.
Expand Down Expand Up @@ -398,6 +411,10 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden
member fsc.Resources
with get() = resources
and set(a) = resources <- a
// SourceLink
member fsc.SourceLink
with get() = sourceLink
and set(s) = sourceLink <- s
// source files
member fsc.Sources
with get() = sources
Expand Down
3 changes: 3 additions & 0 deletions src/fsharp/FSharp.Build/Fsc.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ type Fsc = class
member DefineConstants : Microsoft.Build.Framework.ITaskItem [] with get,set
member DisabledWarnings : string with get,set
member DocumentationFile : string with get,set
member Embed : string with get,set
member EmbedAllSources : bool with get,set
member GenerateInterfaceFile : string with get,set
member KeyFile : string with get,set
member NoFramework : bool with get,set
Expand All @@ -37,6 +39,7 @@ type Fsc = class
member References : Microsoft.Build.Framework.ITaskItem [] with get,set
member ReferencePath : string with get,set
member Resources : Microsoft.Build.Framework.ITaskItem [] with get,set
member SourceLink : string with get,set
member Sources : Microsoft.Build.Framework.ITaskItem [] with get,set
member TargetType : string with get,set
#if FX_ATLEAST_35
Expand Down
3 changes: 3 additions & 0 deletions src/fsharp/FSharp.Build/Microsoft.FSharp.targets
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ this file.
DefineConstants="$(DefineConstants)"
DisabledWarnings="$(NoWarn)"
DocumentationFile="$(DocumentationFile)"
EmbedAllSources="$(EmbedAllSources)"
Embed="$(Embed)"
GenerateInterfaceFile="$(GenerateInterfaceFile)"
KeyFile="$(KeyOriginatorFile)"
LCID="$(LCID)"
Expand All @@ -173,6 +175,7 @@ this file.
References="@(ReferencePath)"
ReferencePath="$(ReferencePath)"
Resources="@(_CoreCompileResourceInputs);@(CompiledLicenseFile);@(AdditionalEmbeddedResource)"
SourceLink="$(SourceLink)"
Sources="@(CompileBefore);@(Compile);@(CompileAfter)"
Tailcalls="$(Tailcalls)"
TargetType="$(OutputType)"
Expand Down