File: build.xml

package info (click to toggle)
pleiades 1.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 144,860 kB
  • ctags: 938
  • sloc: java: 7,163; xml: 1,361; sh: 52; makefile: 26
file content (538 lines) | stat: -rw-r--r-- 19,672 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
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
<?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 name="Pleiades" default="build.nightly">

	<!--
	================================================================================
	 プロパティー定義
	================================================================================
	-->

	<!-- 現在の Eclipse バージョン -->
	<property name="current.eclipse.version" value="4.4.0" />

	<!-- DIST バージョン置換 -->
	<property name="dist.eclipse.version" value="x.x" />
	<script language="javascript"><![CDATA[
		var version = project.getProperty("current.eclipse.version");
	    project.setProperty("dist.eclipse.version", version.replaceAll("..$", ""));
	]]></script>

	<!-- コピー先ディレクトリー -->
	<property name="bit" value="" />
	<property name="dist.dir" location="/dev/dist/e${dist.eclipse.version}${bit}" />
	<property name="tools.dir" value="/dev/tools" />
	<property name="eclipse.dir" value="${tools.dir}/eclipse" />
	<property name="this.eclipse.dir" location="${eclipse.dir}/${current.eclipse.version}/dropins/MergeDoc/eclipse" />

	<!-- プロダクト定数定義 -->
	<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.dir" value="${build.dir}/nightly" />
	<property name="pleiades.zip.file" location="${pleiades.zip.dir}/${project.name}.zip" />
	<property name="pleiades.src.zip.file" location="${pleiades.zip.dir}/${project.name}-src.zip" />

	<!-- プロジェクト・クラスパス -->
	<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>

	<!-- Windows の場合は true -->
	<condition property="is_win">
		<os family="windows" />
	</condition>

	<!--
	================================================================================
	 ビルド
	================================================================================
	-->

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

	<!-- 翻訳プロパティーの生成、ビルド、この Eclipse に zip ファイルをコピー -->
	<target name="generate.build.nightly" depends="generate, build.nightly" description="">
	</target>

	<!--
		翻訳プロパティーの生成(各プロパティーのマージ)既存訳を再最適化
		nls-ui-customized.properties を修正した場合は、実行が必要
	-->
	<target name="generate.clean" description="">
		<java classname="jp.sourceforge.mergedoc.pleiades.generator.Generator" failonerror="true" fork="yes" maxmemory="256m">
			<sysproperty key="file.encoding" value="UTF-8" />
			<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="">

		<!-- 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" />
                               <attribute name="Class-Path"
                                         value="/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/nls-ui-customized/" />
				<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="lib/build/" />
				<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}" />

		<!-- Pleiades バージョンを readme から取得 -->
		<loadfile property="pleiades.version" srcFile="readme/readme_pleiades_changes.txt">
			<filterchain>
				<linecontainsregexp><regexp pattern="^\d+\.\d+\.\d+.+" /></linecontainsregexp>
				<headfilter lines="1"/>
				<striplinebreaks/>
				<replaceregex pattern="\s.+" replace=""/>
			</filterchain>
		</loadfile>
		<echo>pleiades.version = ${pleiades.version}</echo>

		<!-- Pleiades バージョン日付を readme から取得し、ビルド・タイムスタンプ・ファイルを作成 -->
		<loadfile property="date" srcFile="readme/readme_pleiades_changes.txt">
			<filterchain>
				<linecontainsregexp><regexp pattern="^\d+\.\d+\.\d+.+" /></linecontainsregexp>
				<headfilter lines="1"/>
				<striplinebreaks/>
				<replaceregex pattern=".+\s(\d+)\.?(\w+?)\.?(\w+?)$" replace="\1\2\3"/>
			</filterchain>
		</loadfile>
		<echo>date = ${date}</echo>
		<touch file="pleiades-${pleiades.version}.I${date}" />

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

		<!-- JAR 署名 -->
		<jar destfile="plugins/${project.id}.jar" basedir="./plugins/${project.id}"
			manifest="plugins/${project.id}/META-INF/MANIFEST.MF"/>
		<jar destfile="features/${project.id}.jar" basedir="./features/${project.id}" />
		<signjar keystore=".keystore" alias="MergeDoc" storepass="mergedoc">
			<sysproperty key="file.encoding" value="UTF-8" />
			<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="${pleiades.zip.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/*" />
				<include name="pleiades-*" />
			</fileset>
		</zip>
		<delete dir="plugins" />
		<delete dir="features" />

		<delete>
			<fileset dir=".">
				<include name="pleiades-*" />
			</fileset>
		</delete>

	</target>

	<!-- signjar で使用する keystore 作成 -->
	<target name="keystore" if="is_win">
		<exec dir="." executable="cmd.exe">
			<arg line="/c .keystore.cmd" />
			<redirector inputencoding="MS932" outputencoding="MS932" />
		</exec>
	</target>

	<!-- リリース・ビルド (手動アップロードしてリリース一覧で管理) -->
	<target name="build.release" depends="test.unit, build.integration" description="">
		<copy tofile="../pleiades_${pleiades.version}.zip" file="${pleiades.zip.file}" overwrite="true" />
		<copy tofile="../pleiades_${pleiades.version}-src.zip" file="${pleiades.src.zip.file}" overwrite="true" />
	</target>

	<!-- 統合ビルド (~change.txt 記載、SVN コミット) -->
	<target name="build.integration" depends="test.unit, keystore, build.nightly" description="">
		<copy todir="${build.dir}" file="${pleiades.zip.file}" overwrite="true" />
		<copy todir="${build.dir}" file="${pleiades.src.zip.file}" overwrite="true" />
	</target>

	<!-- ナイトリー・ビルド - この Eclipse に zip ファイルをコピー -->
	<target name="build.nightly" depends="build, test.unit" description="">
		<copy todir="${this.eclipse.dir}" file="${pleiades.zip.file}" overwrite="true" />
	</target>

	<!--
	================================================================================
	 ビルド (コマンドライン用)
	================================================================================
	-->

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

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

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

	</target>

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

		<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, test.unit, build">
	</target>

	<!--
	================================================================================
	 テスト
	================================================================================
	-->

	<!-- ユニット・テスト -->
	<target name="prepare" depends="javac">
		<copy todir="bin">
			<fileset dir="${bin.dir}">
				<include name="**/*" />
			</fileset>
		</copy>
		<mkdir dir="bintest" />
		<javac srcdir="srctest" destdir="bintest" classpathref="project.classpath" encoding="UTF-8" source="1.5" target="1.5" />
	</target>

	<target name="test.unit" depends="prepare" 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="jp/**/*Test.java" />
					<exclude name="**/TestAll.java" />
				</fileset>
			</batchtest>
		</junit>

	</target>

	<!-- Eclipse 実行テスト -->
	<target name="test.4.x-64bit-generate" description="" depends="generate,build.nightly">
		<antcall target="test.run.dropins">
			<param name="test.target.dir" value="${eclipse.dir}/${current.eclipse.version}Test64bit" />
			<param name="test.target.exe" value="eclipse.exe" />
		</antcall>
	</target>
	<target name="test.4.x-64bit" description="" depends="build.nightly">
		<antcall target="test.run.dropins">
			<param name="test.target.dir" value="${eclipse.dir}/${current.eclipse.version}Test64bit" />
			<param name="test.target.exe" value="eclipse.exe" />
		</antcall>
	</target>
	<target name="test.4.x-32bit" description="" depends="build.nightly">
		<antcall target="test.run.dropins">
			<param name="test.target.dir" value="${eclipse.dir}/${current.eclipse.version}Test32bit" />
			<param name="test.target.exe" value="eclipse.exe" />
		</antcall>
	</target>
	<target name="test.3.x-64bit" description="" depends="build.nightly">
		<antcall target="test.run.dropins">
			<param name="test.target.dir" value="${eclipse.dir}/3.7.2Test64bit" />
			<param name="test.target.exe" value="eclipse.exe" />
		</antcall>
	</target>
	<target name="test.3.x-32bit" description="" depends="build.nightly">
		<antcall target="test.run.dropins">
			<param name="test.target.dir" value="${eclipse.dir}/3.7.2Test32bit" />
			<param name="test.target.exe" value="eclipse.exe" />
		</antcall>
	</target>
	<target name="test.adt" description="" depends="build.nightly">
		<antcall target="test.run">
			<param name="test.target.dir" value="${eclipse.dir}/adt/eclipse" />
			<param name="test.target.exe" value="eclipse.exe" />
		</antcall>
	</target>
	<target name="test.ultimate" description="" depends="build.nightly">
		<antcall target="test.run.dropins">
			<param name="test.target.dir" value="${dist.dir}/ultimate${bit}/eclipse" />
			<param name="test.target.exe" value="eclipse.exe" />
		</antcall>
	</target>
	<target name="test.platform" description="" depends="build.nightly">
		<antcall target="test.run.dropins">
			<param name="test.target.dir" value="${dist.dir}/platform${bit}/eclipse" />
			<param name="test.target.exe" value="eclipse.exe" />
		</antcall>
	</target>
	<target name="test.java-generate" description="" depends="generate,build.nightly">
		<antcall target="test.run.dropins">
			<param name="test.target.dir" value="${dist.dir}/java${bit}/eclipse" />
			<param name="test.target.exe" value="eclipse.exe" />
		</antcall>
	</target>
	<target name="test.java" description="" depends="build.nightly">
		<antcall target="test.run.dropins">
			<param name="test.target.dir" value="${dist.dir}/java${bit}/eclipse" />
			<param name="test.target.exe" value="eclipse.exe" />
		</antcall>
	</target>
	<target name="test.cpp" description="" depends="build.nightly">
		<antcall target="test.run.dropins">
			<param name="test.target.dir" value="${dist.dir}/cpp${bit}/eclipse" />
			<param name="test.target.exe" value="eclipse.exe" />
		</antcall>
	</target>
	<target name="test.php" description="" depends="build.nightly">
		<antcall target="test.run.dropins">
			<param name="test.target.dir" value="${dist.dir}/php${bit}/eclipse" />
			<param name="test.target.exe" value="eclipse.exe" />
		</antcall>
	</target>
	<target name="test.python" description="" depends="build.nightly">
		<antcall target="test.run.dropins">
			<param name="test.target.dir" value="${dist.dir}/python${bit}/eclipse" />
			<param name="test.target.exe" value="eclipse.exe" />
		</antcall>
	</target>

	<!-- Eclipse 実行テスト (全バージョン) -->
	<target name="test.all.version" description="" depends="
			build.nightly,
			test.cpp,
			test.java,
			test.php,
			test.platform,
			test.ultimate
		">
	</target>

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

		<delete includeemptydirs="true">
			<fileset dir="${test.target.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.target.dir}" />

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

	</target>

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

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

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

	</target>

	<!-- IDEA 実行 -->
	<target name="test.idea" description="" depends="build.nightly">

		<property name="app.dir" value="${tools.dir}/idea" />

		<delete includeemptydirs="true">
			<fileset dir="${app.dir}">
				<include name="plugins/${project.id}/" />
				<include name="bin/configuration/${project.id}/" />
			</fileset>
		</delete>

		<unzip src="${pleiades.zip.file}" dest="${app.dir}">
			<patternset>
				<include name="plugins/" />
			</patternset>
		</unzip>

		<exec executable="${app.dir}/bin/idea.exe" dir="${app.dir}" spawn="true" />

	</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>