-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.xml
177 lines (159 loc) · 6.45 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
<project name="bluejcheckstyle" default="build.bindist" basedir=".">
<!-- set global properties for this build -->
<!-- Give user a chance to override without editing this file -->
<!-- (and without typing -D each time it compiles it) -->
<property file="checkstyle.buildproperties" />
<property file="${user.home}/checkstyle.buildproperties" />
<property name="bluejext.jar" value="lib/bluejext.jar" />
<property name="checkstyle-all.jar" value="lib/checkstyle-all.jar" />
<property name="dist.dir" value="target/dist" />
<property name="extension-version" value="5.4.1" />
<property name="extension" value="checkstyle-extension-${extension-version}" />
<property name="dist.extensions.dir" value="${dist.dir}/${extension}/lib/extensions"/>
<property name="dist.docs.dir" value="${dist.dir}/${extension}/docs/extensions/checkstyle"/>
<!-- add classes to generate Javadoc -->
<path id="javadoc.classpath">
<pathelement location="${ant.home}/lib/crimson.jar" />
<path refid="run.classpath" />
</path>
<path id="build.classpath">
<pathelement location="${bluejext.jar}" />
<pathelement location="${checkstyle-all.jar}" />
<pathelement location="${ant.home}/lib/ant.jar" />
</path>
<path id="run.classpath">
<pathelement location="target/checkstyle" />
<path refid="build.classpath" />
</path>
<target name="display.classpath" description="Displays the run classpath">
<property name="asd" refid="run.classpath" />
<echo message="Classpath is ${asd}" />
</target>
<!-- -->
<!-- Cleanup targets -->
<!-- -->
<target name="clean" description="Cleans any directories and generated files">
<delete dir="target" />
</target>
<!-- -->
<!-- COMPILE TARGETS -->
<!-- -->
<target name="compile.checkstyle"
description="Compiles the source code">
<mkdir dir="target/checkstyle" />
<javac srcdir="src/checkstyle"
destdir="target/checkstyle"
deprecation="on" debug="on"
classpathref="build.classpath">
<compilerarg value="-Xlint:unchecked"/>
</javac>
</target>
<!-- -->
<!-- DIST TARGETS -->
<!-- -->
<target name="build.extension" depends="compile.checkstyle"
description="Builds the extension jar file">
<mkdir dir="${dist.dir}" />
<mkdir dir="${dist.extensions.dir}" />
<jar jarfile="${dist.extensions.dir}/${extension}.jar"
manifest="config/manifest.mf"
update="false">
<fileset dir="target/checkstyle"/>
<fileset dir="docs">
<include name="*.xml"/>
</fileset>
<zipfileset src="${checkstyle-all.jar}">
<exclude name="META-INF/"/>
</zipfileset>
</jar>
<copy todir=".">
<fileset dir="${dist.extensions.dir}">
<include name="${extension}.jar"/>
</fileset>
</copy>
</target>
<target name="build.bindist" depends="build.extension,javadoc"
description="Builds the compressed distribution files">
<delete dir="${dist.extensions.dir}/checkstyle" />
<mkdir dir="${dist.extensions.dir}/checkstyle" />
<mkdir dir="${dist.docs.dir}" />
<!-- copy stuff without filtering -->
<copy todir="${dist.docs.dir}">
<fileset dir =".">
<include name="LICENSE*"/>
<include name="README"/>
<include name="RIGHTS.antlr"/>
<include name="contrib/**"/>
<include name="**/.cvsignore"/>
<include name="**/CVS"/>
</fileset>
<fileset dir="./docs">
<include name="**"/>
<exclude name="*.xml"/>
<exclude name="*.txt"/>
<exclude name="java.header"/>
</fileset>
</copy>
<copy todir="${dist.extensions.dir}/checkstyle">
<fileset dir="./docs">
<include name="*.xml"/>
<include name="java.header"/>
</fileset>
<fileset dir="./lib">
<include name="checkstyle*.jar"/>
</fileset>
</copy>
<!-- create the final zip & tar/gzip files -->
<zip zipfile="${dist.dir}/checkstyle-extension-${extension-version}.zip">
<fileset dir="${dist.dir}/${extension}">
<include name="**"/>
</fileset>
</zip>
<tar tarfile="${dist.dir}/checkstyle-extension-${extension-version}.tar" longfile="gnu"
basedir="${dist.dir}/${extension}" includes="**" />
<gzip zipfile="${dist.dir}/checkstyle-extension-${extension-version}.tar.gz"
src="${dist.dir}/checkstyle-extension-${extension-version}.tar" />
</target>
<target name="build.srcdist"
description="Builds the compressed source files for distribution">
<delete dir="${dist.dir}/checkstyle-extension-src-${extension-version}" />
<mkdir dir="${dist.dir}/checkstyle-extension-src-${extension-version}" />
<copy todir="${dist.dir}/checkstyle-extension-src-${extension-version}">
<fileset dir=".">
<include name="LICENSE*"/>
<include name="README"/>
<include name="TODO"/>
<include name="build.xml"/>
<include name="config/**"/>
<include name="docs/*"/>
<include name="${bluejext.jar}"/>
<include name="${checkstyle-all.jar}"/>
<include name="${checkstyle-optional.jar}"/>
<include name="src/**"/>
</fileset>
</copy>
<!-- Produce the final distributions -->
<zip zipfile="${dist.dir}/checkstyle-extension-src-${extension-version}.zip">
<fileset dir="${dist.dir}">
<include name="checkstyle-extension-src-${extension-version}/**"/>
</fileset>
</zip>
<tar tarfile="${dist.dir}/checkstyle-extension-src-${extension-version}.tar" longfile="gnu"
basedir="${dist.dir}" includes="checkstyle-extension-src-${extension-version}/**" />
<gzip zipfile="${dist.dir}/checkstyle-extension-src-${extension-version}.tar.gz"
src="${dist.dir}/checkstyle-extension-src-${extension-version}.tar" />
</target>
<target name="javadoc" depends="compile.checkstyle"
description="Creates the javadoc html files">
<mkdir dir="docs/api" />
<javadoc sourcepath="src/checkstyle" destdir="docs/api"
packagenames="com.puppycrawl.tools.checkstyle.*"
Windowtitle="Checkstyle Extension API"
classpathref="javadoc.classpath"
Use="true"
Footer="<a target="_top" href="./{@docRoot}/../index.html">Back to the Checkstyle Extension Home Page</a>">
<link href="https://docs.oracle.com/javase/8/docs/api/"/>
<link href="http://checkstyle.sourceforge.net/apidocs/"/>
</javadoc>
</target>
</project>