-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathbuild.xml
More file actions
106 lines (99 loc) · 4.09 KB
/
build.xml
File metadata and controls
106 lines (99 loc) · 4.09 KB
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
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Copyright 2008 by Emeric Vernat
*
* This file is part of Dead Code Detector.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<project basedir="." default="all" name="DCD">
<!-- Initialisation des tâches -->
<target name="init">
<echo message="-- Script Ant DCD --" level="info" />
<echo message="Basedir: ${basedir}" level="info" />
<echo message="Ant file: ${ant.file}" level="info" />
<echo message="Ant home: ${ant.home}" level="info" />
<echo message="${ant.version}" level="info" />
<echo message="${java.runtime.name}, ${java.runtime.version}" level="info" />
<echo message="${os.name} ${sun.os.patch.level}, ${os.arch}/${sun.arch.data.model}" level="info" />
<tstamp>
<format property="TODAY_FR" pattern="dd MMMM yyyy HH:mm:ss" locale="fr,FR" />
</tstamp>
<echo message="${TODAY_FR}" level="info" />
</target>
<!-- Compilation -->
<target name="build" depends="init">
<echo message="Compilation" level="info" />
<mkdir dir="build" />
<javac debug="on" deprecation="on" encoding="UTF-8" nowarn="off" source="1.7" target="1.7" includeantruntime="false"
srcdir="src/main/java" destdir="build">
<classpath>
<fileset dir="src/main/lib" includes="*.jar" />
</classpath>
</javac>
</target>
<!-- Nettoyage du répertoire de compilation, du jar -->
<target name="clean" depends="init">
<echo message="Nettoyage du répertoire de compilation, du jar" level="info" />
<delete dir="build" />
<delete file="dcd.jar" />
</target>
<!-- Construction du jar -->
<target name="jar" depends="build">
<echo message="Construction du jar" level="info" />
<delete file="dcd.jar" />
<jar destfile="dcd.jar">
<zipfileset dir="build" />
<zipfileset dir="src/main/resources" />
<zipfileset dir="." includes="LICENSE*" />
<manifest>
<attribute name="Main-Class" value="dcd.ui.DeadCodeDetectorUI" />
<attribute name="Built-By" value="${user.name}" />
<attribute name="Built-Date" value="${TODAY_FR}" />
<section name="dcd">
<attribute name="Implementation-Title" value="Dead Code Detector" />
<attribute name="Implementation-Vendor" value="Emeric Vernat" />
</section>
</manifest>
</jar>
<!-- si taille importante, on pourrait utiliser pack200 ainsi :
<taskdef name="pack200" classname="com.sun.tools.apache.ant.pack200.Pack200Task" classpath="Ant/lib/Pack200Task.jar" />
// segmentlimit=-1 est nécessaire pour éviter pb de signature
<pack200 src="@{file}" destfile="@{file}.repack.jar" repack="true" segmentlimit="-1" />
<move file="@{file}.repack.jar" tofile="@{file}" /> -->
<!-- le certificat est autosigné selon
http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/development.html#security -->
<signjar jar="dcd.jar" alias="evernat" keystore="evernat.jks" storetype="jks" storepass="evernat" />
<!-- storetype="pkcs12" si vrai certificat de Thawte ou VeriSign -->
</target>
<!-- Construction du zip -->
<target name="zip" depends="jar">
<echo message="Construction du zip" level="info" />
<delete file="dcd.zip" />
<zip destfile="dcd.zip">
<zipfileset dir="." excludes="classes/**,build/**,target/**,dcd.zip" />
</zip>
</target>
<!-- Tout (zip,clean) -->
<target name="all" depends="zip,clean" />
<!-- Affichage de l'interface graphique de la recherche de code mort -->
<target name="dcd-ui" depends="build">
<java fork="yes" classname="dcd.ui.DeadCodeDetectorUI">
<classpath>
<dirset dir="build" />
<dirset dir="src/main/resources" />
<fileset dir="src/main/lib" includes="*.jar" />
</classpath>
</java>
</target>
</project>