Changeset 256b0553 for build.xml


Ignore:
Timestamp:
Jan 21, 2012 3:28:24 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
9252d6f
Parents:
b003ee8
Message:
  • Build: Fix Windows build, version checking for release
File:
1 edited

Legend:

Unmodified
Added
Removed
  • build.xml

    rb003ee8 r256b0553  
    444444
    445445    <target name="getReleaseNumber" >
    446         <exec executable="grep" outputproperty="versionLine" failonerror="true" >
     446        <exec executable="grep" outputproperty="versionLine" failifexecutionfails="false" >
    447447            <arg value="public final static String VERSION" />
    448448            <arg value="core/java/src/net/i2p/CoreVersion.java" />
    449449        </exec>
    450         <exec executable="cut" osfamily="unix" inputstring="${versionLine}" outputproperty="release.number" failonerror="true" >
     450        <property name="versionLine" value="unknown" />
     451        <exec executable="cut" osfamily="unix" inputstring="${versionLine}" outputproperty="release.number" failifexecutionfails="false" >
    451452            <arg value="-f2" />
    452453            <arg value="-d&quot;" />
    453454        </exec>
    454         <exec executable="cut" osfamily="mac" inputstring="${versionLine}" outputproperty="release.number" failonerror="true" >
     455        <exec executable="cut" osfamily="mac" inputstring="${versionLine}" outputproperty="release.number" failifexecutionfails="false" >
    455456            <arg value="-f2" />
    456457            <arg value="-d&quot;"/>
    457458        </exec>
    458         <exec executable="cut" osfamily="windows" inputstring="${versionLine}" outputproperty="release.number" failonerror="true" >
     459        <exec executable="cut" osfamily="windows" inputstring="${versionLine}" outputproperty="release.number" failifexecutionfails="false" >
    459460            <arg value="-f2" />
    460461            <arg value="-d&quot;\&quot;&quot;"/>
    461462        </exec>
     463        <property name="release.number" value="unknown" />
    462464        <echo message="Release number is ${release.number}" />
    463465    </target>
    464466
    465467    <target name="getBuildNumber" >
    466         <exec executable="grep" outputproperty="buildLine" >
     468        <exec executable="grep" outputproperty="buildLine" failifexecutionfails="false" >
    467469            <arg value="public final static long BUILD" />
    468470            <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
    469471        </exec>
    470         <exec executable="cut" inputstring="${buildLine}" outputproperty="build.temp" failonerror="true" >
     472        <property name="buildLine" value="??" />
     473        <exec executable="cut" inputstring="${buildLine}" outputproperty="build.temp" failifexecutionfails="false" >
    471474            <arg value="-f2" />
    472475            <arg value="-d=" />
    473476        </exec>
    474         <exec executable="tr" inputstring="${build.temp}" outputproperty="build.temp.tr" failonerror="true">
     477        <property name="build.temp" value="??" />
     478        <exec executable="tr" inputstring="${build.temp}" outputproperty="build.temp.tr" failifexecutionfails="false">
    475479            <arg value="-d" />
    476480            <arg value="&quot;[:space:]&quot;"/>
    477481        </exec>
    478         <exec executable="cut" inputstring="${build.temp.tr}" outputproperty="build.number" failonerror="true" >
     482        <property name="build.temp.tr" value="??" />
     483        <exec executable="cut" inputstring="${build.temp.tr}" outputproperty="build.number" failifexecutionfails="false" >
    479484            <arg value="-f1" />
    480485            <arg value="-d;" />
    481486        </exec>
    482         <exec executable="awk" outputproperty="build.extra" failonerror="false">
     487        <exec executable="awk" outputproperty="build.extra" failifexecutionfails="false">
    483488            <arg value="-F&quot;" />
    484489            <arg value="/public final static String EXTRA/{print $2}" />
    485490            <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
    486491        </exec>
     492        <property name="build.number" value="??" />
     493        <property name="build.extra" value="" />
    487494        <echo message="Build number is ${build.number}${build.extra}" />
     495    </target>
     496
     497    <target name="verifyReleaseBuildNumbers" depends="getReleaseNumber, getBuildNumber" >
     498        <fail message="Bad release number: ${release.number}" >
     499            <condition>
     500                <or>
     501                    <equals arg1="${release.number}" arg2="unknown"/>
     502                    <equals arg1="${release.number}" arg2=""/>
     503                </or>
     504            </condition>
     505        </fail>
     506        <fail message="Non-zero build number: ${build.number}" >
     507            <condition>
     508                <not>
     509                    <equals arg1="${build.number}" arg2="0"/>
     510                </not>
     511            </condition>
     512        </fail>
     513        <fail message="Non-empty extra build: ${build.extra}" >
     514            <condition>
     515                <not>
     516                    <equals arg1="${build.extra}" arg2=""/>
     517                </not>
     518            </condition>
     519        </fail>
    488520    </target>
    489521
     
    12361268    <target name="release" depends="distclean, updaterWithJettyFixesAndJbigi , updater200WithJettyFixes, preppkg, installer, getReleaseNumber" >
    12371269-->
    1238     <target name="release" depends="distclean, testscripts, updater, updater200, preppkg, installer, getReleaseNumber" >
     1270    <target name="release" depends="verifyReleaseBuildNumbers, distclean, testscripts, updater, updater200, preppkg, installer" >
    12391271        <echo message="================================================================" />
    12401272        <echo message="Did you update these files?" />
Note: See TracChangeset for help on using the changeset viewer.