FAKE:如何定义MSBuild属性? [英] FAKE: How to define MSBuild properties?
问题描述
我想从MSBuild切换到FAKE.在我的MSBuild脚本中,我通过使用属性DeployOnBuild = True和DeployTarget = Package调用MSBuild来创建Webdeploy程序包.在构建运行时,这将触发webdeploy生成部署软件包:
I want to switch from MSBuild to FAKE. In my MSBuild script I create a Webdeploy package by invoking MSBuild with the properties DeployOnBuild=True and DeployTarget=Package. This will trigger webdeploy to generate a deployment package while the build is running:
<MSBuild Projects="@(ItemToBuild)"
Targets="Build"
Properties="Configuration=$(Configuration);
Platform=$(Platform);
DeployOnBuild=True;
DeployTarget=Package;
OutFolder=$(OutFolder)" />
如何用FAKE做同样的事情?我走了这么远:
How can I do the same thing with FAKE? I've come this far:
Target "Build" (fun _ ->
!! solutionFile
|> MSBuildRelease binDir "Build"
|> Log "Build-Output: "
)
如何指定必需的属性?
推荐答案
如果您查看MSBuild:
If you look at the source code, you'll see that MSBuildRelease
is just a shortcut for MSBuild
proper with certain predefined properties. If you need to define other properties, besides "Configuration", you can just fall back to MSBuild
:
Target "Build" (fun _ ->
!! solutionFile
|> MSBuild binDir "Build"
[
"Configuration", "Release"
"Platform", "AnyCPU"
"DeployOnBuild", "True"
"DeployTarget", "Package"
"OutFolder", "/what/ever"
]
|> Log "Build-Output: "
)
这篇关于FAKE:如何定义MSBuild属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!