【发布时间】:2021-05-24 10:32:22
【问题描述】:
你能在你的蛋糕脚本中获得由 MSBuild 设置的属性吗?
我目前有一个在编译后运行的目标,以指示它是否已运行,或者是否是增量构建。
我想在剩余的蛋糕构建中检测是否发生了增量构建。
我目前在我的 MSBuild 上使用的目标如下:
<!-- Defines Targets that should be run after Compile, but skipped if Compile doesn't take place -->
<PropertyGroup>
<TargetsTriggeredByCompilation>
$(TargetsTriggeredByCompilation);
EnablePostBuild
</TargetsTriggeredByCompilation>
</PropertyGroup>
<Target Name="EnablePostBuild">
<!-- Disable post build actions -->
<PropertyGroup>
<SkipPostBuildActions>false</SkipPostBuildActions>
</PropertyGroup>
</Target>
如果我按如下方式在 Cake 中触发构建:
var buildSettings = new MSBuildSettings()
.WithProperty("SkipPostBuildActions", "true")
MSBuild("./src/Application.sln",buildSettings );
var SkipPostBuildActionsVal = buildSettings??
我可以在 MSBuild 步骤之后获取 SkipPostBuildActions 的值吗?
【问题讨论】: