我们有一个在每晚构建之前运行的进程.如果进程失败,则生成文本文件.我需要做的就是检查文件是否存在,如果存在,则导致MSBuild失败.
我目前尝试过以下方法:
<CreateProperty Condition="Exists('C:\Process\Fail.txt')"
Value="false">
<Output TaskParameter="Value" PropertyName="ProcessTestPassed"/>
</CreateProperty>
<Message Text="Process did not pass" Condition="Exists('C:\Process\Fail.txt')" ContinueOnError="false" />
<ReadLinesFromFile File="C:\Process\Fail.txt" Condition="'$(ProcessTestPassed)'=='false'" ContinueOnError="false" >
<Output TaskParameter="Lines" ItemName="FileContents" />
</ReadLinesFromFile>
<Message Text="FileContents: $(FileContents)" Condition="'$(ProcessTestPassed)'=='false'" ContinueOnError="false" />
Run Code Online (Sandbox Code Playgroud)
这给出了这个输出的传递构建:
Task "CreateProperty"
Done executing task "CreateProperty".
Task "Message"
QAWizardProTestPassed did not pass
Done executing task "Message".
Task "ReadLinesFromFile"
Done executing task "ReadLinesFromFile".
Task "Message"
FileContents:
Done executing task "Message".
Run Code Online (Sandbox Code Playgroud)
我知道以上可能是矫枉过正,但我只需要一些工作!我在这里想念的是什么?!
谢谢,德里克
我再次与MSBuild作战.我希望使用根路径定义属性值.作为构建的一部分,路径将使用版本信息进行更新.但是,MSBuild似乎有自己的范围规则似乎完全倒退.拿第一个例子:
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<MyPath>\\server\folder</MyPath>
</PropertyGroup>
<Target Name="Main">
<Message Text="In Main Before - MyPath = $(MyPath)"/>
<CallTarget Targets="Task1" />
<CallTarget Targets="Task2" />
<CallTarget Targets="Task3" />
<Message Text="In Main After - MyPath = $(MyPath)"/>
</Target>
<Target Name="Task1">
<PropertyGroup>
<MyPath>$(MyPath)\version5</MyPath>
</PropertyGroup>
<Message Text="In Task1 - MyPath = $(MyPath)"/>
</Target>
<Target Name="Task2">
<Message Text="In Task2 - MyPath = $(MyPath)"/>
</Target>
<Target Name="Task3">
<Message Text="In Task3 - MyPath = $(MyPath)"/>
</Target>
</Project>
Run Code Online (Sandbox Code Playgroud)
这是使用此命令行的输出: msbuild PropertyScopeTest1.proj /target:Main
Project "C:\Temp\PropertyScopeTest1.proj" on node …Run Code Online (Sandbox Code Playgroud) 我正在使用Google Guava v13.0但是当我使用包含tryFind的代码运行JUnit测试时,我收到以下消息:
java.lang.NoSuchMethodError: com.google.common.collect.Iterables.tryFind(Ljava/lang/Iterable;Lcom/google/common/base/Predicate;)Lcom/google/common/base/Optional;
Run Code Online (Sandbox Code Playgroud)
这似乎只发生在JUnit测试中,因为生产代码运行时没有问题.我正在使用Intellij IDEA v11.1.3并可以导航到guava JAR文件以在com.google.common.collect.Iterable.class中找到tryFind.
我见过类似的帖子,但我不确定这与JUnit有什么关系.关于我的问题可能是什么想法?
我们有最初使用_id的StringObjectIdGenerator类型存储的文档。较新的数据将使用默认的ObjectIdGenerator保存。我们希望能够通过将_id转换为新数据类型来迁移现有数据。这可能吗?
我运行了 Azure 存储模拟器,但目前看起来(从 v5.6.0.0 开始)它只支持 Blob、队列和表存储:
BlobEndpoint: http://127.0.0.1:10000/
QueueEndpoint: http://127.0.0.1:10001/
TableEndpoint: http://127.0.0.1:10002/
令人困惑的部分是,当您通过桌面 Azure 存储资源管理器通过选择配置本地连接时Attached to a local emulator,有一个文件端口选项。
我在这里错过了什么吗?
在最近的许多 Insider 版本之一中,删除了“打开最近的”ctrl+r 键盘快捷键。我会手动添加它,但找不到实际的 VSCode 工作台或任何命令。有谁知道快捷方式发生了什么,或者至少命令是什么,以便我可以重新映射它?