Changeset f57f49c3 for build.xml


Ignore:
Timestamp:
Jan 13, 2013 12:38:05 PM (8 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
4ba8f02
Parents:
8d2eff76 (diff), 4f14677 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

propagate from branch 'i2p.i2p' (head f33e0980fd48ba4acda12d2079f2a4834a710ae4)

to branch 'i2p.i2p.zzz.jetty7' (head bd1a64f7262ad5bbea3529675f1f055b9ad257a8)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • build.xml

    r8d2eff76 rf57f49c3  
    6363            <echo message=" " />
    6464            <echo message="apt-get install debhelper ant debconf default-jdk gettext libgmp3-dev po-debconf fakeroot build-essential \" />
    65             <echo message="                   quilt libcommons-el-java libcommons-logging-java libjetty-extra-java libjetty-java" />
     65            <echo message="                   quilt libcommons-logging-java" />
    6666            <echo message=" " />
    6767            <echo message="Once the dependencies are installed, run &quot;ant debian&quot;"/>
     
    185185    </target>
    186186
     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>
     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};'/>
     231    </target>
     232
    187233    <target name="buildProperties" depends="getMtnRev, getReleaseNumber, getBuildNumber" >
    188234        <!-- default if not set above -->
     
    208254    <target name="buildexe">
    209255        <condition property="noExe">
    210             <or>
    211                 <os arch="ppc" />
    212                 <os arch="armv5tejl" />
    213             </or>
    214         </condition>
    215         <condition property="noExe">
    216            <not>
    217             <or>
    218              <os name="Linux" />
    219              <os family="windows" />
    220             </or>
    221            </not>
    222         </condition>
    223         <ant target="doBuildEXE" />
    224     </target>
    225 
    226     <taskdef name="launch4j"
    227              classname="net.sf.launch4j.ant.Launch4jTask"
    228              classpath="${basedir}/installer/lib/launch4j/launch4j.jar:${basedir}/installer/lib/launch4j/lib/xstream.jar" />
     256            <or>
     257                <os arch="ppc" />
     258                <os arch="armv5tejl" />
     259                <os arch="armv6l" />
     260                <os arch="armv7l" />
     261            </or>
     262        </condition>
     263        <condition property="noExe">
     264            <not>
     265                <or>
     266                    <os name="Linux" />
     267                    <os family="windows" />
     268                </or>
     269            </not>
     270        </condition>
     271        <ant target="doBuildEXE" />
     272    </target>
     273
     274    <target name="launch4j">
     275        <taskdef name="launch4j"
     276                 classname="net.sf.launch4j.ant.Launch4jTask"
     277                 classpath="${basedir}/installer/lib/launch4j/launch4j.jar:${basedir}/installer/lib/launch4j/lib/xstream.jar" />
     278     </target>
    229279
    230280    <!-- this makes an empty build/launchi2p.jar and the build/i2p.exe for the no-wrapper windows startup -->
    231     <target name="doBuildEXE" depends="buildProperties" unless="noExe">
     281    <target name="doBuildEXE" depends="buildProperties, launch4j" unless="noExe">
    232282        <echo message="See the file &quot;build.properties&quot; if this step fails." />
    233283        <jar destfile="./build/launchi2p.jar">
     
    313363        <property name="workspace.changes.jbigi.tr" value="" />
    314364        <jar destfile="build/jbigi.jar"  whenmanifestonly="fail" >
    315             <fileset dir="installer/lib/jbigi" includes="*freebsd*.so" />
     365            <fileset dir="installer/lib/jbigi" includes="*bsd*.so" />
    316366            <manifest>
    317367                <attribute name="Built-By" value="${build.built-by}" />
     
    393443
    394444    <target name="prep-script-translation" >
    395         <!-- script translation added in 0.8.13, disable for now -->
    396         <echo message="i2prouter script translations disabled" />
    397 <!--
     445        <!-- script translation added in 0.8.13, enabled in 0.9.5. -->
    398446        <ant dir="installer/resources/locale" target="bundle" />
    399447        <copy todir="pkg-temp/locale/">
    400448            <fileset dir="installer/resources/locale/mo/" />
    401449        </copy>
    402 -->
    403450    </target>
    404451
     
    425472            <group title="I2PSnark Application" packages="org.klomp.snark:org.klomp.snark.*:net.i2p.kademlia" />
    426473            <group title="I2PTunnel Application" packages="net.i2p.i2ptunnel:net.i2p.i2ptunnel.*" />
     474            <group title="Installer Utilities" packages="net.i2p.installer" />
    427475            <group title="Jetty Logging" packages="net.i2p.jetty" />
    428476            <group title="SAM Bridge" packages="net.i2p.sam" />
     
    449497                <pathelement location="apps/susimail/src/src" />
    450498                <pathelement location="apps/jetty/java/src" />
     499                <pathelement location="installer/java/src" />
    451500            </sourcepath>
    452501            <classpath>
     
    465514                 End-users can override by creating the file override.properties -->
    466515            <link offline="true" href="${javasedocs.url}" packagelistLoc="installer/resources/package-lists/java/" />
     516            <link offline="true" href="${javaeedocs.url}" packagelistLoc="installer/resources/package-lists/javaee/" />
    467517            <link offline="true" href="${jettydocs.url}" packagelistLoc="installer/resources/package-lists/jetty/" />
    468518            <link offline="true" href="${jrobindocs.url}" packagelistLoc="installer/resources/package-lists/jrobin/" />
     
    476526        <mkdir dir="./build" />
    477527        <mkdir dir="./build/javadoc-test" />
     528
     529        <!-- set junit home to the old default unless overridden elsewhere -->
     530        <property name="junit.home" value="${ant.home}/lib/" />
    478531        <javadoc access="package"
    479532            destdir="./build/javadoc-test"
     
    488541                <pathelement location="core/java/test/junit" />
    489542                <pathelement location="router/java/test/junit" />
     543                <pathelement location="core/java/test/scalatest" />
    490544            </sourcepath>
    491545            <classpath>
    492546                <pathelement location="build/i2p.jar" />
    493547                <pathelement location="build/router.jar" />
    494                 <pathelement location="${ant.home}/lib/junit.jar" />
     548                <pathelement location="${junit.home}/junit4.jar" />
    495549            </classpath>
    496             <!-- These variables are stored in build.properties.
    497                 End-users can override by creating the file override.properties -->
     550            <!-- These variables are stored in build.properties.
     551        End-users can override by creating the file override.properties -->
    498552            <link offline="true" href="${javasedocs.url}" packagelistLoc="installer/resources/package-lists/java/" />
    499553            <link offline="true" href="${junitdocs.url}" packagelistLoc="installer/resources/package-lists/junit/" />
     
    503557    </target>
    504558
    505     <target name="getReleaseNumber" >
    506         <exec executable="grep" outputproperty="versionLine" failifexecutionfails="false" >
    507             <arg value="public final static String VERSION" />
    508             <arg value="core/java/src/net/i2p/CoreVersion.java" />
    509         </exec>
    510         <property name="versionLine" value="unknown" />
    511         <exec executable="cut" osfamily="unix" inputstring="${versionLine}" outputproperty="release.number" failifexecutionfails="false" >
    512             <arg value="-f2" />
    513             <arg value="-d&quot;" />
    514         </exec>
    515         <exec executable="cut" osfamily="mac" inputstring="${versionLine}" outputproperty="release.number" failifexecutionfails="false" >
    516             <arg value="-f2" />
    517             <arg value="-d&quot;"/>
    518         </exec>
    519         <exec executable="cut" osfamily="windows" inputstring="${versionLine}" outputproperty="release.number" failifexecutionfails="false" >
    520             <arg value="-f2" />
    521             <arg value="-d&quot;\&quot;&quot;"/>
    522         </exec>
     559    <target name="getReleaseNumber">
     560        <loadfile srcfile="core/java/src/net/i2p/CoreVersion.java" property="release.number">
     561            <filterchain>
     562                <linecontains>
     563                    <contains value="public final static String VERSION"/>
     564                </linecontains>
     565                <tokenfilter>
     566                    <replaceregex pattern='.*"([^"]+)";' replace="\1" flags="gi" />
     567                </tokenfilter>
     568                <striplinebreaks/>
     569                <trim/>
     570            </filterchain>
     571        </loadfile>
    523572        <property name="release.number" value="unknown" />
    524573        <echo message="Release number is ${release.number}" />
    525574    </target>
    526575
    527     <target name="getBuildNumber" >
    528         <exec executable="grep" outputproperty="buildLine" failifexecutionfails="false" >
    529             <arg value="public final static long BUILD" />
    530             <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
    531         </exec>
    532         <property name="buildLine" value="??" />
    533         <exec executable="cut" inputstring="${buildLine}" outputproperty="build.temp" failifexecutionfails="false" >
    534             <arg value="-f2" />
    535             <arg value="-d=" />
    536         </exec>
    537         <property name="build.temp" value="??" />
    538         <exec executable="tr" inputstring="${build.temp}" outputproperty="build.temp.tr" failifexecutionfails="false">
    539             <arg value="-d" />
    540             <arg value="&quot;[:space:]&quot;"/>
    541         </exec>
    542         <property name="build.temp.tr" value="??" />
    543         <exec executable="cut" inputstring="${build.temp.tr}" outputproperty="i2p.build.number" failifexecutionfails="false" >
    544             <arg value="-f1" />
    545             <arg value="-d;" />
    546         </exec>
    547         <exec executable="awk" osfamily="unix" outputproperty="build.extra" failifexecutionfails="false">
    548             <arg value="-F&quot;" />
    549             <arg value="/public final static String EXTRA/{print $2}" />
    550             <arg value="router/java/src/net/i2p/router/RouterVersion.java" />
    551         </exec>
     576    <target name="getBuildNumber">
     577        <loadfile srcfile="router/java/src/net/i2p/router/RouterVersion.java" property="i2p.build.number">
     578            <filterchain>
     579                <linecontains>
     580                    <contains value="public final static long BUILD" />
     581                </linecontains>
     582                <tokenfilter>
     583                    <replaceregex pattern=".*=\s+([0-9]+);" replace="\1" flags="gi" />
     584                </tokenfilter>
     585                <trim/>
     586                <striplinebreaks/>
     587            </filterchain>
     588        </loadfile>
     589        <loadfile srcfile="router/java/src/net/i2p/router/RouterVersion.java" property="build.extra">
     590            <filterchain>
     591                <linecontains>
     592                    <contains value="public final static String EXTRA" />
     593                </linecontains>
     594                <tokenfilter>
     595                    <replaceregex pattern='.*"(.*)";' replace="\1" flags="gi" />
     596                </tokenfilter>
     597                <trim/>
     598                <striplinebreaks/>
     599            </filterchain>
     600        </loadfile>
    552601        <property name="i2p.build.number" value="??" />
    553602        <property name="build.extra" value="" />
     
    583632    <target name="clean" depends="pkgclean" >
    584633        <delete dir="./build" />
    585         <delete file="installer/lib/izpack/patches.jar" failonerror="false" quiet="true" />     
     634        <delete dir="./reports" />
     635        <delete file="installer/lib/izpack/patches.jar" failonerror="false" quiet="true" />
    586636        <delete file="syndie-standalone.zip" failonerror="false" quiet="true" />
    587637        <delete failonerror="false" quiet="true">
    588             <fileset dir="." includes="i2pinstall*jar javadoc.zip i2pinstall*.exe i2pinstall*bz2" />
     638            <fileset dir="." includes="i2pinstall*jar i2p*deb libjbigi*deb i2p.fba ${sloccount.report.file} javadoc.zip i2pinstall*.exe i2pinstall*bz2" />
    589639        </delete>
    590640        <delete file="i2psnark-standalone.zip" failonerror="false" quiet="true" />
    591         <delete file="BOB-one.jar" failonerror="false" quiet="true" /> 
     641        <delete file="BOB-one.jar" failonerror="false" quiet="true" />
    592642        <delete dir="debian/tmp" />
    593643        <delete dir="debian/db" />
     
    595645        <delete file="debian/build" />
    596646        <delete file="debian/substvars"/>
     647        <delete file="core/java/cobertura.ser"/>
    597648    </target>
    598649
     
    604655        <ant dir="core/java/" target="distclean" />
    605656        <ant dir="router/java/" target="distclean" />
     657        <ant dir="installer/java" target="distclean" />
    606658        <ant dir="apps/ministreaming/java/" target="distclean" />
    607659        <ant dir="apps/streaming/java/" target="distclean" />
     
    617669        <ant dir="apps/i2psnark/java/" target="distclean" />
    618670        <ant dir="apps/jetty/" target="distclean" />
    619         <delete dir="core/c/jbigi/bin" />
    620         <delete dir="core/c/jbigi/lib" />
    621         <delete dir="core/c/jcpuid/lib" />
     671        <delete dir="core/c/jbigi/bin" />
     672        <delete dir="core/c/jbigi/lib" />
     673        <delete dir="core/c/jcpuid/lib" />
    622674        <ant dir="installer/resources/locale" target="distclean" />
    623675        <!--
     
    728780    <target name="preppkg-unix" depends="preppkg-base, prep-script-translation" >
    729781        <copy file="installer/resources/runplain.sh" todir="pkg-temp/" />
    730         <!-- <copy file="apps/i2psnark/launch-i2psnark" todir="pkg-temp/" /> old feature that per zzz isn't used-->
    731782        <copy file="installer/resources/eepget" todir="pkg-temp/" />
    732783        <copy file="installer/resources/i2prouter" todir="pkg-temp/" />
     
    750801
    751802    <target name="preppkg-linux-nonx86" depends="preppkg-unix">
    752         <copy todir="pkg-temp/lib/wrapper/linux-armv7/">
    753             <fileset dir="installer/lib/wrapper/linux-armv7/" excludes="*.txt" />
    754         </copy>
    755         <copy todir="pkg-temp/lib/wrapper/linux-ppc/">
    756             <fileset dir="installer/lib/wrapper/linux-ppc/" excludes="*.txt" />
    757         </copy>
     803        <copy todir="pkg-temp/lib/wrapper/linux-ppc/">
     804            <fileset dir="installer/lib/wrapper/linux-ppc/" excludes="*.txt" />
     805        </copy>
    758806        <copy todir="pkg-temp/lib/wrapper/linux-armv5/">
    759807            <fileset dir="installer/lib/wrapper/linux-armv5/" excludes="*.txt" />
     808        </copy>
     809        <copy todir="pkg-temp/lib/wrapper/linux-armv6/">
     810            <fileset dir="installer/lib/wrapper/linux-armv6/" excludes="*.txt" />
    760811        </copy>
    761812    </target>
     
    776827    <target name="preppkg-osx-only" depends="preppkg-osx, jbigi-osx-only" >
    777828        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
    778         <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />     
    779     </target>
    780    
    781     <target name="preppkg-windows" depends="preppkg-base, buildexe">
     829        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
     830    </target>
     831
     832    <target name="preppkg-windows" depends="preppkg-base, buildUtilityJar, buildexe">
    782833        <copy file="build/i2p.exe" todir="pkg-temp/" failonerror="false" />
    783834        <copy file="apps/systray/java/lib/systray4j.dll" todir="pkg-temp/lib" />
     
    787838        <copy file="installer/resources/i2prouter.bat" todir="pkg-temp/" />
    788839        <copy file="installer/resources/fixperms.bat" todir="pkg-temp/" />
    789         <copy file="installer/resources/fixpaths.cmd" todir="pkg-temp/" />
    790840        <copy file="installer/resources/install_i2p_service_winnt.bat" todir="pkg-temp/" />
    791841        <copy file="installer/resources/set_config_dir_for_nt_service.bat" todir="pkg-temp/" />
    792842        <copy file="installer/resources/uninstall_i2p_service_winnt.bat" todir="pkg-temp/" />
    793843        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
     844        <copy file="build/utility.jar" todir="pkg-temp" />
    794845        <copy todir="pkg-temp/lib/wrapper/win32/">
    795846            <fileset dir="installer/lib/wrapper/win32/" excludes="*.txt" />
    796847        </copy>
    797         <copy todir="pkg-temp/lib/wrapper/win64/">
    798             <fileset dir="installer/lib/wrapper/win64/" excludes="*.txt" />
     848        <copy todir="pkg-temp/lib/wrapper/win64/">
     849            <fileset dir="installer/lib/wrapper/win64/" excludes="*.txt" />
    799850        </copy>
    800851    </target>
     
    802853    <target name="preppkg-windows-only" depends="preppkg-windows, jbigi-windows-only">
    803854        <copy file="build/jbigi.jar" todir="pkg-temp/lib" />
    804         <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
    805     </target>
    806    
     855        <copy file="installer/lib/wrapper/all/wrapper.jar" todir="pkg-temp/lib" />
     856    </target>
     857
    807858    <target name="preppkg-base" depends="build, preplicenses, prepConsoleDocs, prepthemeupdates, prepCertificates">
    808859        <!-- if updater200 was run previously, it left *.pack files in pkg-temp -->
     
    866917        <mkdir dir="pkg-temp/eepsite" />
    867918        <copy todir="pkg-temp/eepsite/" >
    868             <fileset dir="installer/resources/eepsite/" />
     919            <fileset dir="installer/resources/eepsite/" excludes="**/.placeholder" />
    869920        </copy>
    870921        <copy todir="pkg-temp/eepsite/docroot/help/lib/" >
     
    922973          <fileset dir="installer/resources/initialNews/" />
    923974        </copy>
     975        <!-- ensure the proxy files have the correct line endings -->
     976        <fixcrlf srcdir="pkg-temp/docs" includes="*.ht" encoding="utf8" eol="crlf" />
    924977    </target>
    925978
     
    10461099        <copy file="history.txt" todir="pkg-temp/" />
    10471100        <!-- the following overwrites history.txt on unix to shrink the update file -->
    1048         <exec executable="head" osfamily="unix" failifexecutionfails="true" output="pkg-temp/history.txt">
    1049             <arg value="-n" />
    1050             <arg value="1500" />
    1051             <arg value="history.txt" />
    1052         </exec>
    1053         <exec executable="echo" osfamily="unix" failifexecutionfails="true" output="pkg-temp/history.txt" append="true">
    1054             <arg value="&#10;&#10;----------------&#10;&#10;EARLIER HISTORY IS AVAILABLE IN THE SOURCE PACKAGE" />
    1055         </exec>
     1101        <copy file="history.txt" tofile="pkg-temp/history.txt" overwrite="true">
     1102            <filterchain>
     1103                <headfilter lines="1500" />
     1104            </filterchain>
     1105        </copy>
     1106        <concat append="true" destfile="pkg-temp/history.txt">&#10;&#10;----------------&#10;&#10;EARLIER HISTORY IS AVAILABLE IN THE SOURCE PACKAGE"</concat>
    10561107        <copy file="installer/resources/deletelist.txt" todir="pkg-temp/" />
    10571108    </target>
     
    11311182    </target>
    11321183
    1133     <taskdef name="izpack"
    1134              classpath="${basedir}/installer/lib/izpack/patches.jar:${basedir}/installer/lib/izpack/standalone-compiler.jar"
    1135              classname="com.izforge.izpack.ant.IzPackTask" />
    1136 
    11371184    <target name="izpack-patches" >
     1185            <taskdef name="izpack"
     1186                     classpath="${basedir}/installer/lib/izpack/patches.jar:${basedir}/installer/lib/izpack/standalone-compiler.jar"
     1187                     classname="com.izforge.izpack.ant.IzPackTask" />
    11381188        <jar destfile="${basedir}/installer/lib/izpack/patches.jar"
    11391189             basedir="${basedir}/installer/lib/izpack/patches" />
    11401190    </target>
    11411191
    1142     <target name="utility-jars" depends="buildCore" >
    1143         <mkdir dir="pkg-temp/installer" />
    1144         <!-- set if unset -->
    1145         <property name="workspace.changes.util.tr" value="" />
    1146         <jar destfile="./pkg-temp/installer/copy.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Copy.class net/i2p/util/FileUtil.class">
    1147             <manifest>
    1148                 <attribute name="Main-Class" value="net.i2p.util.Copy" />
    1149                 <attribute name="Built-By" value="${build.built-by}" />
    1150                 <attribute name="Build-Date" value="${build.timestamp}" />
    1151                 <attribute name="Base-Revision" value="${workspace.version}" />
    1152                 <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
    1153             </manifest>
    1154         </jar>
    1155         <jar destfile="./pkg-temp/installer/delete.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Delete.class net/i2p/util/FileUtil.class">
    1156             <manifest>
    1157                 <attribute name="Main-Class" value="net.i2p.util.Delete" />
    1158                 <attribute name="Built-By" value="${build.built-by}" />
    1159                 <attribute name="Build-Date" value="${build.timestamp}" />
    1160                 <attribute name="Base-Revision" value="${workspace.version}" />
    1161                 <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
    1162             </manifest>
    1163         </jar>
    1164         <jar destfile="./pkg-temp/installer/exec.jar" basedir="./core/java/build/obj" includes="net/i2p/util/Exec.class">
    1165             <manifest>
    1166                 <attribute name="Main-Class" value="net.i2p.util.Exec" />
    1167                 <attribute name="Built-By" value="${build.built-by}" />
    1168                 <attribute name="Build-Date" value="${build.timestamp}" />
    1169                 <attribute name="Base-Revision" value="${workspace.version}" />
    1170                 <attribute name="Workspace-Changes" value="${workspace.changes.util.tr}" />
    1171             </manifest>
    1172         </jar>
    1173     </target>
    1174 
    1175     <target name="installer" depends="preppkg, buildProperties, util-list-changes, izpack-patches, utility-jars" >
     1192    <target name="buildUtilityJar" depends="buildCore">
     1193        <ant dir="installer/java" target="build" />
     1194    </target>
     1195
     1196    <target name="installer" depends="preppkg, buildProperties, util-list-changes, izpack-patches, buildUtilityJar" >
    11761197        <!--
    11771198          Force 1.5 pack200 output
     
    11881209    </target>
    11891210
    1190     <target name="installerexe">
     1211    <target name="installerexe" depends="launch4j">
    11911212        <condition property="noExe">
    1192             <or>
    1193                 <os arch="ppc" />
    1194                 <os arch="armv5tejl" />
    1195             </or>
    1196         </condition>
    1197         <condition property="noExe">
    1198            <not>
    1199             <or>
    1200              <os name="Linux" />
    1201              <os family="windows" />
    1202             </or>
    1203            </not>
    1204         </condition>
    1205         <ant target="doInstallerEXE" />
     1213            <or>
     1214                <os arch="ppc" />
     1215                <os arch="armv5tejl" />
     1216                <os arch="armv6l" />
     1217                <os arch="armv7l" />
     1218            </or>
     1219        </condition>
     1220        <condition property="noExe">
     1221            <not>
     1222                <or>
     1223                    <os name="Linux" />
     1224                    <os family="windows" />
     1225                </or>
     1226            </not>
     1227        </condition>
     1228        <ant target="doInstallerEXE" />
    12061229    </target>
    12071230
    12081231    <!-- this makes i2pinstall.exe from install.jar -->
    1209     <target name="doInstallerEXE" unless="noExe">
     1232    <target name="doInstallerEXE" depends="launch4j" unless="noExe">
    12101233        <echo message="See the file &quot;build.properties&quot; if this step fails." />
    1211         <!-- now the installer exe -->
     1234        <!-- now the installer exe -->
    12121235        <launch4j configFile="./installer/i2pinstaller.xml" />
    1213         <!-- thazzit -->
     1236        <!-- thazzit -->
    12141237    </target>
    12151238
    12161239    <!-- Custom installers -->
    12171240    <target name="installer-nowindows" depends="clean, preppkg-nowindows, izpack-patches" >
    1218         <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}.jar" installerType="standard" basedir="${basedir}" />
     1241        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
     1242        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}.jar" installerType="standard" basedir="${basedir}" />
    12191243    </target>
    12201244
    12211245
    12221246    <target name="installer-freebsd" depends="clean, preppkg-freebsd-only, izpack-patches" >
    1223         <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_freebsd-only.jar" installerType="standard" basedir="${basedir}" />
     1247        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
     1248        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_freebsd-only.jar" installerType="standard" basedir="${basedir}" />
    12241249    </target>
    12251250
    12261251    <target name="installer-linux" depends="clean, preppkg-linux-only, izpack-patches" >
    1227         <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_linux-only.jar" installerType="standard" basedir="${basedir}" />
     1252        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
     1253        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_linux-only.jar" installerType="standard" basedir="${basedir}" />
    12281254    </target>
    12291255
    12301256
    12311257    <target name="installer-osx" depends="clean, checkForIzpack2App, preppkg-osx-only, izpack-patches">
    1232         <mkdir dir="pkg-temp/osx" />
    1233         <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_osx-only.jar" installerType="standard" basedir="${basedir}" />
    1234         <ant target="installer2app" />
    1235         <delete dir="pkg-temp/osx" />
     1258        <fixcrlf srcdir="pkg-temp" includes="*.config **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="lf" />
     1259        <mkdir dir="pkg-temp/osx" />
     1260        <izpack input="${basedir}/installer/install.xml" output="${basedir}/i2pinstall_${full.version}_osx-only.jar" installerType="standard" basedir="${basedir}" />
     1261        <ant target="installer2app" />
     1262        <delete dir="pkg-temp/osx" />
    12361263    </target>
    12371264
    12381265    <target name="checkForIzpack2App">
    1239         <available property="izpack2app.available" file="${user.home}/IzPack/utils/wrappers/izpack2app/izpack2app.py" />
     1266        <!-- we'll set the izpack2app binary name if it's not been set elsewhere yet -->
     1267        <property name="izpack2app.binary" value="${user.home}/IzPack/utils/wrappers/izpack2app/izpack2app.py" />
     1268        <available property="izpack2app.available" file="${izpack2app.binary}" />
    12401269    </target>
    12411270
    12421271    <target name="installer2app" if="izpack2app.available">
    1243         <mkdir dir="pkg-temp/osx" />
    1244         <exec executable="python" failonerror="true">
    1245             <arg value="${user.home}/IzPack/utils/wrappers/izpack2app/izpack2app.py" />
    1246             <arg value="${basedir}/i2pinstall_${full.version}_osx-only.jar" />
    1247             <arg value="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" />
    1248         </exec>
    1249         <exec executable="chmod" failonerror="true" osfamily="unix">
    1250                 <arg value="755" />
    1251                 <arg value="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app/Contents/MacOS/JavaApplicationStub" />
    1252         </exec>
    1253         <exec executable="tar" osfamily="unix" failonerror="true">
    1254                 <arg value="--owner=root" />
    1255                 <arg value="--group=root" />
    1256                 <arg value="-cjvf" />
    1257                 <arg value="${basedir}/i2pinstall_${full.version}_osx.tar.bz2" />
    1258                 <arg value="-C" />
    1259                 <arg value="${basedir}/pkg-temp/osx" />
    1260                 <arg value="i2p-${full.version}_osx-install.app" />
    1261         </exec>
     1272        <mkdir dir="pkg-temp/osx" />
     1273        <exec executable="python" failonerror="true">
     1274            <arg value="${izpack2app.binary}" />
     1275            <arg value="${basedir}/i2pinstall_${full.version}_osx-only.jar" />
     1276            <arg value="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" />
     1277        </exec>
     1278
     1279        <tar longfile="gnu" destfile="${basedir}/i2pinstall_${full.version}_osx.tar.bz2" compression="bzip2">
     1280            <tarfileset dir="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" prefix="/i2p-${full.version}_osx-install.app" filemode="644">
     1281                <include name="**/**" />
     1282                <exclude name="Contents/MacOS/*" />
     1283            </tarfileset>
     1284            <tarfileset dir="${basedir}/pkg-temp/osx/i2p-${full.version}_osx-install.app" prefix="/i2p-${full.version}_osx-install.app" filemode="755">
     1285                <include name="Contents/MacOS/*" />
     1286            </tarfileset>
     1287        </tar>
    12621288    </target>
    12631289
     
    12711297    </target>
    12721298
    1273     <target name="installer-windows" depends="clean, preppkg-windows-only, util-list-changes, izpack-patches, utility-jars" >
    1274         <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
     1299    <target name="installer-windows" depends="clean, preppkg-windows-only, util-list-changes, izpack-patches, buildUtilityJar" >
     1300        <fixcrlf srcdir="pkg-temp" includes="*.config *.bat *.cmd **/*.xml **/*.properties **/*.txt scripts/*" encoding="utf8" eol="crlf"/>
     1301        <izpack input="${basedir}/installer/install.xml" output="${basedir}/install.jar" installerType="standard" basedir="${basedir}" />
    12751302        <ant target="installerexe" />
    12761303        <delete file="${basedir}/install.jar" />
     
    12891316        <zip destfile="i2pupdate.zip" basedir="pkg-temp" />
    12901317    </target>
     1318    <target name="junit.test" depends="buildProperties, jbigi" >
     1319        <ant dir="core/java/" target="junit.test" />
     1320        <ant dir="router/java/" target="junit.test" />
     1321    </target>
     1322    <target name="scalatest.test" depends="buildProperties, jbigi" >
     1323        <ant dir="core/java/" target="scalatest.test" />
     1324        <ant dir="router/java/" target="scalatest.test" />
     1325    </target>
    12911326    <target name="test" depends="buildProperties, jbigi" >
    12921327        <ant dir="core/java/" target="test" />
     1328        <ant dir="router/java/" target="test" />
     1329    </target>
     1330    <target name="scalatest.report" depends="buildProperties" >
     1331        <ant dir="core/java/" target="scalatest.report" />
     1332        <ant dir="router/java/" target="scalatest.report" />
    12931333    </target>
    12941334    <target name="junit.report" depends="buildProperties" >
    12951335        <ant dir="core/java/" target="junit.report" />
     1336        <ant dir="router/java/" target="junit.report" />
    12961337    </target>
    12971338    <target name="clover.report" depends="buildProperties" if="with.clover">
    12981339        <ant dir="core/java/" target="clover.report" />
     1340        <ant dir="router/java/" target="clover.report" />
    12991341    </target>
    13001342    <target name="cobertura.report" depends="buildProperties" if="with.cobertura">
    13011343        <ant dir="core/java/" target="cobertura.report" />
    1302     </target>
    1303     <target name="test.report" depends="junit.report, clover.report, cobertura.report"/>
    1304     <target name="fulltest" depends="buildProperties" >
    1305                 <ant dir="core/java/" target="fulltest" />
    1306                 <ant dir="router/java/" target="fulltest" />
     1344        <ant dir="router/java/" target="cobertura.report" />
     1345    </target>
     1346    <target name="test.report" depends="junit.report, scalatest.report, clover.report, cobertura.report"/>
     1347    <target name="fulltest" depends="buildProperties, jbigi" >
     1348        <ant dir="core/java/" target="fulltest" />
     1349        <ant dir="router/java/" target="fulltest" />
     1350    </target>
     1351    <target name="jenkins.cobertura.report" depends="cobertura.report">
     1352        <!--
     1353             The jenkins cobertura plugin couldn't find the source files.
     1354             Let's see if these changes help it out.
     1355         -->
     1356        <replaceregexp byline="true" file="reports/core/cobertura/coverage.xml"
     1357            match='filename="net' replace='filename="core/java/src/net'/>
     1358        <replaceregexp byline="true" file="reports/core/cobertura/coverage.xml"
     1359            match="&lt;source&gt;./src" replace='&lt;source&gt;./core/java/src'/>
     1360        <replaceregexp byline="true" file="reports/router/cobertura/coverage.xml"
     1361            match='filename="net' replace='filename="router/java/src/net'/>
     1362        <replaceregexp byline="true" file="reports/router/cobertura/coverage.xml"
     1363            match="&lt;source&gt;./src" replace="&lt;source&gt;router/java/src"/>
    13071364    </target>
    13081365    <!-- end unit tests -->
     
    13291386        <ant dir="Slackware/i2p-base/" target="slackpkg" />
    13301387    </target>
    1331     <target name="justBOB" depends="builddepSmall">
     1388    <target name="justBOB" depends="builddepSmall, jbigi">
    13321389        <ant dir="apps/BOB/" target="onejar" />
    13331390        <copy file="apps/BOB/dist/BOB-one.jar" todir="." />
    13341391    </target>
    1335     <target name="findbugs" depends="build2">
     1392
     1393    <target name="sloccount.report">
     1394        <property name="sloccount.report.file" value="sloccount.sc" />
     1395        <echo message="Generating sloccount report (this will take awhile)" />
     1396        <exec executable="sloccount" failonerror="true">
     1397            <arg value="--details"/>
     1398            <arg value="--wide"/>
     1399            <arg value="${basedir}"/>
     1400            <redirector output="${sloccount.report.file}">
     1401                <outputfilterchain>
     1402                    <linecontainsregexp negate="true">
     1403                        <regexp pattern="(Warning: |lib/launch4j|_MTN|reports|pkg-temp|licenses|i2p\.fba|gmp-|WEB-INF)" />
     1404                    </linecontainsregexp>
     1405                    <linecontains negate="true">
     1406                        <contains value="${sloccount.report.file}" />
     1407                    </linecontains>
     1408                </outputfilterchain>
     1409            </redirector>
     1410        </exec>
     1411        <echo message="sloccount report saved to the file &quot;${sloccount.report.file}&quot;" />
     1412    </target>
     1413
     1414    <target name="findbugs" depends="build2, buildUtilityJar">
    13361415        <echo message="Starting findbugs, this will take a while..." />
    13371416        <exec executable="nice" failonerror="true">
     
    13471426            <arg value="build/commons-el.jar:build/commons-logging.jar:build/jasper-compiler.jar:build/jasper-runtime.jar:build/javax.servlet.jar:build/org.mortbay.jetty.jar:apps/jrobin/jrobin-1.5.9.1.jar:apps/systray/java/lib/systray4j.jar:installer/lib/wrapper/all/wrapper.jar:apps/susidns/src/WEB-INF/lib/standard.jar:apps/susidns/src/WEB-INF/lib/jstl.jar:apps/jrobin/jrobin-1.5.9.1.jar"/>
    13481427            <arg value="-sourcepath"/>
    1349             <arg value="apps/BOB/src/:apps/addressbook/java/src/:apps/i2psnark/java/src/:apps/i2ptunnel/java/src/:apps/ministreaming/java/src/:apps/routerconsole/java/src/:apps/sam/java/src/:apps/streaming/java/src/:apps/susidns/src/java/src/:apps/susimail/src/src/:apps/systray/java/src/:core/java/src/:router/java/src/"/>
     1428            <arg value="apps/BOB/src/:apps/addressbook/java/src/:apps/i2psnark/java/src/:apps/i2ptunnel/java/src/:apps/ministreaming/java/src/:apps/routerconsole/java/src/:apps/sam/java/src/:apps/streaming/java/src/:apps/susidns/src/java/src/:apps/susimail/src/src/:apps/systray/java/src/:core/java/src/:router/java/src/:installer/java/src"/>
    13501429            <!-- start of the files to be analyzed -->
    13511430            <arg value="build/BOB.jar"/>
     
    13661445            <arg value="build/susimail.war"/>
    13671446            <arg value="build/systray.jar"/>
     1447            <arg value="build/utility.jar"/>
    13681448        </exec>
    13691449        <echo message="Findbugs output stored in i2p.fba" />
     
    15561636                <pathelement location="build/i2psnark.jar" />
    15571637            </classpath>
    1558             <arg value="i2pupdate_${release.number}.sud" />
     1638            <arg value="i2pupdate-${release.number}.sud" />
     1639            <arg value="http://tracker2.postman.i2p/announce.php" />
    15591640        </java>
    15601641        <copy file="i2pupdate.su2" tofile="i2pupdate-${release.number}.su2" />
     
    15641645                <pathelement location="build/i2psnark.jar" />
    15651646            </classpath>
    1566             <arg value="i2pupdate_${release.number}.su2" />
     1647            <arg value="i2pupdate-${release.number}.su2" />
     1648            <arg value="http://tracker2.postman.i2p/announce.php" />
    15671649        </java>
    15681650        <echo message="Don't forget to mtn tag w: i2p-${release.number}" />
     
    15701652    </target>
    15711653
    1572     <target name="debian" depends="debian-clean, debian-binary" />
    1573 
    1574     <target name="debian-binary" >
    1575         <echo message="Did you update the version using dch -i?" />
    1576         <echo message=" " />
    1577         <echo message="If the changelog was not updated with dch -i, press" />
    1578         <echo message="press CTRL+C to abort building this Debian package." />
    1579         <echo message="" />
    1580         <echo message="Pausing build for ten seconds to give enough time to read this notice." />
    1581         <exec executable="sleep" failonerror="true">
    1582                 <arg value="10" />
    1583         </exec>
    1584         <echo message="====================" />
    1585 
     1654    <target name="debian" depends="debian-clean, debchange, debian-binary" />
     1655
     1656    <target name="getExtendedVersion" depends="buildProperties, trimMtnRev">
     1657        <property name="MtnShortHash" value="unknown" />
     1658        <condition property="Extended.Version" value="${full.version}-${MtnShortHash}">
     1659            <not>
     1660                <or>
     1661                    <equals arg1="${MtnShortHash}" arg2="" />
     1662                    <equals arg1="${MtnShortHash}" arg2="unknown" />
     1663                </or>
     1664            </not>
     1665        </condition>
     1666        <!-- if not set above we'll set it here -->
     1667        <property name="Extended.Version" value="${full.version}" />
     1668    </target>
     1669
     1670    <target name="debchange" depends="getExtendedVersion" unless="noAutoDebchange">
     1671        <echo message= "Debian version is ${Extended.Version}-1" />
     1672        <exec executable="dch" failonerror="true">
     1673            <arg value="-b" />
     1674            <arg value="--check-dirname-level" />
     1675            <arg value="0" />
     1676            <arg value="-v" />
     1677            <arg value="${Extended.Version}-1" />
     1678            <arg value="Unofficial Debian package built using &quot;ant debian&quot;" />
     1679        </exec>
     1680    </target>
     1681
     1682    <target name="debian-binary" depends="getExtendedVersion">
    15861683        <exec executable="fakeroot" failonerror="true">
    15871684            <arg value="debian/rules" />
     
    15911688        </exec>
    15921689        <delete dir=".pc" />
    1593     </target>
    1594 
    1595     <target name="debian-clean" depends="buildProperties" >
     1690        <move todir=".">
     1691            <fileset dir=".." includes="libjbigi*${release.number}*.deb i2p*${release.number}*.deb" />
     1692        </move>
     1693        <echo message="" />
     1694        <echo message="====================" />
     1695        <echo message="Packages have been built and moved to ${basedir}" />
     1696        <echo message="====================" />
     1697    </target>
     1698
     1699    <target name="debian-clean" depends="getExtendedVersion" >
    15961700        <exec executable="fakeroot" failonerror="true">
    15971701            <arg value="debian/rules" />
     
    16011705    </target>
    16021706
    1603     <target name="debian-patch" depends="buildProperties" >
     1707    <target name="debian-tarball" depends="getExtendedVersion">
     1708        <!-- will this use the monotonerc file in the current workspace? -->
     1709        <fail message="This target cannot be used without Monotone! Use &quot;fakeroot debian/rules get-orig-source&quot; instead.">
     1710            <condition>
     1711                <not>
     1712                    <isset property="mtn.available" />
     1713                </not>
     1714            </condition>
     1715        </fail>
     1716        <property name="debian.tarball.name" value="i2p_${Extended.Version}.orig.tar.bz2" />
     1717        <echo message="Checking out fresh copy into ../i2p-${Extended.Version} for tarballing:" />
     1718        <delete dir="../i2p-${Extended.Version}" />
     1719        <exec executable="mtn" failonerror="true">
     1720            <arg value="co" />
     1721            <arg value="-b" />
     1722            <arg value="i2p.i2p" />
     1723            <!-- w: is the revision of the current workspace -->
     1724            <arg value="-r" />
     1725            <arg value="w:" />
     1726            <arg value="../i2p-${Extended.Version}" />
     1727        </exec>
     1728        <delete includeemptydirs="true" quiet="false">
     1729            <fileset dir="../i2p-${Extended.Version}/installer/lib/" />
     1730            <fileset dir="../i2p-${Extended.Version}/Slackware" />
     1731            <fileset dir="../i2p-${Extended.Version}/_MTN" />
     1732        </delete>
     1733        <tar longfile="gnu" destfile="../${debian.tarball.name}" compression="bzip2">
     1734            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}">
     1735                <include name="**/**" />
     1736                <exclude name="debian/**"/>
     1737                <exclude name="**/*.sh"/>
     1738            </tarfileset>
     1739            <tarfileset dir="../i2p-${Extended.Version}" prefix="/i2p-${Extended.Version}" filemode="755">
     1740                <exclude name="debian/**" />
     1741                <include name="**/*.sh" />
     1742            </tarfileset>
     1743        </tar>
     1744    </target>
     1745
     1746    <target name="debian-patch" depends="getExtendedVersion" >
    16041747        <exec executable="quilt" failonerror="true">
    16051748            <arg value="-a" />
Note: See TracChangeset for help on using the changeset viewer.