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

[tor-commits] [metrics-web/master] Add ant task for advbwdist run.



commit 6056b8c800f5a01d3f79514e7e8e1ba62b379179
Author: iwakeh <iwakeh@xxxxxxxxxxxxxx>
Date:   Mon Dec 4 11:14:25 2017 +0000

    Add ant task for advbwdist run.
    
    Move related sources to main src tree,
    delete old build.xml and shell script;
    add ant helper task for running R scripts.
---
 build.xml                                           | 21 +++++++++++++++++++++
 modules/advbwdist/.gitignore                        |  4 ----
 modules/advbwdist/build.xml                         | 11 -----------
 shared/bin/60-run-advbwdist-stats.sh                |  6 ------
 {modules => src/main/R}/advbwdist/aggregate.R       |  0
 .../java/org/torproject/metrics/advbwdist/Main.java |  0
 6 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/build.xml b/build.xml
index 51596b6..3095512 100644
--- a/build.xml
+++ b/build.xml
@@ -96,6 +96,14 @@
     <antcall target="run-java" />
   </target>
 
+  <target name="advbwdist">
+    <property name="module.name" value="advbwdist" />
+    <antcall target="run-java" />
+    <antcall target="run-R" >
+      <param name="module.Rscript" value="aggregate.R" />
+    </antcall>
+  </target>
+
   <target name="hidserv" >
     <property name="module.name" value="hidserv" />
     <antcall target="run-java" />
@@ -138,6 +146,19 @@
     </java>
   </target>
 
+  <target name="run-R" >
+    <echo message="Running R module ${module.name}, script ${module.Rscript} ... " />
+    <property name="Rscript"
+              value="${Rsources}/${module.name}/${module.Rscript}" />
+    <exec executable="R"
+          dir="${modulebase}/${module.name}"
+          failonerror="true" >
+      <arg value="--slave"/>
+      <arg value="-f"/>
+      <arg value="${Rscript}" />
+    </exec>
+  </target>
+
   <!-- The following line adds the common targets and properties
        for Metrics' Java Projects.
   -->
diff --git a/modules/advbwdist/.gitignore b/modules/advbwdist/.gitignore
deleted file mode 100644
index 4bb76a5..0000000
--- a/modules/advbwdist/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-classes/
-stats/
-status/
-
diff --git a/modules/advbwdist/build.xml b/modules/advbwdist/build.xml
deleted file mode 100644
index 9a95bbf..0000000
--- a/modules/advbwdist/build.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<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"/>
-
-</project>
-
diff --git a/shared/bin/60-run-advbwdist-stats.sh b/shared/bin/60-run-advbwdist-stats.sh
deleted file mode 100755
index a06e848..0000000
--- a/shared/bin/60-run-advbwdist-stats.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-cd modules/advbwdist/
-ant | grep "\[java\]"
-R --slave -f aggregate.R
-cd ../../
-
diff --git a/modules/advbwdist/aggregate.R b/src/main/R/advbwdist/aggregate.R
similarity index 100%
rename from modules/advbwdist/aggregate.R
rename to src/main/R/advbwdist/aggregate.R
diff --git a/modules/advbwdist/src/main/java/org/torproject/metrics/advbwdist/Main.java b/src/main/java/org/torproject/metrics/advbwdist/Main.java
similarity index 100%
rename from modules/advbwdist/src/main/java/org/torproject/metrics/advbwdist/Main.java
rename to src/main/java/org/torproject/metrics/advbwdist/Main.java



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