FSharp ms build task to support new xommand line options (#1616)

This commit is contained in:
Kevin Ransom (msft) 2016-10-15 13:32:44 -07:00 коммит произвёл GitHub
Родитель 749ba2dfbb
Коммит e0318a8f65
4 изменённых файлов: 28 добавлений и 3 удалений

Просмотреть файл

@ -31,8 +31,9 @@
<DebugType Condition=" '$(DebugType)' == '' and '$(TargetFramework)' == 'coreclr' ">embedded</DebugType> <DebugType Condition=" '$(DebugType)' == '' and '$(TargetFramework)' == 'coreclr' ">embedded</DebugType>
<Optimize Condition=" '$(Optimize)' == '' ">false</Optimize> <Optimize Condition=" '$(Optimize)' == '' ">false</Optimize>
<ErrorReport Condition=" '$(ErrorReport)' == '' ">prompt</ErrorReport> <ErrorReport Condition=" '$(ErrorReport)' == '' ">prompt</ErrorReport>
<OtherFlags Condition=" '$(DebugType)' == '' and '$(TargetFramework)' != 'coreclr' ">$(OtherFlags) --no-jit-optimize</OtherFlags> <OtherFlags>$(OtherFlags) --no-jit-optimize</OtherFlags>
<OtherFlags Condition=" '$(DebugType)' == '' and '$(TargetFramework)' == 'coreclr' ">$(OtherFlags) --no-jit-optimize --embed</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;TRACE;CODE_ANALYSIS;$(DefineConstants)</DefineConstants>
<DefineConstants Condition=" '$(ProjectLanguage)' == 'VisualBasic' ">DEBUG=True,TRACE=True,CODE_ANALYSIS=True,$(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> <SIGN_WITH_MSFT_KEY Condition=" '$(SIGN_WITH_MSFT_KEY)' == '' ">false</SIGN_WITH_MSFT_KEY>
@ -41,6 +42,7 @@
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugType Condition=" '$(DebugType)' == '' ">pdbonly</DebugType> <DebugType Condition=" '$(DebugType)' == '' ">pdbonly</DebugType>
<Optimize Condition=" '$(Optimize)' == '' ">true</Optimize> <Optimize Condition=" '$(Optimize)' == '' ">true</Optimize>
<EmbedAllSource>false</EmbedAllSource>
<ErrorReport Condition=" '$(ErrorReport)' == '' ">prompt</ErrorReport> <ErrorReport Condition=" '$(ErrorReport)' == '' ">prompt</ErrorReport>
<DefineConstants Condition=" '$(ProjectLanguage)' != 'VisualBasic' ">TRACE;$(DefineConstants)</DefineConstants> <DefineConstants Condition=" '$(ProjectLanguage)' != 'VisualBasic' ">TRACE;$(DefineConstants)</DefineConstants>
<DefineConstants Condition=" '$(ProjectLanguage)' == 'VisualBasic' ">TRACE=True,$(DefineConstants)</DefineConstants> <DefineConstants Condition=" '$(ProjectLanguage)' == 'VisualBasic' ">TRACE=True,$(DefineConstants)</DefineConstants>

Просмотреть файл

@ -122,6 +122,8 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden
let mutable defineConstants : ITaskItem[] = [||] let mutable defineConstants : ITaskItem[] = [||]
let mutable disabledWarnings : string = null let mutable disabledWarnings : string = null
let mutable documentationFile : string = null let mutable documentationFile : string = null
let mutable embedAllSources = false
let mutable embed : string = null
let mutable generateInterfaceFile : string = null let mutable generateInterfaceFile : string = null
let mutable keyFile : string = null let mutable keyFile : string = null
let mutable noFramework = false let mutable noFramework = false
@ -136,6 +138,7 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden
let mutable referencePath : string = null let mutable referencePath : string = null
let mutable resources : ITaskItem[] = [||] let mutable resources : ITaskItem[] = [||]
let mutable sources : ITaskItem[] = [||] let mutable sources : ITaskItem[] = [||]
let mutable sourceLink : string = null
let mutable targetType : string = null let mutable targetType : string = null
#if FX_ATLEAST_35 #if FX_ATLEAST_35
#else #else
@ -183,6 +186,10 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden
| "EMBEDDED" -> "embedded" | "EMBEDDED" -> "embedded"
| "FULL" -> "full" | "FULL" -> "full"
| _ -> null) | _ -> null)
if embedAllSources then
builder.AppendSwitch("--embed+")
builder.AppendSwitchIfNotNull("--embed:", embed)
builder.AppendSwitchIfNotNull("--sourcelink:", sourceLink)
// NoFramework // NoFramework
if noFramework then if noFramework then
builder.AppendSwitch("--noframework") builder.AppendSwitch("--noframework")
@ -316,7 +323,7 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden
member fsc.DebugSymbols member fsc.DebugSymbols
with get() = debugSymbols with get() = debugSymbols
and set(b) = debugSymbols <- b 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 member fsc.DebugType
with get() = debugType with get() = debugType
and set(s) = debugType <- s and set(s) = debugType <- s
@ -332,6 +339,12 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden
member fsc.DocumentationFile member fsc.DocumentationFile
with get() = documentationFile with get() = documentationFile
and set(s) = documentationFile <- s 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>: // --generate-interface-file <string>:
// Print the inferred interface of the // Print the inferred interface of the
// assembly to a file. // assembly to a file.
@ -398,6 +411,10 @@ type [<Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:Iden
member fsc.Resources member fsc.Resources
with get() = resources with get() = resources
and set(a) = resources <- a and set(a) = resources <- a
// SourceLink
member fsc.SourceLink
with get() = sourceLink
and set(s) = sourceLink <- s
// source files // source files
member fsc.Sources member fsc.Sources
with get() = sources with get() = sources

Просмотреть файл

@ -23,6 +23,8 @@ type Fsc = class
member DefineConstants : Microsoft.Build.Framework.ITaskItem [] with get,set member DefineConstants : Microsoft.Build.Framework.ITaskItem [] with get,set
member DisabledWarnings : string with get,set member DisabledWarnings : string with get,set
member DocumentationFile : 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 GenerateInterfaceFile : string with get,set
member KeyFile : string with get,set member KeyFile : string with get,set
member NoFramework : bool with get,set member NoFramework : bool with get,set
@ -37,6 +39,7 @@ type Fsc = class
member References : Microsoft.Build.Framework.ITaskItem [] with get,set member References : Microsoft.Build.Framework.ITaskItem [] with get,set
member ReferencePath : string with get,set member ReferencePath : string with get,set
member Resources : Microsoft.Build.Framework.ITaskItem [] 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 Sources : Microsoft.Build.Framework.ITaskItem [] with get,set
member TargetType : string with get,set member TargetType : string with get,set
#if FX_ATLEAST_35 #if FX_ATLEAST_35

Просмотреть файл

@ -160,6 +160,8 @@ this file.
DefineConstants="$(DefineConstants)" DefineConstants="$(DefineConstants)"
DisabledWarnings="$(NoWarn)" DisabledWarnings="$(NoWarn)"
DocumentationFile="$(DocumentationFile)" DocumentationFile="$(DocumentationFile)"
EmbedAllSources="$(EmbedAllSources)"
Embed="$(Embed)"
GenerateInterfaceFile="$(GenerateInterfaceFile)" GenerateInterfaceFile="$(GenerateInterfaceFile)"
KeyFile="$(KeyOriginatorFile)" KeyFile="$(KeyOriginatorFile)"
LCID="$(LCID)" LCID="$(LCID)"
@ -173,6 +175,7 @@ this file.
References="@(ReferencePath)" References="@(ReferencePath)"
ReferencePath="$(ReferencePath)" ReferencePath="$(ReferencePath)"
Resources="@(_CoreCompileResourceInputs);@(CompiledLicenseFile);@(AdditionalEmbeddedResource)" Resources="@(_CoreCompileResourceInputs);@(CompiledLicenseFile);@(AdditionalEmbeddedResource)"
SourceLink="$(SourceLink)"
Sources="@(CompileBefore);@(Compile);@(CompileAfter)" Sources="@(CompileBefore);@(Compile);@(CompileAfter)"
Tailcalls="$(Tailcalls)" Tailcalls="$(Tailcalls)"
TargetType="$(OutputType)" TargetType="$(OutputType)"