Changeset 58512b8 for build.xml


Ignore:
Timestamp:
Jun 26, 2014 8:01:07 PM (6 years ago)
Author:
kytv <kytv@…>
Branches:
master
Children:
616866c
Parents:
ca4555c4
Message:

build.xml: add new macros for use in the release target

Also move away from using external binaries when an ant task can do the job.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • build.xml

    rca4555c4 r58512b8  
    6868            <echo message="to patch the source and build the packages." />
    6969    </target>
     70
     71    <macrodef name="gpgsign">
     72        <attribute name="file" />
     73        <sequential>
     74            <delete file="@{file}.sig" quiet="true" />
     75            <exec executable="gpg" failonerror="true">
     76                <arg value="--default-key" />
     77                <arg value="${release.gpg.keyid}" />
     78                <arg value="-b" />
     79                <arg value="@{file}" />
     80            </exec>
     81            <chmod type="file" perm="444">
     82                <fileset dir="${basedir}">
     83                    <include name="@{file} @{file}.sig" />
     84                </fileset>
     85            </chmod>
     86        </sequential>
     87    </macrodef>
     88
     89    <macrodef name="mktorrent">
     90        <attribute name="file" />
     91        <sequential>
     92            <delete file="@{file}.torrent" quiet="true"/>
     93            <java classname="org.klomp.snark.Storage" fork="true" failonerror="true">
     94                <classpath>
     95                    <pathelement location="build/i2p.jar" />
     96                    <pathelement location="build/i2psnark.jar" />
     97                </classpath>
     98                <arg value="@{file}" />
     99                <arg value="http://tracker2.postman.i2p/announce.php" />
     100            </java>
     101        </sequential>
     102    </macrodef>
     103
     104    <macrodef name="sha256sum">
     105        <attribute name="file" />
     106        <sequential>
     107            <!--
     108                 Note: "local" only works with ant 1.8+. This limitation shouldn't be
     109                 a big deal since this macro is only called by the release
     110                 target.
     111             -->
     112            <local name="file-sum"/>
     113            <checksum format="MD5SUM" file="@{file}" property="file-sum" algorithm="sha-256"/>
     114            <echo message="${file-sum}  @{file}" />
     115        </sequential>
     116    </macrodef>
     117
    70118    <target name="dist" depends="pkg, javadoc" />
    71119    <target name="dist200" depends="pkg200, javadoc" />
     
    545593                <pathelement location="installer/lib/wrapper/all/wrapper.jar" />
    546594            </classpath>
    547             <!-- These variables are stored in build.properties.
    548                 End-users can override by creating the file override.properties -->
     595            <!-- These variables are stored in build.properties.
     596                  End-users can override by creating the file override.properties -->
    549597            <link offline="true" href="${javasedocs.url}" packagelistLoc="installer/resources/package-lists/java/" />
    550598            <link offline="true" href="${javaeedocs.url}" packagelistLoc="installer/resources/package-lists/javaee/" />
     
    554602        </javadoc>
    555603        <echo message="Warning, javadoc embeds timestamps in the output, run with 'TZ=UTC ant javadoc' if you plan to distribute" />
    556         <zip destfile="javadoc.zip" basedir="build" level="9" includes="javadoc\**" />
     604    </target>
     605    <target name="javadoc-zip" depends="javadoc">
     606        <zip destfile="javadoc.zip" basedir="build" level="9" includes="javadoc\**" />
    557607    </target>
    558608
     
    582632                <pathelement location="${junit.home}/junit4.jar" />
    583633            </classpath>
    584             <!-- These variables are stored in build.properties.
    585          End-users can override by creating the file override.properties -->
     634            <!--
     635                 These variables are stored in build.properties.
     636                 End-users can override by creating the file override.properties
     637            -->
    586638            <link offline="true" href="${javasedocs.url}" packagelistLoc="installer/resources/package-lists/java/" />
    587639            <link offline="true" href="${junitdocs.url}" packagelistLoc="installer/resources/package-lists/junit/" />
     
    698750    <target name="distclean" depends="clean">
    699751        <delete failonerror="false" quiet="true">
    700             <fileset dir="." includes="i2pinstall* *.deb i2p_*.bz2 i2pupdate* i2psource*" />
     752            <fileset dir="." includes="i2pinstall* *.deb i2p_*.bz2 i2pupdate* i2psource* *.sig *.torrent" />
    701753        </delete>
    702754        <ant dir="core/java/" target="distclean" />
     
    13231375        <ant target="installerexe" />
    13241376        <delete file="${basedir}/install.jar" />
    1325         <move file="${basedir}/i2pinstall.exe" tofile="${basedir}/i2pinstall_${full.version}_windows-only.exe" />
     1377        <move file="${basedir}/i2pinstall.exe" tofile="${basedir}/i2pinstall_${full.version}_windows.exe" />
    13261378    </target>
    13271379
     
    15031555    <target name="release" depends="distclean, updaterWithJettyFixesAndJbigi , updater200WithJettyFixes, preppkg, installer, getReleaseNumber" >
    15041556-->
    1505     <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyRepack, updater200WithJetty, delete-j6-update, installer-nowindows, delete-nonwindows, installer-windows" >
     1557    <target name="release" depends="verifyReleaseBuildNumbers, -pre-release, distclean, testscripts, updaterWithJettyRepack, updater200WithJetty, delete-j6-update, installer-nowindows, delete-nonwindows, installer-windows">
    15061558        <echo message="New version number is ${release.number}" />
    15071559        <copy file="i2pupdate.zip" tofile="i2pupdate_${release.number}.zip" />
    1508         <copy file="i2pinstall_${full.version}_windows-only.exe" tofile="i2pinstall_${release.number}_windows.exe" />
    15091560        <copy file="i2pinstall_${full.version}.jar" tofile="i2pinstall_${release.number}.jar" />
     1561        <copy file="i2pinstall_${full.version}_windows.exe" tofile="i2pinstall_${release.number}_windows.exe" />
    15101562        <delete file="i2pupdate.sud" />
    15111563        <delete file="i2pupdate.su2" />
     
    16731725            </condition>
    16741726        </fail>
    1675         <delete file="i2pinstall_${release.number}_windows.exe.sig" />
    1676         <delete file="i2pinstall_${release.number}.jar.sig" />
    1677         <delete file="i2psource_${release.number}.tar.bz2.sig" />
    1678         <delete file="i2pupdate_${release.number}.zip.sig" />
    1679         <exec executable="gpg" failonerror="true">
    1680             <arg value="--default-key" />
    1681             <arg value="${release.gpg.keyid}" />
    1682             <arg value="-b" />
    1683             <arg value="i2pinstall_${release.number}_windows.exe" />
    1684         </exec>
    1685         <exec executable="gpg" failonerror="true">
    1686             <arg value="--default-key" />
    1687             <arg value="${release.gpg.keyid}" />
    1688             <arg value="-b" />
    1689             <arg value="i2pinstall_${release.number}.jar" />
    1690         </exec>
    1691         <exec executable="gpg" failonerror="true">
    1692             <arg value="--default-key" />
    1693             <arg value="${release.gpg.keyid}" />
    1694             <arg value="-b" />
    1695             <arg value="i2psource_${release.number}.tar.bz2" />
    1696         </exec>
    1697         <exec executable="gpg" failonerror="true">
    1698             <arg value="--default-key" />
    1699             <arg value="${release.gpg.keyid}" />
    1700             <arg value="-b" />
    1701             <arg value="i2pupdate_${release.number}.zip" />
    1702         </exec>
    1703         <exec executable="chmod" failonerror="true">
    1704             <arg value="444" />
    1705             <arg value="i2pinstall_${release.number}_windows.exe" />
    1706             <arg value="i2pinstall_${release.number}.jar" />
    1707             <arg value="i2psource_${release.number}.tar.bz2" />
    1708             <arg value="i2pupdate_${release.number}.zip" />
    1709             <arg value="i2pupdate.su2" />
    1710             <arg value="i2pupdate.su3" />
    1711             <arg value="i2pupdate.sud" />
    1712             <arg value="i2pinstall_${release.number}_windows.exe.sig" />
    1713             <arg value="i2pinstall_${release.number}.jar.sig" />
    1714             <arg value="i2psource_${release.number}.tar.bz2.sig" />
    1715             <arg value="i2pupdate_${release.number}.zip.sig" />
    1716         </exec>
     1727
     1728        <!-- the gpgsign macro sets the permission of signed files and the sigs themselves to 444 -->
     1729        <gpgsign file="i2pinstall_${release.number}_windows.exe" />
     1730        <gpgsign file="i2pinstall_${release.number}.jar" />
     1731        <gpgsign file="i2psource_${release.number}.tar.bz2" />
     1732        <gpgsign file="i2pupdate_${release.number}.zip" />
     1733
     1734        <chmod perm="444" type="file">
     1735            <fileset dir="${basedir}">
     1736                <include name="i2pupdate.su2" />
     1737                <include name="i2pupdate.su3" />
     1738                <include name="i2pupdate.sud" />
     1739            </fileset>
     1740        </chmod>
    17171741        <echo message="File sizes:" />
    17181742        <exec executable="ls" failonerror="true">
     
    17311755        </exec>
    17321756        <echo message="SHA256 sums:" />
    1733         <exec executable="sha256sum" failonerror="true">
    1734             <arg value="i2pinstall_${release.number}_windows.exe" />
    1735             <arg value="i2pinstall_${release.number}.jar" />
    1736             <arg value="i2psource_${release.number}.tar.bz2" />
    1737             <arg value="i2pupdate_${release.number}.zip" />
    1738             <arg value="i2pupdate.su2" />
    1739             <arg value="i2pupdate.su3" />
    1740             <arg value="i2pupdate.sud" />
    1741         </exec>
     1757        <sha256sum file="i2pinstall_${release.number}_windows.exe" />
     1758        <sha256sum file="i2pinstall_${release.number}.jar" />
     1759        <sha256sum file="i2psource_${release.number}.tar.bz2" />
     1760        <sha256sum file="i2pupdate_${release.number}.zip" />
     1761        <sha256sum file="i2pupdate.su2" />
     1762        <sha256sum file="i2pupdate.su3" />
     1763        <sha256sum file="i2pupdate.sud" />
    17421764        <!-- make torrent files -->
    17431765        <copy file="i2pupdate.sud" tofile="i2pupdate-${release.number}.sud" />
    1744         <java classname="org.klomp.snark.Storage" fork="true" failonerror="true">
    1745             <classpath>
    1746                 <pathelement location="build/i2p.jar" />
    1747                 <pathelement location="build/i2psnark.jar" />
    1748             </classpath>
    1749             <arg value="i2pupdate-${release.number}.sud" />
    1750             <arg value="http://tracker2.postman.i2p/announce.php" />
    1751         </java>
     1766        <mktorrent file="i2pupdate-${release.number}.sud" />
    17521767        <copy file="i2pupdate.su2" tofile="i2pupdate-${release.number}.su2" />
    1753         <java classname="org.klomp.snark.Storage" fork="true" failonerror="true">
    1754             <classpath>
    1755                 <pathelement location="build/i2p.jar" />
    1756                 <pathelement location="build/i2psnark.jar" />
    1757             </classpath>
    1758             <arg value="i2pupdate-${release.number}.su2" />
    1759             <arg value="http://tracker2.postman.i2p/announce.php" />
    1760         </java>
     1768        <mktorrent file="i2pupdate-${release.number}.su2" />
    17611769        <copy file="i2pupdate.su3" tofile="i2pupdate-${release.number}.su3" />
    1762         <java classname="org.klomp.snark.Storage" fork="true" failonerror="true">
    1763             <classpath>
    1764                 <pathelement location="build/i2p.jar" />
    1765                 <pathelement location="build/i2psnark.jar" />
    1766             </classpath>
    1767             <arg value="i2pupdate-${release.number}.su3" />
    1768             <arg value="http://tracker2.postman.i2p/announce.php" />
    1769         </java>
     1770        <mktorrent file="i2pupdate-${release.number}.su3" />
    17701771        <echo message="Don't forget to mtn tag w: i2p-${release.number}" />
    17711772        <echo message="... and mtn cert t:i2p-${release.number} branch i2p.i2p.release" />
Note: See TracChangeset for help on using the changeset viewer.