Changeset 3396626a


Ignore:
Timestamp:
Dec 23, 2012 5:30:56 PM (8 years ago)
Author:
kytv <kytv@…>
Branches:
master
Children:
1d0f8b4
Parents:
8c13d32
Message:
  • new ant targets
    • trimMtnRev: create a new property with the revision trimmed to 8 characters.
    • getExtendedVersion: create a new property that includes the full version with the shortened MTN revision tacked on
    • debchange: automatically update debian/changelog with the I2P version. Called by the "debian" target unless the property noAutoDebchange is set.
    • debian-tarball: export i2p.i2p branch to a new directory, remove the binaries like jbigi and launch4j, and create a tarball.
  • move packages created by "ant debian" to ${basedir}
  • add debian/changelog to .mtn-ignore since it is now automatically updated (by default).
  • add *.deb to .mtn-ignore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • .mtn-ignore

    r8c13d32 r3396626a  
    1717\.tar$
    1818\.war$
     19.\deb$
    1920\.zip$
    2021^\.
     
    2526/classes/
    2627^debian/copyright
     28^debian/changelog
    2729override.properties
    2830sloccount.sc
  • build.properties

    r8c13d32 r3396626a  
    2222# filename of the sloccount report
    2323sloccount.report.file=sloccount.sc
     24
     25# Uncomment the next line to prevent "ant debian" from automatically
     26# updating the changelog
     27#noAutoDebchange=true
    2428
    2529# Building EXEs in x64 Linux requires that 32bit libraries are installed. In Debian,
  • build.xml

    r8c13d32 r3396626a  
    183183            <arg value="get_base_revision_id" />
    184184        </exec>
     185    </target>
     186
     187    <target name="trimMtnRev" depends="getMtnRev">
     188        <script language="javascript">
     189            <![CDATA[
     190            var MtnRev = project.getProperty("workspace.version");
     191            if (MtnRev != 'unknown' && MtnRev != null) {
     192                echo = project.createTask("echo");
     193                var MtnShortHash = MtnRev.substring(0,8);
     194                project.setProperty("MtnShortHash", MtnShortHash);
     195                echo.setMessage("Trimmed hash: " + MtnShortHash);
     196                echo.perform();
     197            } else {
     198                project.setProperty("MtnShortHash", 'unknown');
     199            }
     200            ]]>
     201        </script>
    185202    </target>
    186203
     
    586603        <delete file="syndie-standalone.zip" failonerror="false" quiet="true" />
    587604        <delete failonerror="false" quiet="true">
    588             <fileset dir="." includes="i2pinstall*jar i2p.fba ${sloccount.report.file} javadoc.zip i2pinstall*.exe i2pinstall*bz2" />
     605            <fileset dir="." includes="i2pinstall*jar i2p*deb libjbigi*deb i2p.fba ${sloccount.report.file} javadoc.zip i2pinstall*.exe i2pinstall*bz2" />
    589606        </delete>
    590607        <delete file="i2psnark-standalone.zip" failonerror="false" quiet="true" />
     
    15901607    </target>
    15911608
    1592     <target name="debian" depends="debian-clean, debian-binary" />
    1593 
    1594     <target name="debian-binary" >
    1595         <echo message="Did you update the version using dch -i?" />
    1596         <echo message=" " />
    1597         <echo message="If the changelog was not updated with dch -i, press" />
    1598         <echo message="press CTRL+C to abort building this Debian package." />
    1599         <echo message="" />
    1600         <echo message="Pausing build for ten seconds to give enough time to read this notice." />
    1601         <exec executable="sleep" failonerror="true">
    1602                 <arg value="10" />
    1603         </exec>
    1604         <echo message="====================" />
    1605 
     1609    <target name="debian" depends="debian-clean, debchange, debian-binary" />
     1610
     1611    <target name="getExtendedVersion" depends="buildProperties, trimMtnRev">
     1612        <property name="MtnShortHash" value="unknown" />
     1613        <condition property="Extended.Version" value="${full.version}-${MtnShortHash}">
     1614            <not>
     1615                <or>
     1616                    <equals arg1="${MtnShortHash}" arg2="" />
     1617                    <equals arg1="${MtnShortHash}" arg2="unknown" />
     1618                </or>
     1619            </not>
     1620        </condition>
     1621        <!-- if not set above we'll set it here -->
     1622        <property name="Extended.Version" value="${full.version}" />
     1623    </target>
     1624
     1625    <target name="debchange" depends="getExtendedVersion" unless="noAutoDebchange">
     1626        <echo message= "Debian version is ${Extended.Version}-1" />
     1627        <exec executable="dch" failonerror="true">
     1628            <arg value="-b" />
     1629            <arg value="--check-dirname-level" />
     1630            <arg value="0" />
     1631            <arg value="-v" />
     1632            <arg value="${Extended.Version}-1" />
     1633            <arg value="Unofficial Debian package built using &quot;ant debian&quot;" />
     1634        </exec>
     1635    </target>
     1636
     1637    <target name="debian-binary" depends="getExtendedVersion">
    16061638        <exec executable="fakeroot" failonerror="true">
    16071639            <arg value="debian/rules" />
     
    16111643        </exec>
    16121644        <delete dir=".pc" />
    1613     </target>
    1614 
    1615     <target name="debian-clean" depends="buildProperties" >
     1645        <move todir=".">
     1646            <fileset dir=".." includes="libjbigi*${Extended.Version}-1*.deb i2p*${Extended.Version}-1*.deb" />
     1647        </move>
     1648        <echo message="" />
     1649        <echo message="====================" />
     1650        <echo message="Packages have been built and moved to ${basedir}" />
     1651        <echo message="====================" />
     1652    </target>
     1653
     1654    <target name="debian-clean" depends="getExtendedVersion" >
    16161655        <exec executable="fakeroot" failonerror="true">
    16171656            <arg value="debian/rules" />
     
    16211660    </target>
    16221661
    1623     <target name="debian-patch" depends="buildProperties" >
     1662    <target name="debian-tarball" depends="getExtendedVersion">
     1663        <!-- will this use the monotonerc file in the current workspace? -->
     1664        <fail message="This target cannot be used without Monotone! Use &quot;fakeroot debian/rules get-orig-source&quot; instead.">
     1665            <condition>
     1666                <not>
     1667                    <isset property="mtn.available" />
     1668                </not>
     1669            </condition>
     1670        </fail>
     1671        <property name="debian.tarball.name" value="i2p_${Extended.Version}.orig.tar.bz2" />
     1672        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
     1673        <delete dir="../i2p-${Extended.Version}" />
     1674        <exec executable="mtn" failonerror="true">
     1675            <arg value="co" />
     1676            <arg value="-b" />
     1677            <arg value="i2p.i2p" />
     1678            <!-- w: is the revision of the current workspace -->
     1679            <arg value="-r" />
     1680            <arg value="w:" />
     1681            <arg value="../i2p-${Extended.Version}" />
     1682        </exec>
     1683        <delete includeemptydirs="true" quiet="false">
     1684            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
     1685            <fileset dir="../i2p-${Extended.Version}/Slackware" />
     1686            <fileset dir="../i2p-${Extended.Version}/_MTN" />
     1687        </delete>
     1688        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
     1689            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}">
     1690                <include name="**/**" />
     1691                <exclude name="debian/**"/>
     1692            </tarfileset>
     1693        </tar>
     1694    </target>
     1695
     1696    <target name="debian-patch" depends="getExtendedVersion" >
    16241697        <exec executable="quilt" failonerror="true">
    16251698            <arg value="-a" />
Note: See TracChangeset for help on using the changeset viewer.