LUCENE-2267: Add support for gpg signing to build.xml

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@912115 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2010-02-20 14:04:01 +00:00
parent 8012813045
commit 0f42e34dcd
2 changed files with 45 additions and 0 deletions

View File

@ -549,6 +549,48 @@
</sequential>
</target>
<!-- ================================================================== -->
<!-- support for signing the artifacts using gpg -->
<!-- ================================================================== -->
<target name="clean-dist-signatures">
<delete failonerror="false">
<fileset dir="${dist.dir}">
<include name="**/*.asc"/>
</fileset>
</delete>
</target>
<target name="sign-artifacts" depends="clean-dist-signatures">
<available property="gpg.input.handler" classname="org.apache.tools.ant.input.SecureInputHandler"
value="org.apache.tools.ant.input.SecureInputHandler"/>
<!--else:--><property name="gpg.input.handler" value="org.apache.tools.ant.input.DefaultInputHandler"/>
<input message="Enter GPG keystore password: >" addproperty="gpg.passphrase">
<handler classname="${gpg.input.handler}" />
</input>
<apply executable="${gpg.exe}" inputstring="${gpg.passphrase}"
dest="${dist.dir}" type="file" maxparallel="1" verbose="yes">
<arg value="--passphrase-fd"/>
<arg value="0"/>
<arg value="--batch"/>
<arg value="--armor"/>
<arg value="--default-key"/>
<arg value="${gpg.key}"/>
<arg value="--output"/>
<targetfile/>
<arg value="--detach-sig"/>
<srcfile/>
<fileset dir="${dist.dir}">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
<include name="**/*.tar.gz"/>
<include name="**/*.pom"/>
</fileset>
<globmapper from="*" to="*.asc"/>
</apply>
</target>
<!-- ================================================================== -->
<!-- Build the JavaCC files into the source tree -->
<!-- ================================================================== -->

View File

@ -113,6 +113,9 @@
<property name="svnversion.exe" value="svnversion" />
<property name="svn.exe" value="svn" />
<property name="gpg.exe" value="gpg" />
<property name="gpg.key" value="CODE SIGNING KEY" />
<condition property="build-1-5-contrib">
<equals arg1="1.5" arg2="${ant.java.version}" />
</condition>