Changeset 18664d3 for build.xml


Ignore:
Timestamp:
Jan 10, 2013 2:43:15 PM (8 years ago)
Author:
kytv <kytv@…>
Branches:
master
Children:
e34cd0b
Parents:
7a8fde6
Message:

add bumpBuild target

File:
1 edited

Legend:

Unmodified
Added
Removed
  • build.xml

    r7a8fde6 r18664d3  
    200200            ]]>
    201201        </script>
     202    </target>
     203
     204    <target name="checkIfBumped">
     205        <exec executable="mtn" outputproperty="bumped" errorproperty="mtn.error2" failifexecutionfails="false" >
     206            <arg value="ls" />
     207            <arg value="ch" />
     208            <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
     209        </exec>
     210        <condition property="bumped.already">
     211            <not>
     212                <equals arg1="${bumped}" arg2=""/>
     213            </not>
     214        </condition>
     215    </target>
     216
     217    <target name="bumpBuild" depends="checkIfBumped, getBuildNumber" unless="bumped.already">
     218        <script language="javascript">
     219            <![CDATA[
     220            var newBuildNumber = (Number(project.getProperty("i2p.build.number")) + 1);
     221            if (newBuildNumber != 'unknown' && newBuildNumber != null) {
     222                echo = project.createTask("echo");
     223                project.setProperty("new.i2p.build.number", newBuildNumber);
     224                echo.setMessage("Build number is now: " + newBuildNumber);
     225                echo.perform();
     226            }
     227            ]]>
     228        </script>
     229        <replaceregexp byline="true" file="router/java/src/net/i2p/router/RouterVersion.java"
     230            match='(^\s+public\s+final\s+static\s+long\s+BUILD\s+=\s+)[0-9]+;' replace='\1${new.i2p.build.number};'/>
    202231    </target>
    203232
Note: See TracChangeset for help on using the changeset viewer.