[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [metrics-web/master] Reduce build redundancy.



commit 5c2b1f5ca68800117d1d3a047b2dafa6f46c2ea1
Author: iwakeh <iwakeh@xxxxxxxxxxxxxx>
Date:   Thu Feb 23 13:30:27 2017 +0000

    Reduce build redundancy.
---
 modules/advbwdist/build.xml    | 15 +++------------
 modules/clients/build.xml      | 18 +++---------------
 modules/collectdescs/build.xml | 14 +++-----------
 modules/connbidirect/build.xml | 15 +++------------
 modules/hidserv/build.xml      | 15 +++------------
 modules/legacy/build.xml       | 15 +++++----------
 modules/webstats/build.xml     | 10 +++-------
 shared/build-base.xml          | 13 +++++++++++++
 8 files changed, 36 insertions(+), 79 deletions(-)

diff --git a/modules/advbwdist/build.xml b/modules/advbwdist/build.xml
index 0493d8a..9a95bbf 100644
--- a/modules/advbwdist/build.xml
+++ b/modules/advbwdist/build.xml
@@ -1,20 +1,11 @@
 <project default="run" name="advbwdist" basedir=".">
 
+  <property name="mainclass" value="org.torproject.metrics.advbwdist.Main"/>
+
   <include file="../../shared/build-base.xml" as="basetask"/>
   <target name="clean" depends="basetask.clean"/>
   <target name="compile" depends="basetask.compile"/>
+  <target name="run" depends="basetask.run"/>
 
-  <path id="classpath">
-    <pathelement path="${classes}"/>
-    <path refid="base.classpath" />
-  </path>
-
-  <target name="run" depends="compile">
-    <java fork="true"
-          maxmemory="1024m"
-          classname="org.torproject.metrics.advbwdist.Main">
-      <classpath refid="classpath"/>
-    </java>
-  </target>
 </project>
 
diff --git a/modules/clients/build.xml b/modules/clients/build.xml
index eb2d6e2..f67bdae 100644
--- a/modules/clients/build.xml
+++ b/modules/clients/build.xml
@@ -1,23 +1,11 @@
 <project default="run" name="clients" basedir=".">
 
+  <property name="mainclass" value="org.torproject.metrics.clients.Main"/>
+
   <include file="../../shared/build-base.xml" as="basetask"/>
   <target name="clean" depends="basetask.clean"/>
   <target name="compile" depends="basetask.compile"/>
+  <target name="run" depends="basetask.run"/>
 
-  <path id="classpath">
-    <pathelement path="${classes}"/>
-    <path refid="base.classpath" />
-    <fileset dir="${libs}">
-      <include name="commons-codec-1.9.jar"/>
-    </fileset>
-  </path>
-
-  <target name="run" depends="compile">
-    <java fork="true"
-          maxmemory="2g"
-          classname="org.torproject.metrics.clients.Main">
-      <classpath refid="classpath"/>
-    </java>
-  </target>
 </project>
 
diff --git a/modules/collectdescs/build.xml b/modules/collectdescs/build.xml
index 7c7eb0f..1499df6 100644
--- a/modules/collectdescs/build.xml
+++ b/modules/collectdescs/build.xml
@@ -1,19 +1,11 @@
 <project default="run" name="collectdescs" basedir=".">
 
+  <property name="mainclass" value="org.torproject.metrics.collectdescs.Main"/>
+
   <include file="../../shared/build-base.xml" as="basetask"/>
   <target name="clean" depends="basetask.clean"/>
   <target name="compile" depends="basetask.compile"/>
+  <target name="run" depends="basetask.run"/>
 
-  <path id="classpath">
-    <pathelement path="${classes}"/>
-    <path refid="base.classpath" />
-  </path>
-
-  <target name="run" depends="compile">
-    <java fork="true"
-          classname="org.torproject.metrics.collectdescs.Main">
-      <classpath refid="classpath"/>
-    </java>
-  </target>
 </project>
 
diff --git a/modules/connbidirect/build.xml b/modules/connbidirect/build.xml
index 7bc1f32..4c9c1f4 100644
--- a/modules/connbidirect/build.xml
+++ b/modules/connbidirect/build.xml
@@ -1,22 +1,13 @@
 <project default="run" name="connbidirect" basedir=".">
 
+  <property name="mainclass" value="org.torproject.metrics.connbidirect.Main"/>
+
   <include file="../../shared/build-base.xml" as="basetask"/>
   <target name="clean" depends="basetask.clean"/>
   <target name="compile" depends="basetask.compile"/>
   <target name="testcompile" depends="basetask.testcompile"/>
   <target name="test" depends="basetask.test"/>
+  <target name="run" depends="basetask.run"/>
 
-  <path id="classpath">
-    <pathelement path="${classes}"/>
-    <path refid="base.classpath" />
-  </path>
-
-  <target name="run" depends="compile">
-    <java fork="true"
-          maxmemory="2g"
-          classname="org.torproject.metrics.connbidirect.Main">
-      <classpath refid="classpath"/>
-    </java>
-  </target>
 </project>
 
diff --git a/modules/hidserv/build.xml b/modules/hidserv/build.xml
index c997161..2a26ea2 100644
--- a/modules/hidserv/build.xml
+++ b/modules/hidserv/build.xml
@@ -1,20 +1,11 @@
 <project default="run" name="hidserv" basedir=".">
 
+  <property name="mainclass" value="org.torproject.hidserv.Main"/>
+
   <include file="../../shared/build-base.xml" as="basetask"/>
   <target name="clean" depends="basetask.clean"/>
   <target name="compile" depends="basetask.compile"/>
+  <target name="run" depends="basetask.run"/>
 
-  <path id="classpath">
-    <pathelement path="${classes}"/>
-    <path refid="base.classpath" />
-  </path>
-
-  <target name="run" depends="basetask.compile">
-    <java fork="true"
-          maxmemory="1024m"
-          classname="org.torproject.metrics.hidserv.Main">
-      <classpath refid="classpath"/>
-    </java>
-  </target>
 </project>
 
diff --git a/modules/legacy/build.xml b/modules/legacy/build.xml
index f4ef8e7..bc2b674 100644
--- a/modules/legacy/build.xml
+++ b/modules/legacy/build.xml
@@ -1,8 +1,11 @@
 <project default="run" name="metrics-web" basedir=".">
 
+  <property name="mainclass" value="org.torproject.ernie.cron.Main"/>
+
   <include file="../../shared/build-base.xml" as="basetask"/>
   <target name="clean" depends="basetask.clean"/>
   <target name="compile" depends="basetask.compile"/>
+  <target name="run" depends="initrun,basetask.run"/>
 
   <path id="classpath">
     <pathelement path="${classes}"/>
@@ -12,18 +15,10 @@
     </fileset>
   </path>
 
-  <!-- Prepare build. -->
-  <target name="init" depends="basetask.init" >
+  <!-- Prepare run. -->
+  <target name="initrun" >
     <copy file="config.template" tofile="config"/>
   </target>
 
-  <!-- Prepare data for being displayed on the website. -->
-  <target name="run" depends="compile,init">
-    <java fork="true"
-          maxmemory="2g"
-          classname="org.torproject.ernie.cron.Main">
-      <classpath refid="classpath"/>
-    </java>
-  </target>
 </project>
 
diff --git a/modules/webstats/build.xml b/modules/webstats/build.xml
index 3c3291f..3a9f9f5 100644
--- a/modules/webstats/build.xml
+++ b/modules/webstats/build.xml
@@ -1,9 +1,12 @@
 <project default="run" name="webstats" basedir=".">
 
+  <property name="mainclass" value="org.torproject.metrics.webstats.Main"/>
+
   <include file="../../shared/build-base.xml" as="basetask"/>
   <target name="clean" depends="basetask.clean"/>
   <target name="compile" depends="basetask.compile"/>
   <target name="test" depends="basetask.test"/>
+  <target name="run" depends="basetask.run"/>
 
   <path id="classpath">
     <pathelement path="${classes}"/>
@@ -13,12 +16,5 @@
     </fileset>
   </path>
 
-  <target name="run" depends="compile">
-    <java fork="true"
-          maxmemory="1g"
-          classname="org.torproject.metrics.webstats.Main">
-      <classpath refid="classpath"/>
-    </java>
-  </target>
 </project>
 
diff --git a/shared/build-base.xml b/shared/build-base.xml
index e6c09de..35a8139 100644
--- a/shared/build-base.xml
+++ b/shared/build-base.xml
@@ -24,6 +24,11 @@
     </fileset>
   </path>
 
+  <path id="classpath">
+    <pathelement path="${classes}"/>
+    <path refid="base.classpath" />
+  </path>
+
   <path id="base.testclasspath">
     <pathelement path="${base.testclasses}"/>
     <pathelement path="base.classpath"/>
@@ -89,5 +94,13 @@
     </junit>
   </target>
 
+  <target name="run" depends="init,compile">
+    <java fork="true"
+          maxmemory="2g"
+          classname="${mainclass}">
+      <classpath refid="classpath"/>
+    </java>
+  </target>
+
 </project>
 

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits