Reputation: 14485
The title says it all really.
I want to ignore compiler warnings & stop them being logged for a certain build target.
I am building with a statement similar to this and want to be able to pass a parameter or change the statement to suppress compiler warnings:
Target "BuildConfigX" (fun _ ->
!! "**/*.csproj"
|> MSBuildDebug buildDir "Build"
|> Log "AppBuild-Output")
I had a bit of a google and a bit of a hunt through the docs but couldn't find anything
Upvotes: 0
Views: 299
Reputation: 2548
The WarningLevel
build property should potentially do the trick. Something like below:
let buildProject outputDir buildTargets projectName =
let propertiesCommon =
[ "DevEnvDir", "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools"
"OutputPath", outputDir
"Optimize", "True"
"DebugSymbols", "True"
"Configuration", buildMode ]
let properties =
match buildMode with
| "Release" -> propertiesCommon @ ["WarningLevel", "0"] //<--
| _ -> propertiesCommon
let setParams defaults =
{ defaults with
Verbosity = Some(Minimal)
Targets = buildTargets
Properties = properties
}
build setParams projectName |> DoNothing
Target "BuildConfigX" (fun _ ->
!! "**/*.csproj"
|> Seq.iter (buildProject buildOutDir ["ReBuild"])
)
Upvotes: 1