forked from mguetlein/CheS-Mapper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
132 lines (120 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
<project name="ches-mapper" default="build_internal_jar" basedir=".">
<description>
simple example build file
</description>
<!-- set global properties for this build -->
<property name="src" location="CheS-View/src;CheS-Map/src;JavaLib/src"/>
<property name="build" location="build"/>
<property name="deploy" location="deploy"/>
<path id="classpath">
<fileset dir="CheS-View/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="CheS-Map/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="JavaLib/lib">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- Compile the java code from ${src} into ${build} -->
<target name="compile" description="compile the source" >
<mkdir dir="${build}"/>
<javac srcdir="${src}" destdir="${build}" classpathref="classpath">
</javac>
</target>
<!-- Delete the ${build} and ${dist} directory trees -->
<target name="clean" description="clean up" >
<delete dir="${build}"/>
<delete dir="${deploy}"/>
</target>
<!-- Build webstart version with external jars -->
<target name="build_external_jar" depends="compile" >
<delete dir="${deploy}/ches-mapper_lib"/>
<mkdir dir="${deploy}/ches-mapper_lib"/>
<copy todir="${deploy}/ches-mapper_lib">
<fileset dir="CheS-View/lib">
<include name="**/*.jar"/>
</fileset>
</copy>
<copy todir="${deploy}/ches-mapper_lib">
<fileset dir="CheS-Map/lib">
<include name="**/*.jar"/>
</fileset>
</copy>
<copy todir="${deploy}/ches-mapper_lib">
<fileset dir="JavaLib/lib">
<include name="**/*.jar"/>
</fileset>
</copy>
<mkdir dir="${deploy}"/>
<tstamp>
<format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss" />
</tstamp>
<path id="jar_classpath">
<fileset dir="${deploy}/ches-mapper_lib">
<include name="**/*.jar"/>
</fileset>
</path>
<manifestclasspath property="jar.classpath" jarfile="${deploy}/ches-mapper.jar">
<classpath refid="jar_classpath"/>
</manifestclasspath>
<jar destfile="${deploy}/ches-mapper.jar">
<manifest>
<attribute name="Main-Class" value="gui.CheSViewer"/>
<attribute name="Class-Path" value="${jar.classpath}"/>
<attribute name="Built-Date" value="${TODAY}"/>
</manifest>
<fileset dir="${build}"/>
<fileset dir="CheS-View/data"/>
<fileset dir="JavaLib/data"/>
<fileset dir="CheS-Map/data"/>
</jar>
</target>
<!-- Build jar with internal jars -->
<target name="build_internal_jar" depends="build_external_jar" >
<tstamp>
<format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss" />
</tstamp>
<!-- hack to get the paths in the mainfest right -->
<path id="jar_classpath_map">
<fileset dir="CheS-Map/lib">
<include name="**/*.jar"/>
</fileset>
</path>
<manifestclasspath property="jar.classpath.map" jarfile="CheS-Map/lib/ches-mapper-complete.jar">
<classpath refid="jar_classpath_map"/>
</manifestclasspath>
<path id="jar_classpath_view">
<fileset dir="CheS-View/lib">
<include name="**/*.jar"/>
</fileset>
</path>
<manifestclasspath property="jar.classpath.view" jarfile="CheS-View/lib/ches-mapper-complete.jar">
<classpath refid="jar_classpath_view"/>
</manifestclasspath>
<path id="jar_classpath_lib">
<fileset dir="JavaLib/lib">
<include name="**/*.jar"/>
</fileset>
</path>
<manifestclasspath property="jar.classpath.lib" jarfile="JavaLib/lib/ches-mapper-complete.jar">
<classpath refid="jar_classpath_lib"/>
</manifestclasspath>
<!-- end hack -->
<jar destfile="${deploy}/ches-mapper-complete.jar">
<manifest>
<attribute name="Main-Class" value="org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader"/>
<attribute name="Rsrc-Main-Class" value="gui.CheSViewer"/>
<attribute name="Class-Path" value="."/>
<attribute name="Rsrc-Class-Path" value="./ ${jar.classpath.map} ${jar.classpath.view} ${jar.classpath.lib}"/>
</manifest>
<zipfileset src="jar-in-jar-loader.zip"/>
<fileset dir="${build}"/>
<fileset dir="CheS-View/data"/>
<fileset dir="JavaLib/data"/>
<fileset dir="CheS-Map/data"/>
<zipfileset dir="${deploy}/ches-mapper_lib" includes="**/*.jar"/>
</jar>
</target>
</project>