Changeset 1ffc006


Ignore:
Timestamp:
May 19, 2019 2:31:11 PM (11 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
b89720e
Parents:
f2f5df0
Message:

Build: Remove dependencies on Nashorn (ticket #2367)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • build.xml

    rf2f5df0 r1ffc006  
    297297
    298298    <target name="-setepoch">
    299         <script language="javascript">
    300             <![CDATA[
    301               property = project.setProperty("epoch",Math.floor((new Date()).getTime()/1000));
    302             ]]>
    303         </script>
     299        <exec executable="date" outputproperty="epoch" errorproperty="dc.error" failifexecutionfails="true" >
     300            <arg value="+%s" />
     301        </exec>
     302        <echo message="Epoch is: ${epoch}" />
    304303    </target>
    305304
     
    504503
    505504    <target name="trimMtnRev" depends="getMtnRev">
    506         <script language="javascript">
    507             <![CDATA[
    508             var MtnRev = project.getProperty("workspace.version");
    509             if (MtnRev != 'unknown' && MtnRev != null) {
    510                 echo = project.createTask("echo");
    511                 var MtnShortHash = MtnRev.substring(0,8);
    512                 project.setProperty("MtnShortHash", MtnShortHash);
    513                 echo.setMessage("Trimmed hash: " + MtnShortHash);
    514                 echo.perform();
    515             } else {
    516                 project.setProperty("MtnShortHash", 'unknown');
    517             }
    518             ]]>
    519         </script>
     505        <exec executable="cut" inputstring="${workspace.version}" outputproperty="MtnShortHash" errorproperty="cut.error1" failifexecutionfails="true" >
     506            <arg value="-c" />
     507            <arg value="1-8" />
     508        </exec>
     509        <echo message="Short version is: ${MtnShortHash}" />
    520510    </target>
    521511
     
    535525    <target name="bump" depends="bumpBuild" />
    536526    <target name="bumpBuild" depends="checkIfBumped, getBuildNumber" unless="bumped.already">
    537         <script language="javascript">
    538             <![CDATA[
    539             var newBuildNumber = (Number(project.getProperty("i2p.build.number")) + 1);
    540             if (newBuildNumber != 'unknown' && newBuildNumber != null) {
    541                 echo = project.createTask("echo");
    542                 project.setProperty("new.i2p.build.number", newBuildNumber);
    543                 echo.setMessage("Build number is now: " + newBuildNumber + project.getProperty("build.extra"));
    544                 echo.perform();
    545             }
    546             ]]>
    547         </script>
     527        <exec executable="dc" outputproperty="new.i2p.build.number" errorproperty="dc.error" failifexecutionfails="true" >
     528            <arg value="-e" />
     529            <arg value="${i2p.build.number} 1 + n" />
     530        </exec>
     531        <echo message="Build number is now: ${new.i2p.build.number}${build.extra}" />
    548532        <replaceregexp byline="true" file="router/java/src/net/i2p/router/RouterVersion.java"
    549533            match='(^\s+public\s+final\s+static\s+long\s+BUILD\s+=\s+)[0-9]+;' replace='\1${new.i2p.build.number};'/>
Note: See TracChangeset for help on using the changeset viewer.