commit 32003c6e66b6f1169620fa2827360f3fabf0ebd5 Author: iwakeh iwakeh@torproject.org Date: Mon Dec 4 11:14:36 2017 +0000
Add ant task for war creation.
Also move all website related java sources to main src folder. --- build.xml | 77 ++++++++++++++++++++++ .../org/torproject/metrics/web/AboutServlet.java | 0 .../org/torproject/metrics/web/AnyServlet.java | 0 .../java/org/torproject/metrics/web/Category.java | 0 .../torproject/metrics/web/CollecTorServlet.java | 0 .../metrics/web/CollectorDirectoryProvider.java | 0 .../torproject/metrics/web/ContentProvider.java | 0 .../torproject/metrics/web/DataSourceServlet.java | 0 .../torproject/metrics/web/DevelopmentServlet.java | 0 .../torproject/metrics/web/DirectoryListing.java | 0 .../org/torproject/metrics/web/ErrorServlet.java | 0 .../torproject/metrics/web/GlossaryServlet.java | 0 .../org/torproject/metrics/web/GraphServlet.java | 0 .../org/torproject/metrics/web/IndexServlet.java | 0 .../org/torproject/metrics/web/LinkServlet.java | 0 .../java/org/torproject/metrics/web/Metric.java | 0 .../org/torproject/metrics/web/MetricServlet.java | 0 .../torproject/metrics/web/MetricsLibServlet.java | 0 .../main/java/org/torproject/metrics/web/News.java | 0 .../org/torproject/metrics/web/NewsServlet.java | 0 .../org/torproject/metrics/web/OnionooServlet.java | 0 .../torproject/metrics/web/OperationServlet.java | 0 .../torproject/metrics/web/ResearchServlet.java | 0 .../torproject/metrics/web/ServicesServlet.java | 0 .../org/torproject/metrics/web/SourcesServlet.java | 0 .../org/torproject/metrics/web/StatsServlet.java | 0 .../org/torproject/metrics/web/TableServlet.java | 0 .../metrics/web/graphs/BubblesServlet.java | 0 .../torproject/metrics/web/graphs/Countries.java | 0 .../metrics/web/graphs/GraphImageServlet.java | 0 .../metrics/web/graphs/GraphParameterChecker.java | 0 .../org/torproject/metrics/web/graphs/RObject.java | 0 .../metrics/web/graphs/RObjectGenerator.java | 0 .../metrics/web/graphs/TableParameterChecker.java | 0 .../metrics/web/research/ResearchStatsServlet.java | 0 .../metrics/web/DirectoryListingTest.java | 0 36 files changed, 77 insertions(+)
diff --git a/build.xml b/build.xml index 7bab38c..fbfa111 100644 --- a/build.xml +++ b/build.xml @@ -91,6 +91,83 @@ <patternset refid="web" /> </patternset>
+ <!-- Create a .war file for deployment. --> + <target name="war" + depends="submoduleupdate,compile"> + <echo message="Removing problematic service definitions from"/> + <echo message="${libs}/jetty9-apache-jsp${jetty.version}.jar and using "/> + <echo message="${libs}/jetty9-apache-jsp${jetty.version}-tweaked.jar below." /> + <delete file="${libs}/jetty9-apache-jsp${jetty.version}-tweaked.jar" + quiet="true" /> + + <jar destfile="${libs}/jetty9-apache-jsp${jetty.version}-tweaked.jar"> + <zipfileset src="${libs}/jetty9-apache-jsp${jetty.version}.jar" > + <exclude name="**/javax.servlet.ServletContainerInitializer"/> + </zipfileset> + </jar> + + <antcall target="generate-ml-javadoc" /> + + <war destfile="${dist}/${warfile}" + duplicate="fail" + webxml="${resources}/web.xml" + basedir="${classes}"> + <restrict> + <not> + <and> + <name name="META-INF/*" /> + <not> + <name name="META-INF/services/*" /> + </not> + </and> + </not> + <archives> + <zips> + <fileset dir="${libs}"> + <patternset refid="common" /> + <patternset refid="web" /> + <patternset refid="webruntime" /> + </fileset> + </zips> + </archives> + </restrict> + <exclude name="**/Test*.class" /> + <zipfileset dir="${resources}" + prefix="" + includes="logback.xml" /> + <zipfileset dir="${resources}/web" + prefix="" + includes="css/* images/* js/* fonts/**" /> + <zipfileset dir="${resources}/web/jsps" + prefix="WEB-INF" + includes="*.jsp"/> + <zipfileset dir="${resources}" + includes="*.properties" /> + <fileset dir="${resources}" includes="jetty.xml" /> + + <zipfileset dir="${resources}/web/json" + prefix="WEB-INF/json" + includes="metrics.json categories.json news.json"/> + + <zipfileset dir="${basedir}/src/submods/metrics-lib/generated/javadoc" + prefix="metrics-lib" /> + <zipfileset dir="${libs}" prefix="WEB-INF/lib" > + <include name="taglibs-standard-impl-1.2.5.jar"/> + </zipfileset> + + <metainf dir="${resources}" + includes="context.xml"/> + <manifest> + <attribute name="Implemented-By" value="The Tor Project" /> + <attribute name="Implementation-Title" value="TorMetricsWeb Server"/> + <attribute name="Implementation-Version" + value="${release.version}-${git.revision}"/> + <attribute name="Main-Class" + value="org.torproject.metrics.web.ServerMain" /> + </manifest> + </war> + </target> + <target name="generate-ml-javadoc" depends="submoduleupdate" > <mkdir dir="${basedir}/src/submods/metrics-lib/lib" /> <exec executable="ant" diff --git a/website/src/main/java/org/torproject/metrics/web/AboutServlet.java b/src/main/java/org/torproject/metrics/web/AboutServlet.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/AboutServlet.java rename to src/main/java/org/torproject/metrics/web/AboutServlet.java diff --git a/website/src/main/java/org/torproject/metrics/web/AnyServlet.java b/src/main/java/org/torproject/metrics/web/AnyServlet.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/AnyServlet.java rename to src/main/java/org/torproject/metrics/web/AnyServlet.java diff --git a/website/src/main/java/org/torproject/metrics/web/Category.java b/src/main/java/org/torproject/metrics/web/Category.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/Category.java rename to src/main/java/org/torproject/metrics/web/Category.java diff --git a/website/src/main/java/org/torproject/metrics/web/CollecTorServlet.java b/src/main/java/org/torproject/metrics/web/CollecTorServlet.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/CollecTorServlet.java rename to src/main/java/org/torproject/metrics/web/CollecTorServlet.java diff --git a/website/src/main/java/org/torproject/metrics/web/CollectorDirectoryProvider.java b/src/main/java/org/torproject/metrics/web/CollectorDirectoryProvider.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/CollectorDirectoryProvider.java rename to src/main/java/org/torproject/metrics/web/CollectorDirectoryProvider.java diff --git a/website/src/main/java/org/torproject/metrics/web/ContentProvider.java b/src/main/java/org/torproject/metrics/web/ContentProvider.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/ContentProvider.java rename to src/main/java/org/torproject/metrics/web/ContentProvider.java diff --git a/website/src/main/java/org/torproject/metrics/web/DataSourceServlet.java b/src/main/java/org/torproject/metrics/web/DataSourceServlet.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/DataSourceServlet.java rename to src/main/java/org/torproject/metrics/web/DataSourceServlet.java diff --git a/website/src/main/java/org/torproject/metrics/web/DevelopmentServlet.java b/src/main/java/org/torproject/metrics/web/DevelopmentServlet.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/DevelopmentServlet.java rename to src/main/java/org/torproject/metrics/web/DevelopmentServlet.java diff --git a/website/src/main/java/org/torproject/metrics/web/DirectoryListing.java b/src/main/java/org/torproject/metrics/web/DirectoryListing.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/DirectoryListing.java rename to src/main/java/org/torproject/metrics/web/DirectoryListing.java diff --git a/website/src/main/java/org/torproject/metrics/web/ErrorServlet.java b/src/main/java/org/torproject/metrics/web/ErrorServlet.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/ErrorServlet.java rename to src/main/java/org/torproject/metrics/web/ErrorServlet.java diff --git a/website/src/main/java/org/torproject/metrics/web/GlossaryServlet.java b/src/main/java/org/torproject/metrics/web/GlossaryServlet.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/GlossaryServlet.java rename to src/main/java/org/torproject/metrics/web/GlossaryServlet.java diff --git a/website/src/main/java/org/torproject/metrics/web/GraphServlet.java b/src/main/java/org/torproject/metrics/web/GraphServlet.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/GraphServlet.java rename to src/main/java/org/torproject/metrics/web/GraphServlet.java diff --git a/website/src/main/java/org/torproject/metrics/web/IndexServlet.java b/src/main/java/org/torproject/metrics/web/IndexServlet.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/IndexServlet.java rename to src/main/java/org/torproject/metrics/web/IndexServlet.java diff --git a/website/src/main/java/org/torproject/metrics/web/LinkServlet.java b/src/main/java/org/torproject/metrics/web/LinkServlet.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/LinkServlet.java rename to src/main/java/org/torproject/metrics/web/LinkServlet.java diff --git a/website/src/main/java/org/torproject/metrics/web/Metric.java b/src/main/java/org/torproject/metrics/web/Metric.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/Metric.java rename to src/main/java/org/torproject/metrics/web/Metric.java diff --git a/website/src/main/java/org/torproject/metrics/web/MetricServlet.java b/src/main/java/org/torproject/metrics/web/MetricServlet.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/MetricServlet.java rename to src/main/java/org/torproject/metrics/web/MetricServlet.java diff --git a/website/src/main/java/org/torproject/metrics/web/MetricsLibServlet.java b/src/main/java/org/torproject/metrics/web/MetricsLibServlet.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/MetricsLibServlet.java rename to src/main/java/org/torproject/metrics/web/MetricsLibServlet.java diff --git a/website/src/main/java/org/torproject/metrics/web/News.java b/src/main/java/org/torproject/metrics/web/News.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/News.java rename to src/main/java/org/torproject/metrics/web/News.java diff --git a/website/src/main/java/org/torproject/metrics/web/NewsServlet.java b/src/main/java/org/torproject/metrics/web/NewsServlet.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/NewsServlet.java rename to src/main/java/org/torproject/metrics/web/NewsServlet.java diff --git a/website/src/main/java/org/torproject/metrics/web/OnionooServlet.java b/src/main/java/org/torproject/metrics/web/OnionooServlet.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/OnionooServlet.java rename to src/main/java/org/torproject/metrics/web/OnionooServlet.java diff --git a/website/src/main/java/org/torproject/metrics/web/OperationServlet.java b/src/main/java/org/torproject/metrics/web/OperationServlet.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/OperationServlet.java rename to src/main/java/org/torproject/metrics/web/OperationServlet.java diff --git a/website/src/main/java/org/torproject/metrics/web/ResearchServlet.java b/src/main/java/org/torproject/metrics/web/ResearchServlet.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/ResearchServlet.java rename to src/main/java/org/torproject/metrics/web/ResearchServlet.java diff --git a/website/src/main/java/org/torproject/metrics/web/ServicesServlet.java b/src/main/java/org/torproject/metrics/web/ServicesServlet.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/ServicesServlet.java rename to src/main/java/org/torproject/metrics/web/ServicesServlet.java diff --git a/website/src/main/java/org/torproject/metrics/web/SourcesServlet.java b/src/main/java/org/torproject/metrics/web/SourcesServlet.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/SourcesServlet.java rename to src/main/java/org/torproject/metrics/web/SourcesServlet.java diff --git a/website/src/main/java/org/torproject/metrics/web/StatsServlet.java b/src/main/java/org/torproject/metrics/web/StatsServlet.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/StatsServlet.java rename to src/main/java/org/torproject/metrics/web/StatsServlet.java diff --git a/website/src/main/java/org/torproject/metrics/web/TableServlet.java b/src/main/java/org/torproject/metrics/web/TableServlet.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/TableServlet.java rename to src/main/java/org/torproject/metrics/web/TableServlet.java diff --git a/website/src/main/java/org/torproject/metrics/web/graphs/BubblesServlet.java b/src/main/java/org/torproject/metrics/web/graphs/BubblesServlet.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/graphs/BubblesServlet.java rename to src/main/java/org/torproject/metrics/web/graphs/BubblesServlet.java diff --git a/website/src/main/java/org/torproject/metrics/web/graphs/Countries.java b/src/main/java/org/torproject/metrics/web/graphs/Countries.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/graphs/Countries.java rename to src/main/java/org/torproject/metrics/web/graphs/Countries.java diff --git a/website/src/main/java/org/torproject/metrics/web/graphs/GraphImageServlet.java b/src/main/java/org/torproject/metrics/web/graphs/GraphImageServlet.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/graphs/GraphImageServlet.java rename to src/main/java/org/torproject/metrics/web/graphs/GraphImageServlet.java diff --git a/website/src/main/java/org/torproject/metrics/web/graphs/GraphParameterChecker.java b/src/main/java/org/torproject/metrics/web/graphs/GraphParameterChecker.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/graphs/GraphParameterChecker.java rename to src/main/java/org/torproject/metrics/web/graphs/GraphParameterChecker.java diff --git a/website/src/main/java/org/torproject/metrics/web/graphs/RObject.java b/src/main/java/org/torproject/metrics/web/graphs/RObject.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/graphs/RObject.java rename to src/main/java/org/torproject/metrics/web/graphs/RObject.java diff --git a/website/src/main/java/org/torproject/metrics/web/graphs/RObjectGenerator.java b/src/main/java/org/torproject/metrics/web/graphs/RObjectGenerator.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/graphs/RObjectGenerator.java rename to src/main/java/org/torproject/metrics/web/graphs/RObjectGenerator.java diff --git a/website/src/main/java/org/torproject/metrics/web/graphs/TableParameterChecker.java b/src/main/java/org/torproject/metrics/web/graphs/TableParameterChecker.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/graphs/TableParameterChecker.java rename to src/main/java/org/torproject/metrics/web/graphs/TableParameterChecker.java diff --git a/website/src/main/java/org/torproject/metrics/web/research/ResearchStatsServlet.java b/src/main/java/org/torproject/metrics/web/research/ResearchStatsServlet.java similarity index 100% rename from website/src/main/java/org/torproject/metrics/web/research/ResearchStatsServlet.java rename to src/main/java/org/torproject/metrics/web/research/ResearchStatsServlet.java diff --git a/website/src/test/java/org/torproject/metrics/web/DirectoryListingTest.java b/src/test/java/org/torproject/metrics/web/DirectoryListingTest.java similarity index 100% rename from website/src/test/java/org/torproject/metrics/web/DirectoryListingTest.java rename to src/test/java/org/torproject/metrics/web/DirectoryListingTest.java