假:如何定义 MSBuild 属性? [英] FAKE: How to define MSBuild properties?

查看:21
本文介绍了假:如何定义 MSBuild 属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从 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: "
)

如何指定所需的属性?

推荐答案

如果你看源代码,您会看到 MSBuildRelease 只是具有某些预定义属性的 MSBuild 的快捷方式.如果你需要定义其他属性,除了配置",你可以回退到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: "
)

这篇关于假:如何定义 MSBuild 属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆