Changeset fd91927c for build.xml


Ignore:
Timestamp:
Feb 17, 2011 12:47:35 PM (10 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
d59e3f9
Parents:
a3d466e
Message:
  • Build:
    • Add includeAntRuntime=false to all javac targets
    • Add build date, mtn rev, and changed file list to all manifests
    • Add unless=uptodate to all jar and war targets (bob and dtg still todo)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • build.xml

    ra3d466e rfd91927c  
    9898
    9999    <target name="buildDesktopGui" depends="buildCore, buildrouter" >
     100<!--
    100101        <ant dir="apps/desktopgui" target="clean" />
     102-->
    101103        <ant dir="apps/desktopgui" target="jar" />
    102104    </target>
     
    106108    </target>
    107109
    108     <target name="buildJetty" >
     110    <target name="buildJetty" depends="buildProperties" >
    109111        <ant dir="apps/jetty" target="build" />
    110112    </target>
     
    128130    </target>
    129131
    130     <target name="buildCore" >
     132    <target name="buildCore" depends="buildProperties" >
    131133        <ant dir="core/java/" target="jar" />
    132134        <copy file="core/java/build/i2p.jar" todir="build/" />
     135    </target>
     136
     137    <target name="buildProperties" >
     138        <exec executable="mtn" outputproperty="workspace.version" errorproperty="mtn.error1" failifexecutionfails="false" >
     139            <arg value="automate" />
     140            <arg value="get_base_revision_id" />
     141        </exec>
     142        <tstamp>
     143            <format property="build.timestamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC" locale="en" />
     144        </tstamp>
    133145    </target>
    134146
     
    166178        <ant target="doBuildEXE" />
    167179    </target>
    168     <target name="doBuildEXE" unless="noExe">
     180    <target name="doBuildEXE" depends="buildProperties" unless="noExe">
    169181        <jar destfile="./build/launchi2p.jar">
    170182            <manifest>
    171183             <attribute name="Main-Class" value="net.i2p.router.RouterLaunch" />
    172184             <attribute name="Class-Path" value="lib/i2p.jar lib/router.jar lib/jbigi.jar lib/BOB.jar lib/sam.jar lib/mstreaming.jar lib/streaming.jar lib/routerconsole.jar lib/i2ptunnel.jar lib/org.mortbay.jetty.jar lib/javax.servlet.jar lib/jasper-compiler.jar lib/jasper-runtime.jar lib/commons-logging.jar lib/commons-el.jar lib/wrapper.jar lib/systray.jar lib/systray4j.jar lib/desktopgui.jar" />
     185             <attribute name="Build-Date" value="${build.timestamp}" />
     186             <attribute name="Base-Revision" value="${workspace.version}" />
    173187            </manifest>
    174188        </jar>
     
    679693        <copy file="build/org.mortbay.jetty.jar" todir="pkg-temp/lib/" />
    680694    </target>
    681     <target name="installer" depends="preppkg">
     695    <target name="installer" depends="preppkg, buildProperties">
    682696        <taskdef name="izpack" classpath="${basedir}/installer/lib/izpack/standalone-compiler.jar" classname="com.izforge.izpack.ant.IzPackTask" />
    683697        <mkdir dir="pkg-temp/installer" />
     698        <exec executable="mtn" outputproperty="workspace.changes.util" errorproperty="mtn.error.util" failifexecutionfails="false" >
     699            <arg value="list" />
     700            <arg value="changed" />
     701            <arg value="core/java/src/net/i2p/util" />
     702        </exec>
     703        <!-- \n in an attribute value generates an invalid manifest -->
     704        <exec executable="tr" inputstring="${workspace.changes.util}" outputproperty="workspace.changes.util.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
     705            <arg value="-s" />
     706            <arg value="[:space:]" />
     707            <arg value="," />
     708        </exec>
    684709        <jar destfile="./pkg-temp/installer/copy.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Copy.class net/i2p/util/FileUtil.class">
    685             <manifest><attribute name="Main-Class" value="net.i2p.util.Copy" /></manifest>
     710            <manifest>
     711                <attribute name="Main-Class" value="net.i2p.util.Copy" />
     712                <attribute name="Build-Date" value="${build.timestamp}" />
     713                <attribute name="Base-Revision" value="${workspace.version}" />
     714                <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
     715            </manifest>
    686716        </jar>
    687717        <jar destfile="./pkg-temp/installer/delete.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Delete.class net/i2p/util/FileUtil.class">
    688             <manifest><attribute name="Main-Class" value="net.i2p.util.Delete" /></manifest>
     718            <manifest>
     719                <attribute name="Main-Class" value="net.i2p.util.Delete" />
     720                <attribute name="Build-Date" value="${build.timestamp}" />
     721                <attribute name="Base-Revision" value="${workspace.version}" />
     722                <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
     723            </manifest>
    689724        </jar>
    690725        <jar destfile="./pkg-temp/installer/exec.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Exec.class">
    691             <manifest><attribute name="Main-Class" value="net.i2p.util.Exec" /></manifest>
     726            <manifest>
     727                <attribute name="Main-Class" value="net.i2p.util.Exec" />
     728                <attribute name="Build-Date" value="${build.timestamp}" />
     729                <attribute name="Base-Revision" value="${workspace.version}" />
     730                <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
     731            </manifest>
    692732        </jar>
    693733        <!--
Note: See TracChangeset for help on using the changeset viewer.