Refuse to package the GATK from a non-clean working directory

Packaging from a non-clean working directory can result in an incorrect
jar. Now that we have external collaborators packaging and distributing
the GATK, not enforcing the clean requirement has become far too dangerous.
At the same time, invoking "clean" automatically through a direct
dependency would also be dangerous -- instead, it's better to error out
if a packaging target is invoked from a non-clean working dir.
This commit is contained in:
David Roazen 2012-11-02 19:01:59 -04:00
parent 47a0f5859e
commit eae2d019cf
1 changed files with 19 additions and 1 deletions

View File

@ -891,7 +891,7 @@
<!-- Build a package consisting of all supporting files. Don't call this target directly. Call one of the specific packaging targets below -->
<target name="package" depends="dist,stage,require.executable" description="bundle up an executable for distribution">
<target name="package" depends="require.clean,dist,stage,require.executable" description="bundle up an executable for distribution">
<mkdir dir="${package.output.dir}" />
<xslt destdir="${package.output.dir}" style="${package.xml.dir}/CreatePackager.xsl" useImplicitFileset="false">
<flattenmapper/>
@ -1011,6 +1011,24 @@
<delete dir="${pipelinetest.dir}"/>
</target>
<!-- Depend on this target if your target requires a clean working directory but you don't want to depend on clean directly -->
<target name="require.clean">
<condition property="not.clean">
<or>
<available file="${build.dir}" />
<available file="${lib.dir}" />
<available file="${contract.dump.dir}" />
<available file="${staging.dir}" />
<available file="${dist.dir}" />
<available file="${pipelinetest.dir}" />
<available file="${javadoc.dir}" />
<available file="${scaladoc.dir}" />
<available file="${gatkdocs.dir}" />
</or>
</condition>
<fail message="Selected build target requires a clean working directory. Run ant clean and then try again." if="not.clean" />
</target>
<!-- ******************************************************************************** -->
<!-- gsalib -->