我有ant构建脚本,它编译和生成我的项目的编译日志(文件compileLog.xml)。我使用jdtCompileLogPublisher发布这些结果-- RTC。
现在的情况是,当我有消息来源的项目,它的工作良好。当我在项目中没有任何源代码时(这是一个要求将有一个空项目而没有外部源代码的要求之一),就跳过编译步骤,因为没有源,而且jdtCompileLogPublisher失败了,因为该步骤的输入文件compileLog.xml没有创建,因为编译本身已经被跳过了。
如果新的compileLog.xml不可用,我试着创建它。因此,我遇到了新的问题,因为文件是空的。
蚂蚁版本: 1.7.1。
与以下相关的代码片段:
<target name="compile" depends="prepare" description="Compile the source code">
<mkdir dir="${nameBuild}/${dir.build}/bin" />
<!-- Add target ${label.jdkversion} to make it possible to build with a certain jdk version-->
<javac compiler="org.eclipse.jdt.core.JDTCompilerAdapter" destdir="${nameBuild}/${dir.build}/bin" debug="true" deprecation="on" encoding="ISO-8859-1" source="${buildInfo.jdkVersion}" target="${buildInfo.jdkVersion}" debuglevel="lines,source" failonerror="false" errorProperty="buildFailed">
<compilerarg line="-warn:+raw" />
<compilerarg line="-warn:-serial" />
<compilerarg line="-enableJavadoc" />
<compilerarg line="-log source/${name}/compileLog.xml" />
<src path="${name}/${dir.src}" />
<classpath refid="application.classpath" />
</javac>
<jdtCompileLogPublisher buildResultUUID="${buildInfo.buildResultUUID}" repositoryAddress="${repositoryAddress}" userId="${userId}" passwordFile="${psFile}" filePath="compileLog.xml" />
<fail if="buildFailed" message="Compile ${name} failed." />
</target>发布于 2014-09-01 14:36:27
我修改了标签
<jdtCompileLogPublisher buildResultUUID="${buildInfo.buildResultUUID}" repositoryAddress="${repositoryAddress}" userId="${userId}" passwordFile="${psFile}" filePath="compileLog.xml" />
至
<jdtCompileLogPublisher buildResultUUID="${buildInfo.buildResultUUID}" repositoryAddress="${repositoryAddress}" userId="${userId}" passwordFile="${psFile}" filePath="compileLog.xml" failonerror="false" />
解决了我的问题
https://stackoverflow.com/questions/23261901
复制相似问题