build.xml 5.76 KB
Newer Older
1
<?xml version="1.0"?>
Karsten Loesing's avatar
Karsten Loesing committed
2

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

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

  <property name="javadoc-title" value="ExoneraTor API Documentation"/>
  <property name="implementation-title" value="ExoneraTor" />
Karsten Loesing's avatar
Karsten Loesing committed
12
13
  <property name="release.version" value="4.3.0" />
  <property name="metricslibversion" value="2.10.0" />
14
  <property name="jetty.version" value="-9.2.21.v20170120" />
15
16
17
18
19
20
  <property name="warfile"
            value="exonerator-${release.version}.war"/>

  <property name="name" value="exonerator"/>

  <property name="project-main-class"
21
            value="org.torproject.metrics.exonerator.ExoneraTorDatabaseImporter" />
22
23
24
25
26
27
28
29
30
31
32
33
34
35
  <property name="additional2sign" value="${warfile}" />
  <property name="tardepends" value="war" />

  <!-- The coverage needs to be improved! -->
  <target name="coverage-check">
    <cobertura-check totallinerate="9" totalbranchrate="7" >
      <!-- example regexes
      <regex pattern="org.torproject.abc.xyz.*"
             branchrate="87" linerate="73"/>
      -->
    </cobertura-check>
  </target>

  <patternset id="common" >
36
    <include name="commons-codec-1.10.jar"/>
37
    <include name="commons-lang3-3.5.jar"/>
Karsten Loesing's avatar
Karsten Loesing committed
38
39
40
    <include name="jackson-annotations-2.8.6.jar"/>
    <include name="jackson-core-2.8.6.jar"/>
    <include name="jackson-databind-2.8.6.jar"/>
41
42
    <include name="logback-core-1.1.9.jar" />
    <include name="logback-classic-1.1.9.jar" />
43
    <include name="postgresql-42.2.5.jar"/>
44
45
46
47
48
    <include name="slf4j-api-1.7.22.jar"/>
  </patternset>

  <patternset id="library" >
    <patternset refid="common" />
49
    <include name="metrics-lib-${metricslibversion}-thin.jar"/>
50
    <include name="commons-compress-1.13.jar"/>
51
    <include name="javax.servlet-api-3.1.0.jar"/>
52
53
54
    <include name="xz-1.6.jar"/>
  </patternset>

55
  <patternset id="web" >
56
57
58
59
60
61
62
63
64
65
    <include name="jetty-annotations${jetty.version}.jar"/>
    <include name="jetty-server${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"/>
66
67
68
  </patternset>

  <patternset id="webruntime" >
69
70
71
72
73
74
75
76
77
    <include name="asm-5.0.1.jar" />
    <include name="asm-commons-5.0.1.jar" />
    <include name="jetty-plus${jetty.version}.jar"/>
    <include name="jetty-jndi${jetty.version}.jar"/>
    <include name="apache-jsp${jetty.version}.jar" />
    <include name="tomcat-embed-jasper-8.5.14.jar" />
    <include name="tomcat-embed-el-8.5.14.jar" />
    <include name="tomcat-embed-core-8.5.14.jar" />
    <include name="ecj-4.6.1.jar" />
78
  </patternset>
Karsten Loesing's avatar
Karsten Loesing committed
79

80
81
  <patternset id="runtime" >
    <patternset refid="library" />
82
    <patternset refid="web" />
83
  </patternset>
Karsten Loesing's avatar
Karsten Loesing committed
84

Karsten Loesing's avatar
Karsten Loesing committed
85
86
87
  <!-- Create a .war file for deployment. -->
  <target name="war"
          depends="compile">
88
    <war destfile="${dist}/${warfile}"
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
         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" />
114
115
      <zipfileset dir="${resources}/web"
                  prefix=""
116
                  includes="css/* images/*" />
117
118
119
      <zipfileset dir="${resources}/web/jsps"
                  prefix="WEB-INF"
                  includes="*.jsp"/>
120
      <zipfileset dir="${resources}"
121
                  includes="*.properties" />
122
123
124
125
126
127
128
      <fileset dir="${resources}" includes="jetty.xml" />
      <manifest>
        <attribute name="Implemented-By" value="The Tor Project" />
        <attribute name="Implementation-Title" value="Exonerator Server"/>
        <attribute name="Implementation-Version"
                   value="${release.version}-${git.revision}"/>
        <attribute name="Main-Class"
129
                   value="org.torproject.metrics.exonerator.ServerMain" />
130
      </manifest>
Karsten Loesing's avatar
Karsten Loesing committed
131
132
    </war>
  </target>
133

134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
  <!-- Create a test .war file for basic start w/o db resources. -->
  <target name="smoke-test-war"
          depends="war">

    <delete file="${generated}/${name}-dummy-test.war"
            quiet="true" />
    <copy overwrite="true"
          file="${resources}/test-web.xml"
          tofile="${generated}/web.xml"/>
    <jar destfile="${generated}/${name}-dummy-test.war">
      <zipfileset src="${dist}/${warfile}" >
        <exclude name="WEB-INF/web.xml"/>
      </zipfileset>
      <zipfileset dir="${generated}"
                  prefix="WEB-INF"
                  includes="web.xml" />
      <manifest>
        <attribute name="Implemented-By" value="The Tor Project" />
        <attribute name="Implementation-Title" value="Test Exonerator Server"/>
        <attribute name="Implementation-Version"
                   value="${release.version}-${git.revision}"/>
        <attribute name="Main-Class"
156
                   value="org.torproject.metrics.exonerator.ServerMain" />
157
158
159
      </manifest>
    </jar>
  </target>
160
161
162
163
164
165

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

Karsten Loesing's avatar
Karsten Loesing committed
166
167
</project>