build.xml 4.4 KB
Newer Older
1
<?xml version="1.0"?>
iwakeh's avatar
iwakeh committed
2

3
4
5
6
<!DOCTYPE project [
       <!ENTITY base SYSTEM "src/build/java/base.xml">
]>

7
8
<project default="usage" name="Onionoo" basedir="."
         xmlns:ivy="antlib:org.apache.ivy.ant">
9
10
11

  <property name="javadoc-title" value="Onionoo API Documentation"/>
  <property name="implementation-title" value="Onionoo" />
12
  <property name="onionoo.protocol.version" value="7.0"/>
iwakeh's avatar
iwakeh committed
13
  <property name="release.version"
14
            value="${onionoo.protocol.version}-1.23.0"/>
15
  <property name="metricslibversion" value="2.9.1"/>
iwakeh's avatar
iwakeh committed
16
  <property name="jetty.version" value="-9.2.21.v20170120" />
iwakeh's avatar
iwakeh committed
17
  <property name="warfile"
18
            value="onionoo-${release.version}.war"/>
iwakeh's avatar
iwakeh committed
19

20
21
22
23
24
  <!-- Name to appear in jar names etc. -->
  <property name="name" value="onionoo"/>

  <!-- If 'project-main-class' is not provided, a library jar is created. -->
  <property name="project-main-class"
25
            value="org.torproject.metrics.onionoo.cron.Main" />
26
27
28
29

  <property name="jarincludes" value="logback.xml" />
  <property name="jarpatternprop" value="library" />
  <property name="additional2sign" value="${warfile}" />
30
  <property name="tardepends" value="war" />
31
32
33
34

  <target name="coverage-check">
    <cobertura-check branchrate="0" linerate="0"
                     totallinerate="34" totalbranchrate="30" >
35
      <regex pattern="org.torproject.metrics.onionoo.server"
36
             branchrate="67" linerate="77"/>
37
      <regex pattern="org.torproject.metrics.onionoo.docs"
38
             branchrate="19" linerate="29"/>
39
      <regex pattern="org.torproject.metrics.onionoo.updater"
40
             branchrate="17" linerate="18"/>
41
      <regex pattern="org.torproject.metrics.onionoo.writer"
42
43
44
45
46
             branchrate="22" linerate="20"/>
    </cobertura-check>
  </target>

  <patternset id="library" >
47
    <include name="metrics-lib-${metricslibversion}-thin.jar"/>
48
49
50
    <include name="commons-codec-1.10.jar"/>
    <include name="commons-compress-1.13.jar"/>
    <include name="commons-lang3-3.5.jar"/>
Karsten Loesing's avatar
Karsten Loesing committed
51
52
53
    <include name="jackson-annotations-2.8.6.jar"/>
    <include name="jackson-core-2.8.6.jar"/>
    <include name="jackson-databind-2.8.6.jar"/>
54
55
56
57
    <include name="logback-classic-1.1.9.jar"/>
    <include name="logback-core-1.1.9.jar"/>
    <include name="slf4j-api-1.7.22.jar"/>
    <include name="xz-1.6.jar"/>
58
59
60
  </patternset>

  <patternset id="web" >
61
62
63
64
65
66
67
68
69
70
71
    <include name="javax.servlet-api-3.1.0.jar"/>
    <include name="jetty-server${jetty.version}.jar"/>
    <include name="jetty-servlets${jetty.version}.jar"/>
    <include name="jetty-servlet${jetty.version}.jar"/>
    <include name="jetty-util${jetty.version}.jar"/>
    <include name="jetty-http${jetty.version}.jar"/>
    <include name="jetty-io${jetty.version}.jar"/>
    <include name="jetty-xml${jetty.version}.jar"/>
    <include name="jetty-webapp${jetty.version}.jar"/>
    <include name="jetty-continuation${jetty.version}.jar"/>
    <include name="jetty-security${jetty.version}.jar"/>
72
73
  </patternset>

74
75
76
  <patternset id="runtime" >
    <patternset refid="library" />
    <patternset refid="web" />
77
78
  </patternset>

79
  <target name="war"
iwakeh's avatar
iwakeh committed
80
          depends="jar">
81
    <war destfile="${dist}/${warfile}"
82
83
         webxml="${resources}/web.xml"
         basedir="${classes}">
84
      <fileset dir="${resources}/web"/>
85
86
87
88
89
90
91
92
93
94
95
96
      <restrict>
        <not>
          <name name="META-INF/*" />
        </not>
        <archives>
          <zips>
            <fileset dir="${libs}">
              <patternset refid="runtime" />
            </fileset>
          </zips>
        </archives>
      </restrict>
97
      <fileset dir="${resources}" includes="jetty.xml" />
98
      <exclude name="**/Test*.class"/>
99
      <zipfileset dir="${resources}"
iwakeh's avatar
iwakeh committed
100
101
                  prefix=""
                  includes="logback.xml"/>
102
      <zipfileset dir="${resources}"
103
                  prefix="WEB-INF/classes"
104
                  includes="logback.xml"/>
105
      <metainf dir="${resources}"
106
               includes="context.xml"/>
iwakeh's avatar
iwakeh committed
107
      <manifest>
iwakeh's avatar
iwakeh committed
108
        <attribute name="Implemented-By" value="The Tor Project" />
iwakeh's avatar
iwakeh committed
109
110
        <attribute name="Implementation-Title" value="Onionoo Server"/>
        <attribute name="Implementation-Version"
111
                   value="${release.version}-${git.revision}"/>
iwakeh's avatar
iwakeh committed
112
        <attribute name="Main-Class"
113
                   value="org.torproject.metrics.onionoo.server.ServerMain" />
iwakeh's avatar
iwakeh committed
114
      </manifest>
115
116
    </war>
  </target>
iwakeh's avatar
iwakeh committed
117

118
119
120
121
  <!-- The following line adds the common targets and properties
       for Metrics' Java Projects.
  -->
  &base;
122

123
124
</project>