forked from PistoiaHELM/HELMEditor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
165 lines (139 loc) · 5.15 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
163
164
165
<?xml version="1.0" encoding="UTF-8"?>
<project name="HELMAntibodyEditor" default="dist" basedir=".">
<description>HELM Editor containing Antibody extension</description>
<!-- global properties -->
<property name="src" location="source" />
<property name="build" location="build" />
<property name="dist" location="dist" />
<property name="temp" location="temp" />
<property name="lib" location="lib" />
<property name="yFiles" location="local/yWorks" />
<property name="jar" value="HELMAntibodyEditor.jar" />
<!-- compile time classpath -->
<path id="classpath">
<fileset dir="${lib}">
<include name="*.jar" />
</fileset>
<fileset dir="${yFiles}">
<include name="*.jar" />
</fileset>
</path>
<!-- runtime class path -->
<path id="runtime.classpath">
<fileset dir="${lib}">
<include name="*.jar" />
<exclude name="junit-4.11.jar" />
<exclude name="hamcrest-core-1.3.jar" />
</fileset>
<pathelement location="lib/y.jar" />
<pathelement location="lib/yguard.jar" />
<pathelement location="lib/graphml.jar" />
<pathelement location="lib/ObfuscationAnnotation.jar" />
</path>
<!-- convert classpath to a property for the MANIFEST file -->
<!-- transform the path from (semi-)colon separated to space separated -->
<manifestclasspath property="manifest.classpath" jarfile="${jar}">
<classpath refid="runtime.classpath" />
</manifestclasspath>
<!-- ANT targets -->
<target name="init">
<tstamp />
<!-- create the build directory structure used by compile -->
<mkdir dir="${build}" />
</target>
<target name="compile" depends="init">
<!-- copy non-Java files -->
<copy todir="${build}">
<fileset dir="${src}">
<exclude name="**/*.java" />
</fileset>
<fileset dir="resources">
<include name="**/*.*" />
</fileset>
</copy>
<!-- compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}" source="1.6" target="1.6" debug="on" debuglevel="lines,vars,source" optimize="off" includeantruntime="false">
<classpath>
<path refid="classpath" />
</classpath>
</javac>
</target>
<target name="dist" depends="compile">
<mkdir dir="${temp}" />
<mkdir dir="${dist}" />
<mkdir dir="${dist}/lib" />
<mkdir dir="${dist}/config" />
<!-- Put everything in ${build} into the HELMextension.jar file -->
<jar jarfile="${temp}/${jar}" basedir="${build}" index="false">
<manifest>
<attribute name="Main-Class" value="org.helm.editor.HELMApp" />
<attribute name="Class-Path" value="${manifest.classpath}" />
</manifest>
</jar>
<!-- Copy runtime libraries -->
<copy todir="${dist}/lib">
<fileset dir="${lib}">
<include name="*.jar" />
<exclude name="junit-4.11.jar" />
<exclude name="hamcrest-core-1.3.jar" />
</fileset>
<fileset dir="${yFiles}">
<include name="yguard.jar" />
<include name="ObfuscationAnnotation.jar" />
</fileset>
</copy>
<!-- Copy additional externa files and directories -->
<copy todir="${dist}/config">
<fileset dir="config">
<include name="*.*" />
</fileset>
</copy>
<copy todir="${dist}">
<fileset dir=".">
<include name="*.exe" />
</fileset>
</copy>
<!-- Create obfuscated Jars -->
<taskdef name="yguard" classname="com.yworks.yguard.YGuardTask" classpath="${yFiles}/yguard.jar" />
<yguard>
<inoutpair in="${temp}/${jar}" out="${dist}/${jar}" />
<inoutpair in="${yFiles}/y.jar" out="${dist}/lib/y.jar" />
<inoutpair in="${yFiles}//graphml.jar" out="${dist}/lib/graphml.jar" />
<!-- [OPTIONALLY] Keep the line number table and the source file attributes of the public part of the "application" -->
<attribute name="LineNumberTable,SourceFile">
<patternset>
<include name="org.helm.**" />
</patternset>
</attribute>
<rename replaceClassNameStrings="true">
<!-- use some unique package prefix for obfuscated classes to avoid name clashes -->
<property name="obfuscation-prefix" value="yguard" />
<!-- make sure not rely on cases to differentiate names -->
<property name="language-conformity" value="compatible" />
<keep>
<class classes="private" methods="private" fields="private">
<patternset>
<include name="**.*" />
<exclude name="y.**.*" />
<exclude name="yext.**.*" />
</patternset>
</class>
</keep>
<!-- make sure that the .properties files are renamed according to their -->
<!-- corresponding class files, yFiles needs this to function properly when obfuscated -->
<adjust replaceName="true">
<include name="y/**/*.properties" />
</adjust>
</rename>
</yguard>
<!-- Now zip together the contents of the dist directory -->
<zip destfile="HELMAntibodyEditor-${DSTAMP}${TSTAMP}.zip" basedir="${dist}" />
</target>
<!-- clean up -->
<target name="clean">
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}" failonerror="false" />
<delete dir="${dist}" failonerror="false" />
<delete dir="${temp}" failonerror="false" />
</target>
</project>