| 1 | <?xml version="1.0"?> |
|---|
| 2 | <!-- WARNING: Eclipse auto-generated file. |
|---|
| 3 | Any modifications will be overwritten. |
|---|
| 4 | To include a user specific buildfile here, simply create one in the same |
|---|
| 5 | directory with the processing instruction <?eclipse.ant.import?> |
|---|
| 6 | as the first entry and export the buildfile again. --> |
|---|
| 7 | <project name="p2pproxy" default="build" basedir="."> |
|---|
| 8 | <property environment="env"/> |
|---|
| 9 | <property name="junit.output.dir" value="junit"/> |
|---|
| 10 | <property name="debuglevel" value="source,lines,vars"/> |
|---|
| 11 | <property name="target" value="1.5"/> |
|---|
| 12 | <property name="source" value="1.5"/> |
|---|
| 13 | <property name="seeding-address" value="tcp://localhost:9701"/> |
|---|
| 14 | <property name="public-address" value="127.0.0.1"/> |
|---|
| 15 | <property name="public-address-user" value="root"/> |
|---|
| 16 | <property name="version" value="0.1"/> |
|---|
| 17 | <property name="jxta-src" location="dependencies-src/jxse-src-2.5"/> |
|---|
| 18 | <property name="dist.dir" location="antbuild/dist/p2pproxy_${version}"/> |
|---|
| 19 | |
|---|
| 20 | <path id="p2pproxy.classpath"> |
|---|
| 21 | <pathelement location="antbuild/p2pproxy"/> |
|---|
| 22 | <pathelement location="dependencies/log4j.jar"/> |
|---|
| 23 | <pathelement location="dependencies/sip.jar"/> |
|---|
| 24 | <pathelement location="dependencies/bcprov-jdk14.jar"/> |
|---|
| 25 | <pathelement location="dependencies/junit-4.3.1.jar"/> |
|---|
| 26 | <pathelement location="dependencies/javax.servlet.jar"/> |
|---|
| 27 | <pathelement location="dependencies/org.mortbay.jetty.jar"/> |
|---|
| 28 | </path> |
|---|
| 29 | <target name="init"> |
|---|
| 30 | <mkdir dir="antbuild"/> |
|---|
| 31 | <mkdir dir="antbuild/p2pproxy"/> |
|---|
| 32 | <mkdir dir="antbuild/p2pproxy-tester"/> |
|---|
| 33 | <mkdir dir="${dist.dir}"/> |
|---|
| 34 | <mkdir dir="antbuild/META-INF"/> |
|---|
| 35 | <copy todir="antbuild" includeemptydirs="false"> |
|---|
| 36 | <fileset dir="src" excludes="**/*.launch, **/*.java"/> |
|---|
| 37 | </copy> |
|---|
| 38 | </target> |
|---|
| 39 | <target name="clean"> |
|---|
| 40 | <delete dir="antbuild"/> |
|---|
| 41 | </target> |
|---|
| 42 | <target name="cleanall" depends="clean"/> |
|---|
| 43 | <target name="build" depends="build-subprojects,build-project"/> |
|---|
| 44 | <target name="build-subprojects"/> |
|---|
| 45 | |
|---|
| 46 | <target name="build-project" depends="init"> |
|---|
| 47 | <echo message="${ant.project.name}: ${ant.file}"/> |
|---|
| 48 | |
|---|
| 49 | <javac destdir="antbuild/p2pproxy" debug="true" debuglevel="${debuglevel}" source="${source}" target="${target}"> |
|---|
| 50 | <src path="src"/> |
|---|
| 51 | <src path="${jxta-src}/api/src"/> |
|---|
| 52 | <src path="${jxta-src}/impl/src"/> |
|---|
| 53 | <exclude name="**/*Tester.java"/> |
|---|
| 54 | <classpath refid="p2pproxy.classpath"/> |
|---|
| 55 | </javac> |
|---|
| 56 | <copy todir="antbuild/p2pproxy"> |
|---|
| 57 | <fileset dir="${jxta-src}/impl/src"> |
|---|
| 58 | <include name="**/*.properties"/> |
|---|
| 59 | <include name="META-INF/**/*"/> |
|---|
| 60 | </fileset> |
|---|
| 61 | </copy> |
|---|
| 62 | <copy todir="antbuild/p2pproxy"> |
|---|
| 63 | <fileset dir="${jxta-src}/api/src"> |
|---|
| 64 | <include name="**/*.properties"/> |
|---|
| 65 | </fileset> |
|---|
| 66 | </copy> |
|---|
| 67 | <javac destdir="antbuild/p2pproxy-tester" debug="true" debuglevel="${debuglevel}" source="${source}" target="${target}"> |
|---|
| 68 | <src path="test-src"/> |
|---|
| 69 | <!-- include api for Class loader isolation --> |
|---|
| 70 | <!--src path="${jxta-src}/api/src"/--> |
|---|
| 71 | <!--include name="**/*Tester.java"/--> |
|---|
| 72 | <!--include name="**/*Tester.java"/--> |
|---|
| 73 | <src path="src"/> |
|---|
| 74 | <include name="**/*.java"/> |
|---|
| 75 | <include name="org/linphone/p2pproxy/api/P2pProxyInstance.java"/> |
|---|
| 76 | <exclude name="org/linphone/p2pproxy/core/**/*.java"/> |
|---|
| 77 | <classpath refid="p2pproxy.classpath"/> |
|---|
| 78 | </javac> |
|---|
| 79 | </target> |
|---|
| 80 | |
|---|
| 81 | <target name="build-refprojects" description="Build all projects which reference this project. Useful to propagate changes."/> |
|---|
| 82 | <target name="P2pProxyMain-relay"> |
|---|
| 83 | <java fork="yes" classname="org.linphone.p2pproxy.core.P2pProxyMain" failonerror="true"> |
|---|
| 84 | <jvmarg value="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"/> |
|---|
| 85 | <arg value="-jxta"/> |
|---|
| 86 | <arg path="${user.home}/relay"/> |
|---|
| 87 | <arg line="-sip 5041 -relay -seeding-relay ${seeding-address} -seeding-rdv ${seeding-address}"/> |
|---|
| 88 | <classpath refid="p2pproxy.classpath"/> |
|---|
| 89 | </java> |
|---|
| 90 | </target> |
|---|
| 91 | <target name="P2pProxyMain-edge"> |
|---|
| 92 | <java fork="yes" classname="org.linphone.p2pproxy.core.P2pProxyMain" failonerror="true"> |
|---|
| 93 | <jvmarg value="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"/> |
|---|
| 94 | <arg value="-jxta"/> |
|---|
| 95 | <arg path="${user.home}/edge"/> |
|---|
| 96 | <arg line="-sip 5042 -edge-only -seeding-relay ${seeding-address} -seeding-rdv ${seeding-address}"/> |
|---|
| 97 | <classpath refid="p2pproxy.classpath"/> |
|---|
| 98 | </java> |
|---|
| 99 | </target> |
|---|
| 100 | <target name="junit-test"> |
|---|
| 101 | <junit printsummary="withOutAndErr" haltonfailure="no" showoutput="yes" fork="yes"> |
|---|
| 102 | <jvmarg value="-Xdebug"/> |
|---|
| 103 | <jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"/> |
|---|
| 104 | <formatter type="plain" /> |
|---|
| 105 | <classpath> |
|---|
| 106 | <pathelement location="dependencies/junit-4.3.1.jar" /> |
|---|
| 107 | <pathelement location="antbuild/p2pproxy-tester" /> |
|---|
| 108 | <pathelement location="dependencies/log4j.jar"/> |
|---|
| 109 | <pathelement location="dependencies/sip.jar"/> |
|---|
| 110 | </classpath> |
|---|
| 111 | <batchtest> |
|---|
| 112 | <fileset dir="antbuild/p2pproxy-tester"> |
|---|
| 113 | <include name="org/linphone/p2pproxy/test/P2pProxyNetworkingTester.class" /> |
|---|
| 114 | <!--include name="org/linphone/p2pproxy/test/P2pProxyNatedNetworkTester.class" /--> |
|---|
| 115 | </fileset> |
|---|
| 116 | </batchtest> |
|---|
| 117 | </junit> |
|---|
| 118 | </target> |
|---|
| 119 | <target name="junit-test-nat"> |
|---|
| 120 | <junit printsummary="withOutAndErr" haltonfailure="no" showoutput="yes" fork="yes"> |
|---|
| 121 | <jvmarg value="-Xdebug"/> |
|---|
| 122 | <jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"/> |
|---|
| 123 | <jvmarg value="-Dp2pproxy.publicAddress=${public-address}"/> |
|---|
| 124 | <jvmarg value="-Dp2pproxy.publicAddressUser=${public-address-user}"/> |
|---|
| 125 | <formatter type="plain" /> |
|---|
| 126 | <classpath> |
|---|
| 127 | <pathelement location="dependencies/junit-4.3.1.jar" /> |
|---|
| 128 | <pathelement location="antbuild/p2pproxy-tester" /> |
|---|
| 129 | <pathelement location="dependencies/log4j.jar"/> |
|---|
| 130 | <pathelement location="dependencies/sip.jar"/> |
|---|
| 131 | </classpath> |
|---|
| 132 | <batchtest> |
|---|
| 133 | <fileset dir="antbuild/p2pproxy-tester"> |
|---|
| 134 | <include name="org/linphone/p2pproxy/test/P2pProxyNatedNetworkTester.class" /> |
|---|
| 135 | </fileset> |
|---|
| 136 | </batchtest> |
|---|
| 137 | </junit> |
|---|
| 138 | </target> |
|---|
| 139 | |
|---|
| 140 | <target name="junitreport"> |
|---|
| 141 | <junitreport todir="${junit.output.dir}"> |
|---|
| 142 | <fileset dir="${junit.output.dir}"> |
|---|
| 143 | <include name="TEST-*.xml"/> |
|---|
| 144 | </fileset> |
|---|
| 145 | <report format="frames" todir="${junit.output.dir}"/> |
|---|
| 146 | </junitreport> |
|---|
| 147 | </target> |
|---|
| 148 | <target name="dist" depends="build-project"> |
|---|
| 149 | <!--prep--> |
|---|
| 150 | <copy todir="${dist.dir}"> |
|---|
| 151 | <fileset dir="dependencies"> |
|---|
| 152 | <include name="*"/> |
|---|
| 153 | </fileset> |
|---|
| 154 | </copy> |
|---|
| 155 | |
|---|
| 156 | <copy file="log4j.properties" tofile="${dist.dir}/log4j.properties"/> |
|---|
| 157 | <copy file="bin/p2pproxy.sh" tofile="${dist.dir}/p2pproxy.sh"/> |
|---|
| 158 | <copy file="bin/p2pproxy.bat" tofile="${dist.dir}/p2pproxy.bat"/> |
|---|
| 159 | <copy file="bin/p2pproxy-cmd.sh" tofile="${dist.dir}/p2pproxy-cmd.sh"/> |
|---|
| 160 | <copy file="bin/p2pproxy-cmd.bat" tofile="${dist.dir}/p2pproxy-cmd.bat"/> |
|---|
| 161 | |
|---|
| 162 | <fixcrlf srcdir="${dist.dir}" includes="*.sh" |
|---|
| 163 | eol="lf" eof="remove" /> |
|---|
| 164 | <fixcrlf srcdir="${dist.dir}" |
|---|
| 165 | includes="*.bat" eol="crlf" /> |
|---|
| 166 | <chmod file="${dist.dir}/*.sh" perm="ugo+rx"/> |
|---|
| 167 | |
|---|
| 168 | <!-- build jar--> |
|---|
| 169 | <jar jarfile="${dist.dir}/p2pproxy.jar" basedir="antbuild/p2pproxy"/> |
|---|
| 170 | |
|---|
| 171 | <manifest file="antbuild/META-INF/MANIFEST.MF"> |
|---|
| 172 | <attribute name="Built-By" value="${user.name}"/> |
|---|
| 173 | <attribute name="Main-Class" value="org.linphone.p2pproxy.core.P2pProxyMain"/> |
|---|
| 174 | <attribute name="Class-Path" value="log4j.jar bcprov-jdk14.jar javax.servlet.jar org.mortbay.jetty.jar sip.jar"/> |
|---|
| 175 | </manifest> |
|---|
| 176 | <!-- put manifest --> |
|---|
| 177 | <jar jarfile="${dist.dir}/p2pproxy.jar" compress="false" keepcompression="true" update="true" manifest="antbuild/META-INF/MANIFEST.MF"/> |
|---|
| 178 | |
|---|
| 179 | <zip destfile="antbuild/p2pproxy_${version}.zip" basedir="antbuild/dist" /> |
|---|
| 180 | |
|---|
| 181 | </target> |
|---|
| 182 | </project> |
|---|