[tor-commits] [metrics-web/master] Adapted build files, generate javadoc for submodules,
karsten at torproject.org
karsten at torproject.org
Thu Mar 30 08:42:11 UTC 2017
commit 76064b08ab73f04ff9d59b293af65bc6ef33e428
Author: iwakeh <iwakeh at torproject.org>
Date: Sun Mar 26 08:14:15 2017 +0000
Adapted build files, generate javadoc for submodules,
add metrics-lib javadoc to war, adapt link.
Implements task-21730 and prepares task-21551.
---
shared/build-base.xml | 1 +
website/build.xml | 91 ++++++++++++----------
.../src/main/resources/bootstrap-development.sh | 9 +++
website/src/main/resources/web-prepare.sh | 15 ++++
.../src/main/resources/web/WEB-INF/metrics-lib.jsp | 2 +-
5 files changed, 76 insertions(+), 42 deletions(-)
diff --git a/shared/build-base.xml b/shared/build-base.xml
index 35a8139..e9db803 100644
--- a/shared/build-base.xml
+++ b/shared/build-base.xml
@@ -1,6 +1,7 @@
<project basedir=".">
<property name="sources" value="src/main/java"/>
+ <property name="resources" value="src/main/resources"/>
<property name="testsources" value="src/test/java"/>
<property name="libs" value="../../shared/lib"/>
<property name="generated" value="generated"/>
diff --git a/website/build.xml b/website/build.xml
index 6204afe..8cd1060 100644
--- a/website/build.xml
+++ b/website/build.xml
@@ -2,63 +2,72 @@
<property name="libs" value="../shared/lib"/>
- <!-- Compile all servlets. -->
- <target name="compile">
- <mkdir dir="classes"/>
- <javac destdir="classes"
- srcdir="src"
- source="1.7"
- target="1.7"
- debug="true"
- deprecation="true"
- optimize="false"
- failonerror="true"
- includeantruntime="false">
- <classpath>
- <fileset dir="${libs}">
- <include name="commons-codec-1.9.jar"/>
- <include name="commons-lang-2.6.jar"/>
- <include name="postgresql-jdbc3-9.2.jar"/>
- <include name="servlet-api-3.0.jar"/>
- <include name="gson-2.2.4.jar"/>
- <include name="REngine.jar"/>
- <include name="Rserve.jar"/>
- </fileset>
- </classpath>
- </javac>
+ <include file="../shared/build-base.xml" as="basetask"/>
+ <target name="clean" depends="basetask.clean"/>
+ <target name="compile" depends="basetask.compile"/>
+
+ <patternset id="compile.libs" >
+ <include name="postgresql-jdbc3-9.2.jar"/>
+ <include name="REngine.jar"/>
+ <include name="Rserve.jar"/>
+ </patternset>
+
+ <patternset id="war.libs" >
+ <patternset refid="compile.libs" />
+ <include name="jstl1.1-1.1.2.jar"/>
+ <include name="standard-1.1.2.jar"/>
+ <include name="commons-codec-1.9.jar"/>
+ <include name="commons-lang-2.6.jar"/>
+ <include name="gson-2.2.4.jar"/>
+ </patternset>
+
+ <path id="classpath">
+ <pathelement path="${classes}"/>
+ <path refid="base.classpath" />
+ <fileset dir="${libs}">
+ <patternset refid="compile.libs" />
+ <include name="servlet-api-3.0.jar"/>
+ </fileset>
+ </path>
+
+ <target name="submoduleupdate" >
+ <exec executable="git" failonerror="false">
+ <arg value="submodule" />
+ <arg value="update" />
+ <arg value="--remote" />
+ <arg value="--merge" />
+ </exec>
</target>
<!-- Create a .war file for deployment. -->
<target name="war"
- depends="compile">
+ depends="submoduleupdate,compile">
+ <exec executable="src/main/resources/web-prepare.sh" >
+ <arg value="${basedir}/../submods" />
+ </exec>
<war destfile="metrics.war"
- webxml="etc/web.xml">
- <fileset dir="web"/>
+ webxml="${resources}/etc/web.xml">
+ <fileset dir="${resources}/web"/>
<lib dir="${libs}">
- <include name="jstl1.1-1.1.2.jar"/>
- <include name="REngine.jar"/>
- <include name="Rserve.jar"/>
- <include name="standard-1.1.2.jar"/>
- <include name="commons-codec-1.9.jar"/>
- <include name="commons-lang-2.6.jar"/>
- <include name="postgresql-jdbc3-9.2.jar"/>
- <include name="gson-2.2.4.jar"/>
+ <patternset refid="war.libs" />
</lib>
- <classes dir="classes"/>
- <zipfileset dir="etc"
+ <classes dir="${classes}"/>
+ <zipfileset dir="${resources}/etc"
prefix="WEB-INF/classes"
includes="logging.properties"/>
- <zipfileset dir="etc"
+ <zipfileset dir="${resources}/etc"
prefix="WEB-INF/classes"
includes="metrics.json"/>
- <zipfileset dir="etc"
+ <zipfileset dir="${resources}/etc"
prefix="WEB-INF/classes"
includes="categories.json"/>
- <zipfileset dir="etc"
+ <zipfileset dir="${resources}/etc"
prefix="WEB-INF/classes"
includes="news.json"/>
- <metainf dir="etc"
+ <metainf dir="${resources}/etc"
includes="context.xml"/>
+ <zipfileset dir="${basedir}/../submods/metrics-lib/generated/javadoc"
+ prefix="metrics-lib" />
</war>
</target>
</project>
diff --git a/website/src/main/resources/bootstrap-development.sh b/website/src/main/resources/bootstrap-development.sh
new file mode 100755
index 0000000..a99ebf2
--- /dev/null
+++ b/website/src/main/resources/bootstrap-development.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+#
+# Copyright 2017 The Tor Project
+# See LICENSE for licensing information
+#
+# Use for submodule initialization and checkout.
+# Only necessary after very first checkout without recursion.
+#
+git submodule update --init --remote
diff --git a/website/src/main/resources/web-prepare.sh b/website/src/main/resources/web-prepare.sh
new file mode 100755
index 0000000..2da4c4e
--- /dev/null
+++ b/website/src/main/resources/web-prepare.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+#
+# Expecting the submodule path as argument
+#
+
+cd $1
+
+for x in metrics-lib collector onionoo ; do
+ cd $1/$x
+ src/main/resources/bootstrap-development.sh
+ if ! [ -d lib ] ; then
+ mkdir lib
+ fi;
+ ant clean docs
+done;
diff --git a/website/src/main/resources/web/WEB-INF/metrics-lib.jsp b/website/src/main/resources/web/WEB-INF/metrics-lib.jsp
index 0dac339..3c74c9a 100644
--- a/website/src/main/resources/web/WEB-INF/metrics-lib.jsp
+++ b/website/src/main/resources/web/WEB-INF/metrics-lib.jsp
@@ -21,7 +21,7 @@
<p>metrics-lib is a Java API that facilitates processing Tor network data from the <a href="https://collector.torproject.org/">CollecTor</a> service for statistical analysis and for building services and applications.</p>
<a class="btn btn-primary btn-lg" style="margin: 10px" href="https://dist.torproject.org/descriptor/?C=M;O=D"><i class="fa fa-chevron-right" aria-hidden="true"></i> Download Release</a>
<a class="btn btn-primary btn-lg" style="margin: 10px" href="https://gitweb.torproject.org/metrics-lib.git/plain/CHANGELOG.md"><i class="fa fa-chevron-right" aria-hidden="true"></i> View Change Log</a>
-<!--<a class="btn btn-primary btn-lg" style="margin: 10px" href="javadoc/index.html"><i class="fa fa-chevron-right" aria-hidden="true"></i> Browse JavaDocs</a>-->
+<!--<a class="btn btn-primary btn-lg" style="margin: 10px" href="metrics-lib/javadoc/index.html"><i class="fa fa-chevron-right" aria-hidden="true"></i> Browse JavaDocs</a>-->
</div><!-- text-center -->
</div><!-- jumbotron -->
More information about the tor-commits
mailing list