forked from ktgw0316/LightZone-backup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
executable file
·192 lines (162 loc) · 6.35 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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<project name="linux" default="jar">
<tstamp/>
<!--===== Properties =====================================================-->
<property name="common-dir" value="../lightcrafts"/>
<!-- The default maxmemory for the run* targets. -->
<property name="maxmemory" value="512m"/>
<exec executable="cat" vmlauncher="true" failonerror="true"
outputproperty="app-version">
<arg value="${common-dir}/version.txt"/>
</exec>
<property name="JVMARG" value=""/>
<!--===== Application build ==============================================-->
<condition property="MAKE" value="make">
<not>
<or>
<os name="freebsd"/>
<os name="SunOS"/>
</or>
</not>
</condition>
<condition property="MAKE" value="gmake">
<or>
<os name="freebsd"/>
<os name="SunOS"/>
</or>
</condition>
<target name="common">
<ant dir="${common-dir}" target="jar"/>
<exec executable="${MAKE}" dir="products" failonerror="true"
vmlauncher="true">
<arg value="-j"/>
</exec>
</target>
<target name="javac" depends="common">
<mkdir dir="build"/>
<mkdir dir="javah"/>
<javac destdir="build" includeantruntime="false" debug="true"
release="11" nativeheaderdir="javah">
<src path="src"/>
<classpath>
<fileset dir="${common-dir}/products">
<include name="*.jar"/>
</fileset>
<fileset dir="/usr">
<include name="share/java*/**/*.jar"/>
<include name="local/share/java/classes/*.jar"/>
<include name="jdk/packages/lib/ext/*.jar"/>
</fileset>
</classpath>
</javac>
</target>
<target name="locales">
<copy todir="build">
<fileset dir="locale" excludes=".git"/>
</copy>
</target>
<target name="help">
<ant dir="help" target="build"/>
</target>
<target name="build" depends="javac, locales, help"/>
<!--===== Make the jar files =============================================-->
<target name="jar" depends="build">
<delete file="products/lightcrafts-linux.jar"/>
<jar jarfile="products/lightcrafts-linux.jar">
<fileset dir="build"/>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Implementation-Vendor" value="Light Crafts, Inc."/>
<attribute name="Implementation-Version"
value="${app-version} ${TODAY}"/>
</manifest>
</jar>
</target>
<!--===== Run the application ============================================-->
<target name="run">
<java classname="com.lightcrafts.platform.linux.LinuxLauncher"
dir="products" failonerror="true" fork="true"
maxmemory="${maxmemory}">
<jvmarg line="${JVMARG}"/>
<classpath>
<fileset dir="products">
<include name="*.jar"/>
</fileset>
<fileset dir="/usr">
<include name="share/java*/**/*.jar"/>
<include name="local/share/java/classes/*.jar"/>
<include name="jdk/packages/lib/ext/*.jar"/>
</fileset>
</classpath>
<env key="LD_LIBRARY_PATH" value="."/>
<sysproperty key="java.library.path" value="."/>
<sysproperty key="lightcrafts.debug" value="1"/>
</java>
</target>
<!--===== Generate an Archive ============================================-->
<target name="archive" depends="jar">
<exec executable="install4jc" failonerror="true">
<!-- The "-D LZ_VERSION=..." has to be given to install4j as two seperate
arguments, hence the use of line= rather than value= since the
latter, even if there's a space in it, will be given as a single
argument containing a space and not as two seperate arguments. -->
<arg line="-D LZ_VERSION=${app-version}"/>
<arg file="lightzone.install4j"/>
</exec>
</target>
<target name="labelled-archive" depends="archive">
<exec executable="${common-dir}/tools/bin/lc-git-revision"
outputproperty="git-revision" vmlauncher="true" failonerror="true"/>
<!-- CruiseControl puts its build label in the "label" property -->
<mkdir dir="archive"/>
<move file="LightZone.tar.gz"
tofile="archive/LightZone-rev.${git-revision}.tar.gz"/>
</target>
<!--===== Sign All Jars ==================================================-->
<target name="sign" depends="jar">
<property name="storetype" value="pkcs12" />
<property name="keystore" value="../windows/resources/sign/LightZone.pfx" />
<property name="alias" value="pvktmp:2fe2cbb9-7371-497c-8650-f850e878b5ea" />
<property name="storepass" value="photoshopsucks" />
<signjar jar="products/lightcrafts.jar" storetype="${storetype}" keystore="${keystore}" alias="${alias}" storepass="${storepass}"/>
<signjar jar="products/lightcrafts-linux.jar" storetype="${storetype}" keystore="${keystore}" alias="${alias}" storepass="${storepass}"/>
<signjar jar="products/linux-so.jar" storetype="${storetype}" keystore="${keystore}" alias="${alias}" storepass="${storepass}"/>
</target>
<!--===== Assemble the WebStart Site =====================================-->
<target name="webstart">
<delete dir="webstart"/>
<mkdir dir="webstart"/>
<!-- bundle native libraries into a jar and sign it -->
<delete file="products/linux-so.jar"/>
<jar jarfile="products/linux-so.jar">
<fileset dir="products" includes="*.so"/>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Implementation-Vendor" value="Light Crafts, Inc."/>
<attribute name="Implementation-Version"
value="${app-version} ${TODAY}"/>
</manifest>
</jar>
<antcall target="sign"/>
<copy todir="webstart">
<fileset dir="web"/> <!-- the static webstart content -->
<fileset dir="products" includes="*.jar"/>
</copy>
</target>
<!--===== Clean up =======================================================-->
<target name="distclean">
<ant dir="${common-dir}" target="distclean"/>
<ant dir="help" target="clean"/>
<parallel>
<delete dir="archive"/>
<delete dir="build"/>
<delete dir="javah"/>
<delete dir="webstart"/>
<delete file="LightZone.tar.gz"/>
</parallel>
<exec executable="${MAKE}" dir="products">
<arg value="distclean"/>
</exec>
</target>
<target name="clean" depends="distclean"/>
</project>
<!-- vim:set et sw=2 ts=2: -->