commit 40d3d39361d513c083aa0f871afc518371e18be5 Author: iwakeh iwakeh@torproject.org Date: Tue Nov 1 09:37:39 2016 +0100
Some changes toward the standard metrics-project layout. Switch to java 7 and metrics-lib 1.5.0. connectbiderect not adapted. --- modules/advbwdist/build.xml | 29 +++++-------------------- modules/clients/build.xml | 29 +++++-------------------- modules/collectdescs/build.xml | 31 +++++---------------------- modules/hidserv/build.xml | 31 ++++++--------------------- modules/legacy/build.xml | 36 ++++++------------------------- shared/build-base.xml | 48 ++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 76 insertions(+), 128 deletions(-)
diff --git a/modules/advbwdist/build.xml b/modules/advbwdist/build.xml index 3f9d3cb..9aa187f 100644 --- a/modules/advbwdist/build.xml +++ b/modules/advbwdist/build.xml @@ -1,36 +1,17 @@ <project default="run" name="advbwdist" basedir=".">
- <property name="sources" value="src"/> - <property name="libs" value="../../shared/lib"/> - <property name="classes" value="classes"/> + <include file="../../shared/build-base.xml" as="basetask"/> + <target name="clean" depends="basetask.clean"/> + <target name="compile" depends="basetask.compile"/> + <path id="classpath"> <pathelement path="${classes}"/> + <path refid="base.classpath" /> <fileset dir="${libs}"> <include name="commons-codec-1.9.jar"/> - <include name="commons-compress-1.9.jar"/> - <include name="commons-lang-2.6.jar"/> - <include name="descriptor-1.4.0.jar"/> - <include name="slf4j-api-1.7.7.jar"/> - <include name="logback-core-1.1.2.jar"/> - <include name="logback-classic-1.1.2.jar"/> </fileset> </path>
- <target name="compile"> - <mkdir dir="${classes}"/> - <javac destdir="${classes}" - srcdir="${sources}" - source="1.5" - target="1.5" - debug="true" - deprecation="true" - optimize="false" - failonerror="true" - includeantruntime="false"> - <classpath refid="classpath"/> - </javac> - </target> - <target name="run" depends="compile"> <java fork="true" maxmemory="1024m" diff --git a/modules/clients/build.xml b/modules/clients/build.xml index 64ff6dc..eb2d6e2 100644 --- a/modules/clients/build.xml +++ b/modules/clients/build.xml @@ -1,36 +1,17 @@ <project default="run" name="clients" basedir=".">
- <property name="sources" value="src"/> - <property name="libs" value="../../shared/lib"/> - <property name="classes" value="classes"/> + <include file="../../shared/build-base.xml" as="basetask"/> + <target name="clean" depends="basetask.clean"/> + <target name="compile" depends="basetask.compile"/> + <path id="classpath"> <pathelement path="${classes}"/> + <path refid="base.classpath" /> <fileset dir="${libs}"> <include name="commons-codec-1.9.jar"/> - <include name="commons-compress-1.9.jar"/> - <include name="commons-lang-2.6.jar"/> - <include name="descriptor-1.4.0.jar"/> - <include name="slf4j-api-1.7.7.jar"/> - <include name="logback-core-1.1.2.jar"/> - <include name="logback-classic-1.1.2.jar"/> </fileset> </path>
- <target name="compile"> - <mkdir dir="${classes}"/> - <javac destdir="${classes}" - srcdir="${sources}" - source="1.6" - target="1.6" - debug="true" - deprecation="true" - optimize="false" - failonerror="true" - includeantruntime="false"> - <classpath refid="classpath"/> - </javac> - </target> - <target name="run" depends="compile"> <java fork="true" maxmemory="2g" diff --git a/modules/collectdescs/build.xml b/modules/collectdescs/build.xml index 974a60b..7c7eb0f 100644 --- a/modules/collectdescs/build.xml +++ b/modules/collectdescs/build.xml @@ -1,35 +1,14 @@ <project default="run" name="collectdescs" basedir=".">
- <property name="sources" value="src"/> - <property name="libs" value="../../shared/lib"/> - <property name="classes" value="classes"/> + <include file="../../shared/build-base.xml" as="basetask"/> + <target name="clean" depends="basetask.clean"/> + <target name="compile" depends="basetask.compile"/> + <path id="classpath"> <pathelement path="${classes}"/> - <fileset dir="${libs}"> - <include name="commons-compress-1.9.jar"/> - <include name="commons-lang-2.6.jar"/> - <include name="descriptor-1.4.0.jar"/> - <include name="slf4j-api-1.7.7.jar"/> - <include name="logback-core-1.1.2.jar"/> - <include name="logback-classic-1.1.2.jar"/> - </fileset> + <path refid="base.classpath" /> </path>
- <target name="compile"> - <mkdir dir="${classes}"/> - <javac destdir="${classes}" - srcdir="${sources}" - source="1.6" - target="1.6" - debug="true" - deprecation="true" - optimize="false" - failonerror="true" - includeantruntime="false"> - <classpath refid="classpath"/> - </javac> - </target> - <target name="run" depends="compile"> <java fork="true" classname="org.torproject.metrics.collectdescs.Main"> diff --git a/modules/hidserv/build.xml b/modules/hidserv/build.xml index 4c8729c..fe073a1 100644 --- a/modules/hidserv/build.xml +++ b/modules/hidserv/build.xml @@ -1,37 +1,18 @@ <project default="run" name="hidserv" basedir=".">
- <property name="sources" value="src"/> - <property name="libs" value="../../shared/lib"/> - <property name="classes" value="classes"/> + <include file="../../shared/build-base.xml" as="basetask"/> + <target name="clean" depends="basetask.clean"/> + <target name="compile" depends="basetask.compile"/> + <path id="classpath"> <pathelement path="${classes}"/> + <path refid="base.classpath" /> <fileset dir="${libs}"> <include name="commons-codec-1.9.jar"/> - <include name="commons-compress-1.9.jar"/> - <include name="commons-lang-2.6.jar"/> - <include name="descriptor-1.4.0.jar"/> - <include name="slf4j-api-1.7.7.jar"/> - <include name="logback-core-1.1.2.jar"/> - <include name="logback-classic-1.1.2.jar"/> </fileset> </path>
- <target name="compile"> - <mkdir dir="${classes}"/> - <javac destdir="${classes}" - srcdir="${sources}" - source="1.6" - target="1.6" - debug="true" - deprecation="true" - optimize="false" - failonerror="true" - includeantruntime="false"> - <classpath refid="classpath"/> - </javac> - </target> - - <target name="run" depends="compile"> + <target name="run" depends="basetask.compile"> <java fork="true" maxmemory="1024m" classname="org.torproject.metrics.hidserv.Main"> diff --git a/modules/legacy/build.xml b/modules/legacy/build.xml index 07ca673..252a712 100644 --- a/modules/legacy/build.xml +++ b/modules/legacy/build.xml @@ -1,47 +1,25 @@ <project default="run" name="metrics-web" basedir=".">
- <!-- Define build paths. --> - <property name="sources" value="src"/> - <property name="libs" value="../../shared/lib"/> - <property name="classes" value="classes"/> - <property name="config" value="etc"/> + <include file="../../shared/build-base.xml" as="basetask"/> + <target name="clean" depends="basetask.clean"/> + <target name="compile" depends="basetask.compile"/> + <path id="classpath"> <pathelement path="${classes}"/> + <path refid="base.classpath" /> <fileset dir="${libs}"> <include name="commons-codec-1.9.jar"/> - <include name="commons-compress-1.9.jar"/> <include name="postgresql-jdbc3-9.2.jar"/> - <include name="commons-lang-2.6.jar"/> - <include name="descriptor-1.4.0.jar"/> - <include name="logback-classic-1.1.2.jar"/> - <include name="logback-core-1.1.2.jar"/> - <include name="slf4j-api-1.7.7.jar"/> </fileset> </path>
<!-- Prepare build. --> - <target name="init"> + <target name="init" depends="basetask.init" > <copy file="config.template" tofile="config"/> - <mkdir dir="${classes}"/> - </target> - - <!-- Compile all plain Java classes. --> - <target name="compile" depends="init"> - <javac destdir="${classes}" - srcdir="${sources}" - source="1.5" - target="1.5" - debug="true" - deprecation="true" - optimize="false" - failonerror="true" - includeantruntime="false"> - <classpath refid="classpath"/> - </javac> </target>
<!-- Prepare data for being displayed on the website. --> - <target name="run" depends="compile"> + <target name="run" depends="compile,init"> <java fork="true" maxmemory="2g" classname="org.torproject.ernie.cron.Main"> diff --git a/shared/build-base.xml b/shared/build-base.xml new file mode 100644 index 0000000..cdf4e86 --- /dev/null +++ b/shared/build-base.xml @@ -0,0 +1,48 @@ +<project basedir="."> + + <property name="sources" value="src"/> + <property name="libs" value="../../shared/lib"/> + <property name="generated" value="generated"/> + <property name="classes" value="${generated}/classes/"/> + <property name="source-and-target-java-version" value="1.7" /> + <property name="descriptorversion" value="1.5.0" /> + + <path id="base.classpath"> + <pathelement path="${classes}"/> + <fileset dir="${libs}"> + <include name="commons-compress-1.9.jar"/> + <include name="commons-lang-2.6.jar"/> + <include name="descriptor-${descriptorversion}.jar"/> + <include name="slf4j-api-1.7.7.jar"/> + <include name="logback-core-1.1.2.jar"/> + <include name="logback-classic-1.1.2.jar"/> + </fileset> + </path> + + <target name="clean"> + <delete includeEmptyDirs="true" quiet="true"> + <fileset dir="${generated}" defaultexcludes="false" includes="**" /> + </delete> + </target> + + <target name="init"> + <mkdir dir="${classes}"/> + </target> + + <target name="compile" depends="init" > + <javac destdir="${classes}" + srcdir="${sources}" + source="${source-and-target-java-version}" + target="${source-and-target-java-version}" + debug="true" debuglevel="lines,source" + deprecation="true" + optimize="false" + failonerror="true" + includeantruntime="false"> + <classpath refid="classpath"/> + </javac> + </target> + + +</project> +
tor-commits@lists.torproject.org