Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
fsharp
提交
32ea7df8
F
fsharp
项目概览
dotNET Platform
/
fsharp
10 个月 前同步成功
通知
0
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
fsharp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
32ea7df8
编写于
1月 20, 2021
作者:
K
Kevin Ransom (msft)
提交者:
GitHub
1月 20, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix 10882 -- Add WarnOn support to build (#10885)
* fixes #10882 * Fix tests * fix warnon * Feedback + tests
上级
d77ffaec
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
61 addition
and
53 deletion
+61
-53
src/fsharp/FSharp.Build/Fsc.fs
src/fsharp/FSharp.Build/Fsc.fs
+30
-18
src/fsharp/FSharp.Build/Microsoft.FSharp.Targets
src/fsharp/FSharp.Build/Microsoft.FSharp.Targets
+1
-0
vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj
...mplates/ConsoleProject/Template/ConsoleApplication.fsproj
+1
-0
vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj
...n/ProjectTemplates/LibraryProject/Template/Library.fsproj
+1
-0
vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj
...ProjectTemplates/TutorialProject/Template/Tutorial.fsproj
+1
-0
vsintegration/tests/UnitTests/Tests.Build.fs
vsintegration/tests/UnitTests/Tests.Build.fs
+27
-35
未找到文件。
src/fsharp/FSharp.Build/Fsc.fs
浏览文件 @
32ea7df8
...
...
@@ -77,12 +77,23 @@ type public Fsc () as this =
let
mutable
warningsNotAsErrors
:
string
=
null
let
mutable
versionFile
:
string
=
null
let
mutable
warningLevel
:
string
=
null
let
mutable
warnOn
:
string
=
null
let
mutable
win32res
:
string
=
null
let
mutable
win32manifest
:
string
=
null
let
mutable
vserrors
:
bool
=
false
let
mutable
vslcid
:
string
=
null
let
mutable
utf8output
:
bool
=
false
/// Trim whitespace ... spaces, tabs, newlines,returns, Double quotes and single quotes
let
wsCharsToTrim
=
[|
'
'
;
'\t'
;
'\"'
;
'\''
|]
let
splitAndWsTrim
(
s
:
string
)
=
match
s
with
|
null
->
[||]
|
_
->
let
array
=
s
.
Split
([|
'
;
'
;
'
,
'
;
'\r'
;
'\n'
|],
StringSplitOptions
.
RemoveEmptyEntries
)
array
|>
Array
.
map
(
fun
item
->
item
.
Trim
(
wsCharsToTrim
))
|>
Array
.
filter
(
fun
s
->
not
(
String
.
IsNullOrEmpty
s
))
// See bug 6483; this makes parallel build faster, and is fine to set unconditionally
do
this
.
YieldDuringToolExecution
<-
true
...
...
@@ -173,13 +184,11 @@ type public Fsc () as this =
if
references
<>
null
then
for
item
in
references
do
builder
.
AppendSwitchIfNotNull
(
"-r:"
,
item
.
ItemSpec
)
// ReferencePath
let
referencePathArray
=
// create a array of strings
match
referencePath
with
|
null
->
null
|
_
->
referencePath
.
Split
([|
'
;
'
;
'
,
'
|],
StringSplitOptions
.
RemoveEmptyEntries
)
builder
.
AppendSwitchIfNotNull
(
"--lib:"
,
referencePathArray
,
","
)
match
referencePath
with
|
null
->
()
|
_
->
builder
.
AppendSwitchIfNotNull
(
"--lib:"
,
referencePath
|>
splitAndWsTrim
,
","
)
// TargetType
builder
.
AppendSwitchIfNotNull
(
"--target:"
,
if
targetType
=
null
then
null
else
...
...
@@ -193,29 +202,28 @@ type public Fsc () as this =
// NoWarn
match
disabledWarnings
with
|
null
->
()
|
_
->
builder
.
AppendSwitchIfNotNull
(
"--nowarn:"
,
disabledWarnings
.
Split
([|
'
'
;
'
;
'
;
'
,
'
;
'\r'
;
'\n'
|],
StringSplitOptions
.
RemoveEmptyEntries
)
,
","
)
|
_
->
builder
.
AppendSwitchIfNotNull
(
"--nowarn:"
,
disabledWarnings
|>
splitAndWsTrim
,
","
)
// WarningLevel
builder
.
AppendSwitchIfNotNull
(
"--warn:"
,
warningLevel
)
match
warnOn
with
|
null
->
()
|
_
->
builder
.
AppendSwitchIfNotNull
(
"--warnon:"
,
warnOn
|>
splitAndWsTrim
,
","
)
// TreatWarningsAsErrors
if
treatWarningsAsErrors
then
builder
.
AppendSwitch
(
"--warnaserror"
)
// WarningsAsErrors
// Change warning 76, HashReferenceNotAllowedInNonScript/HashDirectiveNotAllowedInNonScript/HashIncludeNotAllowedInNonScript, into an error
// REVIEW: why is this logic here? In any case these are errors already by default!
let
warningsAsErrorsArray
=
match
warningsAsErrors
with
|
null
->
[|
"76"
|]
|
_
->
(
warningsAsErrors
+
" 76 "
).
Split
([|
'
'
;
'
;
'
;
'
,
'
|],
StringSplitOptions
.
RemoveEmptyEntries
)
builder
.
AppendSwitchIfNotNull
(
"--warnaserror:"
,
warningsAsErrorsArray
,
","
)
// WarnAsErrors
match
warningsAsErrors
with
|
null
->
()
|
_
->
builder
.
AppendSwitchIfNotNull
(
"--warnaserror:"
,
warningsAsErrors
|>
splitAndWsTrim
,
","
)
// WarningsNotAsErrors
match
warningsNotAsErrors
with
|
null
->
()
|
_
->
builder
.
AppendSwitchIfNotNull
(
"--warnaserror-:"
,
warningsNotAsErrors
.
Split
([|
'
'
;
'
;
'
;
'
,
'
|],
StringSplitOptions
.
RemoveEmptyEntries
)
,
","
)
|
_
->
builder
.
AppendSwitchIfNotNull
(
"--warnaserror-:"
,
warningsNotAsErrors
|>
splitAndWsTrim
,
","
)
// Win32ResourceFile
builder
.
AppendSwitchIfNotNull
(
"--win32res:"
,
win32res
)
...
...
@@ -253,7 +261,7 @@ type public Fsc () as this =
match
pathMap
with
|
null
->
()
|
_
->
builder
.
AppendSwitchIfNotNull
(
"--pathmap:"
,
pathMap
.
Split
([|
'
;
'
;
'
,
'
|],
StringSplitOptions
.
RemoveEmptyEntries
)
,
","
)
|
_
->
builder
.
AppendSwitchIfNotNull
(
"--pathmap:"
,
pathMap
|>
splitAndWsTrim
,
","
)
if
deterministic
then
builder
.
AppendSwitch
(
"--deterministic+"
)
...
...
@@ -505,6 +513,10 @@ type public Fsc () as this =
with
get
()
=
warningsNotAsErrors
and
set
(
s
)
=
warningsNotAsErrors
<-
s
member
fsc
.
WarnOn
with
get
()
=
warnOn
and
set
(
s
)
=
warnOn
<-
s
member
fsc
.
VisualStudioStyleErrors
with
get
()
=
vserrors
and
set
(
p
)
=
vserrors
<-
p
...
...
src/fsharp/FSharp.Build/Microsoft.FSharp.Targets
浏览文件 @
32ea7df8
...
...
@@ -328,6 +328,7 @@ this file.
VisualStudioStyleErrors="$(VisualStudioStyleErrors)"
WarningLevel="$(WarningLevel)"
WarningsAsErrors="$(WarningsAsErrors)"
WarnOn="$(WarnOn)"
Win32ManifestFile="$(Win32Manifest)"
Win32ResourceFile="$(Win32Resource)">
<Output TaskParameter="CommandLineArgs" ItemName="FscCommandLineArgs" />
...
...
vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj
浏览文件 @
32ea7df8
...
...
@@ -3,6 +3,7 @@
<OutputType>Exe</OutputType>
$if$ ($targetframeworkversion$ == 4.5) <TargetFramework>net45</TargetFramework>$endif$$if$ ($targetframeworkversion$ == 4.6) <TargetFramework>net46</TargetFramework> $endif$$if$ ($targetframeworkversion$ == 4.6.1) <TargetFramework>net461</TargetFramework> $endif$$if$ ($targetframeworkversion$ == 4.6.2) <TargetFramework>net462</TargetFramework> $endif$$if$ ($targetframeworkversion$ == 4.7) <TargetFramework>net47</TargetFramework> $endif$$if$ ($targetframeworkversion$ == 4.7.1) <TargetFramework>net471</TargetFramework> $endif$$if$ ($targetframeworkversion$ == 4.7.2) <TargetFramework>net472</TargetFramework> $endif$$if$ ($targetframeworkversion$ == 4.8) <TargetFramework>net48</TargetFramework> $endif$
$if$ ($safeprojectname$ != $projectname$) <RootNamespace>$safeprojectname$</RootNamespace> $endif$
<WarnOn>3390;$(WarnOn)</WarnOn>
</PropertyGroup>
<ItemGroup>
...
...
vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj
浏览文件 @
32ea7df8
...
...
@@ -3,6 +3,7 @@
$if$ ($targetframeworkversion$ == 4.5) <TargetFramework>net45</TargetFramework>$endif$$if$ ($targetframeworkversion$ == 4.6) <TargetFramework>net46</TargetFramework> $endif$$if$ ($targetframeworkversion$ == 4.6.1) <TargetFramework>net461</TargetFramework> $endif$$if$ ($targetframeworkversion$ == 4.6.2) <TargetFramework>net462</TargetFramework> $endif$$if$ ($targetframeworkversion$ == 4.7) <TargetFramework>net47</TargetFramework> $endif$$if$ ($targetframeworkversion$ == 4.7.1) <TargetFramework>net471</TargetFramework> $endif$$if$ ($targetframeworkversion$ == 4.7.2) <TargetFramework>net472</TargetFramework> $endif$$if$ ($targetframeworkversion$ == 4.8) <TargetFramework>net48</TargetFramework> $endif$
$if$ ($safeprojectname$ != $projectname$) <RootNamespace>$safeprojectname$</RootNamespace> $endif$
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<WarnOn>3390;$(WarnOn)</WarnOn>
</PropertyGroup>
<ItemGroup>
...
...
vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj
浏览文件 @
32ea7df8
...
...
@@ -3,6 +3,7 @@
<OutputType>Exe</OutputType>
$if$ ($targetframeworkversion$ == 4.5) <TargetFramework>net45</TargetFramework>$endif$$if$ ($targetframeworkversion$ == 4.6) <TargetFramework>net46</TargetFramework> $endif$$if$ ($targetframeworkversion$ == 4.6.1) <TargetFramework>net461</TargetFramework> $endif$$if$ ($targetframeworkversion$ == 4.6.2) <TargetFramework>net462</TargetFramework> $endif$$if$ ($targetframeworkversion$ == 4.7) <TargetFramework>net47</TargetFramework> $endif$$if$ ($targetframeworkversion$ == 4.7.1) <TargetFramework>net471</TargetFramework> $endif$$if$ ($targetframeworkversion$ == 4.7.2) <TargetFramework>net472</TargetFramework> $endif$$if$ ($targetframeworkversion$ == 4.8) <TargetFramework>net48</TargetFramework> $endif$
$if$ ($safeprojectname$ != $projectname$) <RootNamespace>$safeprojectname$</RootNamespace> $endif$
<WarnOn>3390;$(WarnOn)</WarnOn>
</PropertyGroup>
<ItemGroup>
...
...
vsintegration/tests/UnitTests/Tests.Build.fs
浏览文件 @
32ea7df8
...
...
@@ -79,7 +79,6 @@ type Build() =
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--codepage:65001"
+
Environment
.
NewLine
+
"--optimize+"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva-"
+
Environment
.
NewLine
+
...
...
@@ -95,7 +94,6 @@ type Build() =
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"-g"
+
Environment
.
NewLine
+
"--optimize+"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva-"
+
Environment
.
NewLine
+
...
...
@@ -111,7 +109,6 @@ type Build() =
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--debug:pdbonly"
+
Environment
.
NewLine
+
"--optimize+"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva-"
+
Environment
.
NewLine
+
...
...
@@ -129,7 +126,6 @@ type Build() =
AssertEqual
(
"--define:FOO=3"
+
Environment
.
NewLine
+
"--define:BAR=4"
+
Environment
.
NewLine
+
"--optimize+"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva-"
+
Environment
.
NewLine
+
...
...
@@ -145,7 +141,6 @@ type Build() =
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--optimize+"
+
Environment
.
NewLine
+
"--nowarn:52,109"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva-"
+
Environment
.
NewLine
+
...
...
@@ -160,7 +155,6 @@ type Build() =
let
cmd
=
tool
.
InternalGenerateResponseFileCommands
()
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--optimize+"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva-"
+
Environment
.
NewLine
+
...
...
@@ -175,7 +169,6 @@ type Build() =
let
cmd
=
tool
.
InternalGenerateResponseFileCommands
()
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--optimize+"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--warnaserror-:52,109"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
...
...
@@ -192,7 +185,6 @@ type Build() =
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--optimize+"
+
Environment
.
NewLine
+
"--versionfile:src/version"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva-"
+
Environment
.
NewLine
+
...
...
@@ -208,7 +200,6 @@ type Build() =
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--doc:foo.xml"
+
Environment
.
NewLine
+
"--optimize+"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva-"
+
Environment
.
NewLine
+
...
...
@@ -224,7 +215,6 @@ type Build() =
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--sig:foo.fsi"
+
Environment
.
NewLine
+
"--optimize+"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva-"
+
Environment
.
NewLine
+
...
...
@@ -240,7 +230,6 @@ type Build() =
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--keyfile:key.txt"
+
Environment
.
NewLine
+
"--optimize+"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva-"
+
Environment
.
NewLine
+
...
...
@@ -256,7 +245,6 @@ type Build() =
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--noframework"
+
Environment
.
NewLine
+
"--optimize+"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva-"
+
Environment
.
NewLine
+
...
...
@@ -271,7 +259,6 @@ type Build() =
let
cmd
=
tool
.
InternalGenerateResponseFileCommands
()
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--optimize-"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva-"
+
Environment
.
NewLine
+
...
...
@@ -287,7 +274,6 @@ type Build() =
printfn
"cmd=
\"
%s
\"
"
cmd
// REVIEW we don't put the default, is that desired?
AssertEqual
(
"--optimize+"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva-"
+
Environment
.
NewLine
+
...
...
@@ -302,7 +288,6 @@ type Build() =
let
cmd
=
tool
.
InternalGenerateResponseFileCommands
()
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--optimize+"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva-"
+
Environment
.
NewLine
+
...
...
@@ -320,7 +305,6 @@ type Build() =
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"-o:oUt.dll"
+
Environment
.
NewLine
+
"--optimize+"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva-"
+
Environment
.
NewLine
+
...
...
@@ -336,7 +320,6 @@ type Build() =
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--optimize+"
+
Environment
.
NewLine
+
"--pdb:out.pdb"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva-"
+
Environment
.
NewLine
+
...
...
@@ -352,7 +335,6 @@ type Build() =
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--optimize+"
+
Environment
.
NewLine
+
"--platform:x64"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva-"
+
Environment
.
NewLine
+
...
...
@@ -368,7 +350,6 @@ type Build() =
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--optimize+"
+
Environment
.
NewLine
+
"--platform:x86"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva-"
+
Environment
.
NewLine
+
...
...
@@ -385,7 +366,6 @@ type Build() =
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--optimize+"
+
Environment
.
NewLine
+
"-r:"
+
dll
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva-"
+
Environment
.
NewLine
+
...
...
@@ -402,7 +382,6 @@ type Build() =
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--optimize+"
+
Environment
.
NewLine
+
"--lib:c:
\\
sd
\\
staging
\\
tools
\\
nunit
\\
,c:
\\
Foo"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva-"
+
Environment
.
NewLine
+
...
...
@@ -419,7 +398,6 @@ type Build() =
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--optimize+"
+
Environment
.
NewLine
+
"--lib:c:
\\
program files,c:
\\
sd
\\
staging
\\
tools
\\
nunit,c:
\\
Foo"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva-"
+
Environment
.
NewLine
+
...
...
@@ -435,7 +413,6 @@ type Build() =
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--optimize+"
+
Environment
.
NewLine
+
"--resource:Foo.resources"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva-"
+
Environment
.
NewLine
+
...
...
@@ -452,7 +429,6 @@ type Build() =
let
cmd
=
tool
.
InternalGenerateResponseFileCommands
()
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--optimize+"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva-"
+
Environment
.
NewLine
+
...
...
@@ -471,7 +447,6 @@ type Build() =
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--optimize+"
+
Environment
.
NewLine
+
"--target:library"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva-"
+
Environment
.
NewLine
+
...
...
@@ -487,7 +462,6 @@ type Build() =
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--optimize+"
+
Environment
.
NewLine
+
"--target:winexe"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva-"
+
Environment
.
NewLine
+
...
...
@@ -503,7 +477,6 @@ type Build() =
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--optimize+"
+
Environment
.
NewLine
+
"--target:module"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva-"
+
Environment
.
NewLine
+
...
...
@@ -517,7 +490,6 @@ type Build() =
let
cmd
=
tool
.
InternalGenerateResponseFileCommands
()
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--optimize+"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--utf8output"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
...
...
@@ -532,7 +504,6 @@ type Build() =
let
cmd
=
tool
.
InternalGenerateResponseFileCommands
()
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--optimize+"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--win32res:foo.res"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
...
...
@@ -547,7 +518,6 @@ type Build() =
let
cmd
=
tool
.
InternalGenerateResponseFileCommands
()
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--optimize+"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--win32manifest:foo.manifest"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
...
...
@@ -562,7 +532,6 @@ type Build() =
let
cmd
=
tool
.
InternalGenerateResponseFileCommands
()
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--optimize+"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva+"
+
Environment
.
NewLine
+
...
...
@@ -576,7 +545,6 @@ type Build() =
let
cmd
=
tool
.
InternalGenerateResponseFileCommands
()
printfn
"cmd=
\"
%s
\"
"
cmd
AssertEqual
(
"--optimize+"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--subsystemversion:6.02"
+
Environment
.
NewLine
+
...
...
@@ -592,7 +560,7 @@ type Build() =
tool
.
DebugType
<-
"full"
tool
.
DefineConstants
<-
[|
MakeTaskItem
"FOO=3"
MakeTaskItem
"BAR=4"
|]
tool
.
DisabledWarnings
<-
"52
109"
tool
.
DisabledWarnings
<-
"52
,
109"
tool
.
VersionFile
<-
"src/version"
tool
.
DocumentationFile
<-
"foo.xml"
tool
.
GenerateInterfaceFile
<-
"foo.fsi"
...
...
@@ -643,7 +611,6 @@ type Build() =
"--nowarn:52,109"
+
Environment
.
NewLine
+
"--warn:4"
+
Environment
.
NewLine
+
"--warnaserror"
+
Environment
.
NewLine
+
"--warnaserror:76"
+
Environment
.
NewLine
+
"--vserrors"
+
Environment
.
NewLine
+
"--utf8output"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
...
...
@@ -687,7 +654,6 @@ type Build() =
"--nowarn:52,109"
"--warn:4"
"--warnaserror"
"--warnaserror:76"
"--vserrors"
"--utf8output"
"--fullpaths"
...
...
@@ -701,3 +667,29 @@ type Build() =
AssertEqual
expectedFlags
hostObject
.
Flags
let
expectedSources
=
[|
"foo.fs"
;
"C:
\\
Program Files
\\
spaces.fs"
|]
AssertEqual
expectedSources
hostObject
.
Sources
[<
Test
>]
member
public
this
.
``DisabledWarnings build property``
()
=
let
tool
=
new
FSharp
.
Build
.
Fsc
()
tool
.
DisabledWarnings
<-
"
\n
52,,
\n
,,,109,110;
\r
73
,
;
85;
"
let
cmd
=
tool
.
InternalGenerateResponseFileCommands
()
printfn
"cmd=
\"
%s
\"
"
cmd
let
expected
=
"--optimize+"
+
Environment
.
NewLine
+
"--nowarn:52,109,110,73,85"
+
Environment
.
NewLine
+
"--fullpaths"
+
Environment
.
NewLine
+
"--flaterrors"
+
Environment
.
NewLine
+
"--highentropyva-"
+
Environment
.
NewLine
+
"--nocopyfsharpcore"
AssertEqual
expected
cmd
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录