-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild.xml
162 lines (145 loc) · 6.69 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<?xml version="1.0"?>
<project name="ConfDB" default="all" basedir=".">
<description>Build ConfDB project.</description>
<property environment="env"/>
<property name="dir.src" location="src"/>
<property name="dir.ext" location="ext"/>
<property name="dir.signed" location="ext/signed"/>
<property name="dir.build" location="classes"/>
<property name="dir.icons" location="icons"/>
<property name="dir.lib" location="lib"/>
<property name="dir.python" location="python"/>
<!-- initialize variables, make directories, make sure the libraries are signed -->
<target name="init">
<mkdir dir="${dir.build}"/>
<mkdir dir="${dir.build}/JNLP-INF"/>
<mkdir dir="${dir.lib}"/>
<mkdir dir="${dir.signed}"/>
</target>
<!-- compile all *.java files in src/** to *.class files in classes/** -->
<target name="compile" depends="init">
<javac srcdir="${dir.src}" destdir="${dir.build}" debug="true" target="1.6" source="1.6" bootclasspath="/usr/lib/jvm/jre-1.6.0/lib/rt.jar" includeantruntime="false">
<compilerarg line="-Xmaxerrs 0"/>
<compilerarg line="-Xmaxwarns 0"/>
<classpath>
<fileset dir="${dir.ext}" includes="*.jar"/>
</classpath>
</javac>
</target>
<!-- create a JNLP template based on the GUI jnlp, to be included in the signed .jar -->
<target name="jnlp" depends="init">
<!--
<copy file="browser/WebContent/gui/start.jnlp" tofile="${dir.build}/JNLP-INF/APPLICATION_TEMPLATE.JNLP" overwrite="true"/>
<replace file="${dir.build}/JNLP-INF/APPLICATION_TEMPLATE.JNLP" token="$$$$codebase" value="*"/>
-->
</target>
<!-- combine all classes into jar file -->
<target name="gui" depends="compile,jnlp">
<jar jarfile="${dir.lib}/cmssw-evf-confdb-gui.jar">
<fileset dir="${dir.build}"/>
<fileset dir="${dir.icons}"/>
<fileset dir="${dir.src}"><include name="conf/*"/></fileset>
<!-- include python FWCore -->
<fileset dir="${dir.python}"/>
<manifest>
<attribute name="Application-Name" value="CMS ConfDB GUI" />
<attribute name="Vendor" value="CMS ConfDB"/>
<attribute name="Main-Class" value="confdb.gui.ConfDbGUI"/>
<attribute name="Codebase" value="*"/> <!-- value="http://j2eeps.cern.ch/ https://j2eeps.cern.ch/ file:/"/> -->
<attribute name="Application-Library-Allowable-Codebase" value="*"/> <!-- value="http://j2eeps.cern.ch/ https://j2eeps.cern.ch/ file:/"/> -->
<attribute name="Permissions" value="all-permissions"/>
<attribute name="Trusted-Only" value="true"/>
</manifest>
</jar>
</target>
<!-- combine converter-relevant classes into jar file -->
<target name="converter" depends="compile">
<jar jarfile="${dir.lib}/cmssw-evf-confdb-converter.jar">
<fileset dir="${dir.build}">
<exclude name="confdb/gui/**"/>
<exclude name="confdb/parser/**"/>
</fileset>
<fileset dir="${dir.src}">
<include name="conf/*"/>
</fileset>
<manifest>
<attribute name="Main-Class" value="confdb.converter.Converter" />
</manifest>
</jar>
</target>
<!-- combine converter-relevant classes into jar file -->
<target name="browser" depends="compile">
<jar jarfile="${dir.lib}/cmssw-evf-confdb-browser.jar">
<fileset dir="${dir.build}">
<exclude name="confdb/gui/**"/>
<exclude name="confdb/parser/**"/>
</fileset>
<fileset dir="${dir.src}">
<include name="conf/*"/>
</fileset>
</jar>
</target>
<!-- combine parser-relevant classes into jar file -->
<target name="parser" depends="compile">
<jar jarfile="${dir.lib}/cmssw-evf-confdb-parser.jar">
<fileset dir="${dir.build}"><exclude name="confdb/gui/**"/></fileset>
<fileset dir="${dir.src}"><include name="conf/*"/></fileset>
<manifest>
<attribute name="Main-Class" value="confdb.parser.PythonParser" />
</manifest>
</jar>
</target>
<!-- sign all external jar files -->
<target name="signext" depends="init">
<!-- alternative tsaurl="http://time.certum.pl/" -->
<signjar keystore="/afs/cern.ch/user/c/confdb/private/certificate/certificate.p12" storepass="confdb" alias="cms confdb's id" lazy="true" preservelastmodified="false" tsaurl="https://timestamp.geotrust.com/tsa" destdir="${dir.signed}">
<fileset dir="${dir.ext}" includes="*.jar"/>
</signjar>
</target>
<!-- sign all compiled jar files -->
<target name="signlib" depends="compile,gui,parser,browser,converter">
<!-- alternative tsaurl="http://time.certum.pl/" -->
<signjar keystore="/afs/cern.ch/user/c/confdb/private/certificate/certificate.p12" storepass="confdb" alias="cms confdb's id" lazy="true" preservelastmodified="false" tsaurl="https://timestamp.geotrust.com/tsa">
<fileset dir="${dir.lib}" includes="*.jar"/>
</signjar>
</target>
<!-- combine webservice relevant files into war file -->
<target name="war" depends="signext,signlib">
<war destfile="${dir.lib}/confdb.war" webxml="browser/WebContent/WEB-INF/web.xml">
<lib file="${dir.lib}/cmssw-evf-confdb-browser.jar"/>
<lib file="${dir.signed}/mysql-connector-java-5.0.5-bin.jar"/>
<!-- move confdb version file in the root path of the container -->
<fileset file="${dir.src}/conf/confdb.version"/>
<fileset dir="browser/WebContent" excludes="WEB-INF/web.xml"/>
<zipfileset dir="${dir.lib}" includes="cmssw-evf-confdb-gui.jar" prefix="gui"/>
<zipfileset dir="${dir.signed}" prefix="gui"/>
</war>
</target>
<!-- build all targets -->
<target name="all" depends="compile,gui,parser,browser,converter,war"/>
<!-- run the ConfDB GUI -->
<target name="run" depends="gui" description="Start the ConfDB GUI.">
<java classname="confdb.gui.ConfDbGUI" fork="true">
<classpath>
<pathelement location="${dir.lib}/cmssw-evf-confdb-gui.jar"/>
<pathelement location="${dir.signed}/ojdbc6.jar"/>
<pathelement location="${dir.signed}/jython-2.5.2.jar"/>
</classpath>
</java>
</target>
<!-- delete all class files -->
<target name="clean">
<delete includeemptydirs="true" quiet="true">
<!--
<fileset dir="${dir.build}" includes="**/*.class"/>
<fileset dir="${dir.build}" includes="JNLP-INF/*.JNLP"/>
<fileset dir="${dir.lib}" includes="**/*.jar"/>
<fileset dir="${dir.lib}" includes="**/*.war"/>
-->
<fileset dir="${dir.build}"/>
<fileset dir="${dir.lib}"/>
<fileset dir="${dir.signed}"/>
</delete>
<echo message="clean successful"/>
</target>
</project>