File: build.xml

package info (click to toggle)
pleiades 1.3.1-dfsg-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 125,784 kB
  • ctags: 835
  • sloc: java: 6,562; xml: 1,341; makefile: 10
file content (472 lines) | stat: -rw-r--r-- 16,377 bytes parent folder | download
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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
<?xml version="1.0" encoding="UTF-8"?>
<!--
###############################################################################
#
# Copyright (c) 2005- Shinji Kashihara. All rights reserved.
# This program and the accompanying materials except for /lib directory are
# made available under the terms of the Eclipse Public License v1.0 which
# accompanies this distribution, and is available at /epl-v10.html.
#
###############################################################################
#
# Pleiades Ant ビルド・ファイル
#
###############################################################################
-->
<project default="build">

	<!-- Pleiades バージョン -->
	<property name="version" value="1.3.1"/>

	<!-- プロダクト定数定義 -->
	<property name="project.name" value="pleiades"/>
	<property name="project.id" value="jp.sourceforge.mergedoc.${project.name}"/>
	<property name="agent.jar.name" value="${project.name}.jar"/>

	<!-- ディレクトリー・ファイル定義 -->
	<property name="bin.dir" value="bin"/>
	<property name="build.dir" value="build"/>
	<property name="pleiades.zip.file" location="${build.dir}/${project.name}.zip"/>
	<property name="pleiades.src.zip.file" location="${build.dir}/${project.name}-src.zip"/>
	<property name="test.eclipse.plugin.dir" location="${test.eclipse.dir}/plugins"/>

	<!-- コピー先ディレクトリー -->
	<property name="dist.dir" location="../../dist/3.5"/>
	<property name="this.eclipse.dir" location="../../Tools/Eclipse3.5.1/dropins/MergeDoc/eclipse"/>

	<!-- プロジェクト・クラスパス -->
	<path id="project.classpath">
		<pathelement location="bin"/>
		<pathelement location="bintest"/>
		<pathelement location="srctest"/>
		<pathelement location="conf"/>
		<pathelement location="/usr/share/java/javassist.jar"/>
		<pathelement location="/usr/share/java/commons-io.jar"/>
		<pathelement location="/usr/share/java/commons-lang.jar"/>
		<pathelement location="/usr/share/java/junit.jar"/>
	</path>

	<!-- 翻訳プロパティーの生成(各プロパティーのマージ) -->
	<target name="generate" description="">
		<java
			classname="jp.sourceforge.mergedoc.pleiades.generator.Generator"
			failonerror="true"
			fork="yes"
			maxmemory="256m">
			<classpath refid="project.classpath"/>
		</java>
	</target>

	<!-- 翻訳プロパティーの生成(各プロパティーのマージ)既存訳を再最適化 -->
	<target name="generate-clean" description="">
		<java
			classname="jp.sourceforge.mergedoc.pleiades.generator.Generator"
			failonerror="true"
			fork="yes"
			maxmemory="256m">
			<classpath refid="project.classpath"/>
			<arg value="-clean"/>
		</java>
	</target>

	<!-- ヘルプ翻訳プロパティーの生成、翻訳プロパティーの生成 -->
	<!-- 再生成はもうしない。FIX する。
	<target name="generate-clean-help" description="">
		<java
			classname="jp.sourceforge.mergedoc.pleiades.generator.nls.HelpExtractor"
			failonerror="true"
			fork="yes"
			maxmemory="256m">
			<classpath refid="project.classpath"/>
		</java>
		<antcall target="generate-clean"/>
	</target>
	-->

	<!-- ビルド (SVN 管理) -->
	<target name="build" depends="" description="">

		<!-- Agent jar ファイル作成 -->
		<jar destfile="${agent.jar.name}">
			<fileset dir="${bin.dir}">
				<include name="**/${project.name}/**/*.class"/>
			</fileset>
			<manifest>
				<attribute name="Premain-Class"
					value="${project.id}.Pleiades"/>
				<attribute name="Boot-Class-Path"
					value="./${agent.jar.name} ./conf 
                                               /usr/share/java/javassist.jar
                                               /usr/share/java/commons-io.jar
                                               /usr/share/java/commons-lang.jar"/>
			</manifest>
		</jar>

		<!-- Agent jar を含んだリリース用作業フォルダー作成 -->
		<copy tofile="META-INF/MANIFEST.MF" file="META-INF/MANIFEST.MF.template" overwrite="true"/>
		<copy todir="plugins/${project.id}">
			<fileset dir="${basedir}">
				<exclude name="debian/"/>
				<exclude name=".pc/"/>
				<exclude name=".settings/*"/>
				<exclude name="about/"/>
				<exclude name="bin/"/>
				<exclude name="bintest/"/>
				<exclude name="nls/"/>
				<exclude name="report/"/>
				<exclude name="conf/props/additions/"/>
				<exclude name="conf/props/history/"/>
				<exclude name="conf/props/temp/"/>
				<exclude name="conf/props/no-*.properties"/>
				<exclude name="conf/props/nls-*.properties"/>
				<exclude name="conf/props/temp-*.properties"/>
				<exclude name="conf/props/validation-help-*.properties"/>
				<exclude name="conf/props/.*"/>
				<exclude name="conf/splash*.png"/>
				<exclude name="lib/**/*-src.zip"/>
				<exclude name="META-INF/MANIFEST.MF.template"/>
				<exclude name="src/"/>
				<exclude name="srctest/"/>
				<exclude name="readme/"/>
				<exclude name="build/"/>
				<exclude name=".*"/>
				<exclude name="build.xml"/>
				<exclude name="eclipse.*"/>
				<exclude name="pleiades_*.zip"/>
			</fileset>
		</copy>
		<copy todir="plugins/${project.id}">
			<fileset dir="${basedir}/about/plugins">
				<include name="**/*"/>
			</fileset>
		</copy>
		<copy todir="features/${project.id}">
			<fileset dir="${basedir}/about/features">
				<include name="**/*"/>
			</fileset>
		</copy>

		<!-- Agent jar ファイルの削除 -->
		<delete file="${agent.jar.name}"/>

		<!-- バージョンを設定 -->
		<replace file="plugins/${project.id}/META-INF/MANIFEST.MF"
			token="@version" value="${version}"/>
		<replace file="plugins/${project.id}/about.properties"
			token="@version" value="${version}"/>
		<replace file="plugins/${project.id}/plugin.xml"
			token="@version" value="${version}"/>
		<replace file="features/${project.id}/feature.xml"
			token="@version" value="${version}"/>

		<!-- 署名 -->
		<jar destfile="plugins/${project.id}.jar" basedir="./plugins/${project.id}"/>
		<jar destfile="features/${project.id}.jar" basedir="./features/${project.id}"/>
		<signjar keystore=".keystore" alias="MergeDoc" storepass="mergedoc">
			<fileset dir=".">
				<include name="*/${project.id}.jar"/>
			</fileset>
		</signjar>
		<unjar src="plugins/${project.id}.jar" dest="./plugins/${project.id}">
			<patternset>
				<include name="META-INF/*"/>
			</patternset>
		</unjar>
		<unjar src="features/${project.id}.jar" dest="./features/${project.id}">
			<patternset>
				<include name="META-INF/*"/>
			</patternset>
		</unjar>

		<!-- Pleiades zip ファイルの作成 -->
		<mkdir dir="${build.dir}"/>
		<delete file="${pleiades.zip.file}"/>
		<zip destfile="${pleiades.zip.file}">
			<fileset dir="${basedir}">
				<include name="plugins/${project.id}/**"/>
				<include name="features/${project.id}/**"/>
				<include name="eclipse.*"/>
				<include name="readme/*"/>
			</fileset>
		</zip>
		<delete dir="plugins"/>
		<delete dir="features"/>

		<!-- Pleiades zip ソース・ファイルの作成 -->
		<delete file="${pleiades.src.zip.file}"/>
		<zip destfile="${pleiades.src.zip.file}">
			<fileset dir="${basedir}">
				<!-- コマンド・ラインからビルド可能とするため class を含めておく
				<exclude name="bin/**/*"/>
				-->
				<exclude name="bintest/**/*"/>
				<exclude name="conf/props/history/"/>
				<exclude name="conf/props/temp/"/>
				<exclude name="conf/props/.*"/>
				<exclude name="nls/"/>
				<exclude name="report/"/>
				<exclude name="build/"/>
				<!-- コマンドでエラーになるため追加 -->
				<exclude name="features/"/>
				<exclude name="plugins/"/>
			</fileset>
		</zip>

	</target>

	<!-- クリーン (コマンドライン用) -->
	<target name="clean" depends="" description="">

		<delete dir="${bin.dir}" />
		<mkdir dir="${bin.dir}" />

		<delete dir="${build.dir}" />
		<mkdir dir="${build.dir}" />

	</target>

	<!-- ビルド (コマンドライン用) -->
	<target name="javac" depends="" description="">

		<mkdir dir="${bin.dir}" />
		<javac
			srcdir="src"
			destdir="${bin.dir}"
			classpathref="project.classpath"
			encoding="UTF-8"
			source="1.5"
			target="1.5"
			debug="on" />

	</target>

	<!-- ビルド (コマンドライン用) -->
	<target name="build.full" depends="clean, javac, build" description="">
	</target>

	<!-- リリース・ビルド (手動アップロードしてリリース一覧で管理) -->
	<target name="build.release" depends="test.unit, build" description="">

		<copy tofile="../pleiades_${version}.zip"		file="${pleiades.zip.file}"		overwrite="true" />
		<copy tofile="../pleiades_${version}-src.zip"	file="${pleiades.src.zip.file}"	overwrite="true" />

	</target>

	<!-- ビルド - この Eclipse に zip ファイルをコピー -->
	<target name="build.this.eclipse" depends="build, test.unit" description="">

		<copy todir="${this.eclipse.dir}"		file="${pleiades.zip.file}"		overwrite="true"/>

	</target>

	<!-- ユニット・テスト -->
	<target name="test.unit" description="">

		<mkdir dir="report"/>

		<junit printsummary="yes" haltonfailure="yes" fork="yes" maxmemory="256m" showoutput="no">
			<formatter type="xml" />
			<classpath refid="project.classpath"/>
			<batchtest fork="yes" todir="report">
				<fileset dir="srctest">
					<include name="**/*Test.java" />
					<exclude name="**/TestAll.java" />
				</fileset>
			</batchtest>
		</junit>

		<junitreport todir="report">
			<fileset dir="report">
				<include name="TEST-*.xml" />
			</fileset>
			<report format="frames" todir="report" />
		</junitreport>

	</target>

	<!-- Eclipse 実行テスト (全バージョン) -->
	<target name="test.all.version" description=""
		depends="
			build.this.eclipse,
			test.3.1.2,
			test.3.2.2,
			test.3.3.2,
			test.3.4.2,
			test.3.5.0
		">
	</target>

	<!-- Eclipse 実行テスト -->
	<target name="test.ultimate" description="" depends="build.this.eclipse">
		<antcall target="test.eclipse.dropins">
			<param name="test.eclipse.dir" value="${dist.dir}/ultimate/eclipse"/>
			<param name="test.eclipse.exe" value="eclipse.exe"/>
		</antcall>
	</target>
	<target name="test.platform" description="" depends="build.this.eclipse">
		<antcall target="test.eclipse.dropins">
			<param name="test.eclipse.dir" value="${dist.dir}/platform/eclipse"/>
			<param name="test.eclipse.exe" value="eclipse.exe"/>
		</antcall>
	</target>
	<target name="test.java" description="" depends="build.this.eclipse">
		<antcall target="test.eclipse.dropins">
			<param name="test.eclipse.dir" value="${dist.dir}/java/eclipse"/>
			<param name="test.eclipse.exe" value="eclipse.exe"/>
		</antcall>
	</target>
	<target name="test.cpp" description="" depends="build.this.eclipse">
		<antcall target="test.eclipse.dropins">
			<param name="test.eclipse.dir" value="${dist.dir}/cpp/eclipse"/>
			<param name="test.eclipse.exe" value="eclipse.exe"/>
		</antcall>
	</target>
	<target name="test.php" description="" depends="build.this.eclipse">
		<antcall target="test.eclipse.dropins">
			<param name="test.eclipse.dir" value="${dist.dir}/php/eclipse"/>
			<param name="test.eclipse.exe" value="eclipse.exe"/>
		</antcall>
	</target>
	<target name="test.ruby" description="" depends="build.this.eclipse">
		<antcall target="test.eclipse.dropins">
			<param name="test.eclipse.dir" value="${dist.dir}/ruby/eclipse"/>
			<param name="test.eclipse.exe" value="eclipse.exe"/>
		</antcall>
	</target>
	<target name="test.python" description="" depends="build.this.eclipse">
		<antcall target="test.eclipse.dropins">
			<param name="test.eclipse.dir" value="${dist.dir}/python/eclipse"/>
			<param name="test.eclipse.exe" value="eclipse.exe"/>
		</antcall>
	</target>
	<target name="test.3.1.2" description="" depends="build.this.eclipse">
		<antcall target="test.eclipse">
			<param name="test.eclipse.dir" value="../../Tools/Eclipse3.1.2Test"/>
			<param name="test.eclipse.exe" value="eclipse.exe"/>
		</antcall>
	</target>
	<target name="test.3.2.1" description="" depends="build.this.eclipse">
		<antcall target="test.eclipse">
			<param name="test.eclipse.dir" value="../../Tools/Eclipse3.2.1Test"/>
			<param name="test.eclipse.exe" value="eclipse.exe"/>
		</antcall>
	</target>
	<target name="test.3.2.2" description="" depends="build.this.eclipse">
		<antcall target="test.eclipse">
			<param name="test.eclipse.dir" value="../../Tools/Eclipse3.2.2Test"/>
			<param name="test.eclipse.exe" value="eclipse.exe"/>
		</antcall>
	</target>
	<target name="test.3.3.2" description="" depends="build.this.eclipse">
		<antcall target="test.eclipse">
			<param name="test.eclipse.dir" value="../../Tools/Eclipse3.3.2Test"/>
			<param name="test.eclipse.exe" value="eclipse.exe"/>
		</antcall>
	</target>
	<target name="test.3.4.2" description="" depends="build.this.eclipse">
		<antcall target="test.eclipse.dropins">
			<param name="test.eclipse.dir" value="../../Tools/Eclipse3.4.2Test"/>
			<param name="test.eclipse.exe" value="eclipse.exe"/>
		</antcall>
	</target>
	<target name="test.3.5.0" description="" depends="build.this.eclipse">
		<antcall target="test.eclipse.dropins">
			<param name="test.eclipse.dir" value="../../Tools/Eclipse3.5.0Test"/>
			<param name="test.eclipse.exe" value="eclipse.exe"/>
		</antcall>
	</target>
	<target name="test.3.5.1" description="" depends="build.this.eclipse">
		<antcall target="test.eclipse.dropins">
			<param name="test.eclipse.dir" value="../../Tools/Eclipse3.5.1Test"/>
			<param name="test.eclipse.exe" value="eclipse.exe"/>
		</antcall>
	</target>
	<target name="test.Aptana" description="" depends="build.this.eclipse">
		<antcall target="test.eclipse">
			<param name="test.eclipse.dir" value="../../Tools/aptana"/>
			<param name="test.eclipse.exe" value="AptanaStudio.exe"/>
		</antcall>
	</target>
	<target name="test.FlexBuilder" description="" depends="build.this.eclipse">
		<antcall target="test.eclipse">
			<param name="test.eclipse.dir" value="../../Tools/FlexBuilder3"/>
			<param name="test.eclipse.exe" value="FlexBuilder.exe"/>
		</antcall>
	</target>
	<target name="test.ApacheDirectoryStudio" description="" depends="build.this.eclipse">
		<antcall target="test.eclipse">
			<param name="test.eclipse.dir" value="../../Tools/Apache Directory Studio"/>
			<param name="test.eclipse.exe" value="Apache Directory Studio.exe"/>
		</antcall>
	</target>

	<!-- ビルドして Eclipse 実行(テスト環境を一旦削除してからコピー) -->
	<target name="test.eclipse">

		<delete includeemptydirs="true">
			<fileset dir="${test.eclipse.dir}">
				<include name="plugins/${project.id}/"/>
				<include name="features/${project.id}/"/>
				<include name="configuration/${project.id}/"/>
			</fileset>
		</delete>
		<unzip src="${pleiades.zip.file}" dest="${test.eclipse.dir}"/>

		<exec executable="${test.eclipse.dir}/${test.eclipse.exe}" dir="${test.eclipse.dir}" spawn="true">
			<arg value="-clean"/>
		</exec>

	</target>

	<!-- ビルドして Eclipse 実行(テスト環境を一旦削除してからコピー) -->
	<target name="test.eclipse.dropins">

		<delete includeemptydirs="true">
			<fileset dir="${test.eclipse.dir}/dropins/MergeDoc/eclipse">
				<include name="plugins/${project.id}/"/>
				<include name="features/${project.id}/"/>
			</fileset>
			<fileset dir="${test.eclipse.dir}">
				<include name="configuration/${project.id}/"/>
			</fileset>
		</delete>
		<unzip src="${pleiades.zip.file}" dest="${test.eclipse.dir}/dropins/MergeDoc/eclipse">
			<patternset>
				<exclude name="readme/" />
				<exclude name="*.cmd" />
			</patternset>
		</unzip>
		<copy todir="${test.eclipse.dir}/readme">
			<fileset dir="${basedir}/readme">
				<include name="**/*"/>
			</fileset>
		</copy>

		<exec executable="${test.eclipse.dir}/${test.eclipse.exe}" dir="${test.eclipse.dir}" spawn="true">
			<arg value="-clean"/>
		</exec>

	</target>

	<!--
	nls フォルダーのバックアップ時の長すぎるパスを回避するために不要な
	ファイルとディレクトリーを削除

		必要なファイルは下記のみ
			*.jar
			*.properties
			MANIFEST.MF
			fragment.xml
	-->
	<target name="clean.nls.dir" description="">
		<delete includeemptydirs="true">
			<fileset dir="${basedir}/nls">
				<exclude name="**/*.jar"/>
				<exclude name="**/*.properties"/>
				<exclude name="**/MANIFEST.MF"/>
				<exclude name="**/fragment.xml"/>
			</fileset>
		</delete>
	</target>

</project>