-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.xml
243 lines (209 loc) · 10.1 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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
<?xml version="1.0" encoding="UTF-8"?>
<project name="net.sf.colorer" default="gather" basedir=".">
<property file='build.user.properties'/>
<property file='build.properties'/>
<property name="bootclasspath" value=""/>
<property name="target.os" value=""/>
<property name="target.arch" value=""/>
<property name="javacFailOnError" value="true"/>
<property name="javacDebugInfo" value="on"/>
<property name="javacVerbose" value="false"/>
<property name="eclipse.dir" value=""/>
<property name="eclipse.plugins" value="${eclipse.dir}/plugins"/>
<property name="plugin" value="net.sf.colorer"/>
<property name='eclipseplugin-version' value='eclipseplugin-version'/>
<property name='release-name' value='EclipseColorer_${eclipseplugin-version}'/>
<property name='build-dir' value='${basedir}/${release-name}'/>
<property name='release-zip' value='${release-name}.zip'/>
<property name='resource-dir' value='src/main/resources'/>
<property name='eclipsedir-name' value='net.sf.colorer_${eclipseplugin-version}'/>
<property name='eclipseplugin-dir' value='${build-dir}/${eclipsedir-name}'/>
<property name="full.name" value="${plugin}_${eclipseplugin-version}"/>
<property name="zip.name" value="${full.name}"/>
<property name="temp.folder" value="${basedir}/temp.folder"/>
<!-- location for colorer.jar and src.zip -->
<property name="build.result.folder" value="${basedir}/bin"/>
<target name="init" depends="properties">
<path id='classpath'>
<fileset dir="${eclipse.plugins}">
<include name="org.eclipse*/**/*.jar"/>
<include name="org.eclipse*.jar"/>
</fileset>
<pathelement path="${java.class.path}"/>
</path>
<available file='${eclipse.dir}' type='dir' property='eclipse.plugins-exists'/>
<mkdir dir='${build-dir}'/>
</target>
<target name="properties" if="eclipse.running">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
</target>
<target name="update-version">
<delete>
<fileset dir="${resource-dir}" includes="feature.xml, site.xml, META-INF/MANIFEST.MF"/>
</delete>
<filter token="eclipseplugin-version" value="${eclipseplugin-version}"/>
<filter token="target.os" value="${target.os}"/>
<filter token="target.arch" value="${target.arch}"/>
<copy file='${resource-dir}/feature.in.xml' tofile='${resource-dir}/feature.xml' filtering='true'/>
<copy file='${resource-dir}/site.in.xml' tofile='${resource-dir}/site.xml' filtering='true'/>
<copy file='${resource-dir}/META-INF/MANIFEST.in.MF' tofile='${resource-dir}/META-INF/MANIFEST.MF' filtering='true'/>
</target>
<target name="cleanxx" depends='init'>
<delete dir='${eclipseplugin-dir}' failonerror='false'/>
<delete file='${eclipseplugin-zip}' failonerror='false'/>
</target>
<target name='eclipse.plugins-check' unless='eclipse.plugins-exists'>
<echo>
* ********** WARNING!!! *************
* Can't find ECLIPSE IDE folder.
* Eclipse libraries are used to compile EclipseColorer plugin.
*
* If you have these files, please fix 'build.properties'
* file in colorer root directory and restart building.
* You can ignore this build error, removing 'fail-on-bad-paths'
* property from the 'build.properties' file.
</echo>
<fail if='fail-on-badpaths'>
******** Build stopped because of bad Eclipse IDE paths.
</fail>
</target>
<target name="build.update.jar" depends="init" description="Build the plug-in: net.sf.colorer for an update site.">
<delete dir="${temp.folder}"/>
<mkdir dir="${temp.folder}"/>
<antcall target="build.jars"/>
<antcall target="gather.bin.parts">
<param name="destination.temp.folder" value="${temp.folder}/"/>
</antcall>
<delete dir="${temp.folder}"/>
</target>
<target name="gather.bin.parts" depends="init" if="destination.temp.folder">
<mkdir dir="${destination.temp.folder}/${full.name}"/>
<copy file="${build.result.folder}/colorer.jar" todir="${destination.temp.folder}/${full.name}"/>
<copy todir="${destination.temp.folder}/${full.name}">
<fileset dir="${resource-dir}" includes="META-INF/MANIFEST.MF,plugin.properties,plugin.xml,plugin_ru.properties,about.ini,welcome.xml"/><!-- toc.xml -->
<fileset dir="${resource-dir}" includes="icons/**/*.gif"/>
</copy>
<copy file="distr/logo-colorer.png" todir="${destination.temp.folder}/${full.name}/icons"/>
</target>
<target name="colorer.jar" depends="init" unless="colorer.jar" description="Create jar: colorer.jar.">
<property name="destdir" value="${temp.folder}/colorer.jar.bin"/>
<delete dir="${temp.folder}/colorer.jar.bin"/>
<mkdir dir="${temp.folder}/colorer.jar.bin"/>
<!-- compile the source code -->
<javac destdir="${temp.folder}/colorer.jar.bin" failonerror="${javacFailOnError}" source="1.3" target="1.1" verbose="${javacVerbose}" debug="${javacDebugInfo}" includeAntRuntime="no" bootclasspath="${bootclasspath}" classpathref="classpath">
<src path="src/main/java"/>
</javac>
<!-- copy necessary resources -->
<copy todir="${temp.folder}/colorer.jar.bin">
<fileset dir="src/main/java" excludes="**/*.java"/>
</copy>
<mkdir dir="${build.result.folder}"/>
<jar jarfile="${build.result.folder}/colorer.jar" basedir="${temp.folder}/colorer.jar.bin"/>
<delete dir="${temp.folder}/colorer.jar.bin"/>
</target>
<target name="src.zip" depends="init" unless="colorer.jar">
<mkdir dir="${build.result.folder}"/>
<zip zipfile="${build.result.folder}/src.zip" filesonly="false" update="no">
<fileset dir="." includes="src/**/*.java, src/**/*.prop*, src/**/*.htm*, plugin*, build.*, .*, javadoc.xml"/>
</zip>
</target>
<target name="build.jars" depends="init" description="Build all the jars for the plug-in: net.sf.colorer.">
<uptodate property="colorer.jar" targetfile="${build.result.folder}/colorer.jar">
<srcfiles dir= "src" includes="**/*"/>
</uptodate>
<antcall target="colorer.jar"/>
</target>
<target name="build.sources" depends="init">
<available property="src.zip" file="${build.result.folder}/src.zip"/>
<antcall target="src.zip"/>
</target>
<target name="gather.sources" depends="init" if="destination.temp.folder">
<mkdir dir="${destination.temp.folder}/${full.name}"/>
<copy file="${build.result.folder}/src.zip" todir="${destination.temp.folder}/${full.name}"/>
</target>
<target name="gather.logs" depends="init" if="destination.temp.folder">
<mkdir dir="${destination.temp.folder}/${full.name}"/>
<copy file="${temp.folder}/colorer.jar.bin.log" todir="${destination.temp.folder}/${full.name}"/>
</target>
<target name="clean" description="Clean the plug-in: net.sf.colorer of all the zips, jars and logs created.">
<delete file="${build.result.folder}/colorer.jar" failonerror='false'/>
<delete file="${build.result.folder}/src.zip" failonerror='false'/>
<delete file="${build-dir}/${full.name}.jar" failonerror='false'/>
<delete file="${build-dir}/${full.name}.zip" failonerror='false'/>
<delete dir="${temp.folder}" failonerror='false'/>
<exec executable="cmd" dir="schemes">
<arg value="/c"/>
<arg value="build.cmd"/>
<arg value="clean"/>
</exec>
</target>
<target name="refresh" depends="init" if="eclipse.running">
<eclipse.convertPath fileSystemPath="C:\Program Files\eclipse\workspace\net.sf.colorer\" property="resourcePath"/>
<eclipse.refreshLocal resource="${resourcePath}" depth="infinite"/>
</target>
<target name="gather" depends="init, update-version" description="Create a directory, containing all the elements for the plug-in: net.sf.colorer.">
<antcall target='clean'/>
<antcall target='eclipse.plugins-check'/>
<antcall target="build.jars"/>
<antcall target="build.sources"/>
<antcall target="gather.bin.parts">
<param name="destination.temp.folder" value="${temp.folder}/"/>
</antcall>
<copy todir="${temp.folder}/${full.name}/os">
<fileset dir="distr/os"/>
</copy>
<!--
<antcall target="gather.sources">
<param name="destination.temp.folder" value="${temp.folder}/"/>
</antcall>
<exec dir='${basedir}/libnative' executable='${make}' failonerror='${fail-on-bad-build}'>
<arg line='${makefile}'/>
<env key='Path' path='${native-path}:${java.library.path}'/>
</exec>
-->
<!-- handle native library -
<mkdir dir='${eclipseplugin-dir}'/>
-->
<mkdir dir='${temp.folder}/${full.name}/colorer'/>
<exec executable="cmd" dir="schemes">
<arg value="/c"/>
<arg value="build.cmd"/>
<arg value="base.pack"/>
</exec>
<mkdir dir='${temp.folder}/${full.name}/colorer/hrc'/>
<copy todir='${temp.folder}/${full.name}/colorer/hrc'>
<fileset dir='schemes/build/basep/hrc' includes='**'/>
</copy>
<mkdir dir='${temp.folder}/${full.name}/colorer/hrd/rgb'/>
<copy todir='${temp.folder}/${full.name}/colorer/hrd/rgb'>
<fileset dir='schemes/build/basep/hrd/rgb' includes='**'/>
</copy>
<copy todir='${temp.folder}/${full.name}/colorer/hrd'>
<fileset dir='schemes/build/basep/hrd' includes='*.xml'/>
</copy>
<copy file='distr/catalog.xml' todir='${temp.folder}/${full.name}/colorer'/>
<antcall target="zip.folder">
</antcall>
<mkdir dir='${build-dir}/update/features'/>
<mkdir dir='${build-dir}/update/plugins'/>
<zip destfile='${build-dir}/update/features/${full.name}.jar'>
<fileset dir='${resource-dir}' includes='feature.xml'/>
<fileset dir='distr' includes='MPL-1.1.html'/>
<fileset dir='distr' includes='logo-colorer.png'/>
</zip>
<zip destfile='${build-dir}/update/plugins/${full.name}.jar'>
<fileset dir='${temp.folder}/${full.name}'/>
</zip>
<copy todir='${build-dir}/update'>
<fileset dir='${resource-dir}/' includes='site.xml'/>
</copy>
<delete>
<fileset dir="${temp.folder}" includes="**/*.bin.log"/>
</delete>
</target>
<target name="zip.folder" depends="init">
<zip zipfile="${build-dir}/${release-zip}" filesonly="true" update="no" excludes="**/*.bin.log">
<fileset dir='${temp.folder}/${full.name}'/>
</zip>
</target>
</project>