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

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

<project default="usage" name="Onionoo" basedir=".">

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

19
20
21
22
23
24
25
26
27
28
  <!-- 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"
            value="org.torproject.onionoo.cron.Main" />

  <property name="jarincludes" value="logback.xml" />
  <property name="jarpatternprop" value="library" />
  <property name="additional2sign" value="${warfile}" />
29
  <property name="tardepends" value="war" />
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

  <target name="coverage-check">
    <cobertura-check branchrate="0" linerate="0"
                     totallinerate="34" totalbranchrate="30" >
      <regex pattern="org.torproject.onionoo.server"
             branchrate="67" linerate="77"/>
      <regex pattern="org.torproject.onionoo.docs"
             branchrate="19" linerate="29"/>
      <regex pattern="org.torproject.onionoo.updater"
             branchrate="17" linerate="18"/>
      <regex pattern="org.torproject.onionoo.writer"
             branchrate="22" linerate="20"/>
    </cobertura-check>
  </target>

  <patternset id="library" >
Karsten Loesing's avatar
Karsten Loesing committed
46
    <include name="metrics-lib-${metricslibversion}.jar"/>
47
48
49
    <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
50
51
52
    <include name="jackson-annotations-2.8.6.jar"/>
    <include name="jackson-core-2.8.6.jar"/>
    <include name="jackson-databind-2.8.6.jar"/>
53
54
55
56
    <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"/>
57
58
59
  </patternset>

  <patternset id="web" >
iwakeh's avatar
iwakeh committed
60
61
62
63
64
65
66
67
68
69
70
    <include name="servlet-api-3.1.jar"/>
    <include name="jetty9-server${jetty.version}.jar"/>
    <include name="jetty9-servlets${jetty.version}.jar"/>
    <include name="jetty9-servlet${jetty.version}.jar"/>
    <include name="jetty9-util${jetty.version}.jar"/>
    <include name="jetty9-http${jetty.version}.jar"/>
    <include name="jetty9-io${jetty.version}.jar"/>
    <include name="jetty9-xml${jetty.version}.jar"/>
    <include name="jetty9-webapp${jetty.version}.jar"/>
    <include name="jetty9-continuation${jetty.version}.jar"/>
    <include name="jetty9-security${jetty.version}.jar"/>
71
72
  </patternset>

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

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

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

122
123
</project>