-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.xml
141 lines (122 loc) · 4.28 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<project name="CTPClient" default="all" basedir=".">
<property name="build" value="${basedir}/build"/>
<property name="libraries" value="${basedir}/libraries"/>
<property name="source" value="${basedir}/source"/>
<property name="files" value="${source}/files"/>
<property name="xsl" value="${source}/xsl"/>
<property name="manifest" value="${source}/manifest"/>
<property name="java" value="${source}/java"/>
<property name="products" value="${basedir}/products"/>
<property name="ctp" value="../CTP"/>
<property name="examples" value="${ctp}/source/files/examples"/>
<property name="zip" value="${basedir}/zip"/>
<property name="signed" value="${basedir}/signed"/>
<property name="keystore" value="${files}/keystore"/>
<property name="password" value="ctpstore"/>
<property name="alias" value="ctp"/>
<path id="classpath">
<pathelement location="${libraries}/util.jar"/>
<pathelement location="${libraries}/CTP.jar"/>
<pathelement location="${libraries}/dcm4che.jar"/>
<pathelement location="${libraries}/log4j.jar"/>
</path>
<target name="clean">
<delete dir="${build}" failonerror="false"/>
</target>
<target name="init">
<mkdir dir="${build}"/>
<tstamp>
<format property="today" pattern="yyyy.MM.dd"/>
<format property="now" pattern="HH:mm:ss"/>
</tstamp>
<echo message="Time now ${now}"/>
<echo message="ant.java.version = ${ant.java.version}" />
<delete dir="${products}" failonerror="false" />
<mkdir dir="${build}"/>
<mkdir dir="${products}"/>
</target>
<target name="getScripts">
<copy overwrite="true"
file="${examples}/example-ctp-dicom-anonymizer.script"
tofile="${files}/DA.script"/>
<copy overwrite="true"
file="${examples}/example-dicom-pixel-anonymizer.script"
tofile="${files}/DPA.script"/>
</target>
<target name="getLibraryJars">
<copy overwrite="true" todir="${libraries}">
<fileset dir="${ctp}/libraries">
<include name="CTP.jar"/>
<include name="dcm4che.jar"/>
<include name="dcm4che-imageio-rle-2.0.25.jar"/>
<include name="log4j.jar"/>
<include name="util.jar"/>
<include name="jdbm.jar"/>
<include name="pixelmed_codec.jar"/>
</fileset>
</copy>
</target>
<target name="jar" depends="init, getScripts, getLibraryJars">
<javac destdir="${build}" optimize="on"
classpathref="classpath"
includeantruntime="false"
debug="true" debuglevel="lines,vars,source">
<src path="${java}"/>
</javac>
<copy overwrite="true" todir="${build}">
<fileset dir="${files}"/>
</copy>
<jar jarfile="${products}/CTPClient.jar">
<manifest>
<attribute name="Main-Class" value="client.CTPClient"/>
<attribute name="Implementation-Version" value="${today} @ ${now}"/>
<attribute name="Class-Path" value="util.jar log4j.jar dcm4che.jar dcm4che-imageio-rle-2.0.25.jar CTP.jar jdbm.jar pixelmed_codec.jar"/>
<attribute name="Application-Name" value="CTP Client"/>
<attribute name="Permissions" value="all-permissions"/>
<attribute name="Codebase" value="*"/>
</manifest>
<fileset dir="${build}" includes="**"/>
</jar>
</target>
<target name="sign" depends="jar">
<copy overwrite="true" todir="${products}">
<fileset dir="${libraries}"/>
</copy>
<delete dir="${signed}" failonerror="false" />
<mkdir dir="${signed}" />
<signjar
destDir="${signed}"
alias="${alias}"
keystore="${keystore}"
storepass="${password}"
tsaurl="http://timestamp.entrust.net/TSS/JavaHttpTS"
preservelastmodified="true">
<sysproperty key="https.protocols" value="TLSv1,TLSv1.1,TLSv1.2"/>
<path>
<fileset dir="${products}" includes="*.jar" />
</path>
<flattenmapper />
</signjar>
</target>
<!-- Doesn't work: tsaurl="https://timestamp.geotrust.com/tsa" -->
<target name="zip" depends="sign">
<delete dir="${zip}" failonerror="false" />
<copy overwrite="true" todir="${zip}">
<fileset dir="${signed}"/>
</copy>
<copy overwrite="true" todir="${zip}">
<fileset dir="${xsl}"/>
</copy>
<copy overwrite="true" todir="${zip}">
<fileset dir="${manifest}"/>
</copy>
<zip destfile="${products}/CTPClient.zip" basedir="${zip}"/>
<delete dir="${zip}" failonerror="false" />
</target>
<target name="all" depends="clean, zip">
<tstamp>
<format property="end" pattern="HH:mm:ss"/>
</tstamp>
<echo message="Time now ${end}"/>
</target>
</project>