-
Notifications
You must be signed in to change notification settings - Fork 18
/
build.xml
222 lines (189 loc) · 8.57 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
<!--
Copyright (C) 2009-2018 The Project Lombok Authors.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<project name="lombok.patcher" default="dist" xmlns:ivy="antlib:com.zwitserloot.ivyplusplus">
<property name="ivy.retrieve.pattern" value="lib/[conf]/[artifact].[ext]" />
<available classpath="lib/ivyplusplus.jar" classname="com.zwitserloot.ivyplusplus.EnsureVersion" property="ivyplusplus.available" />
<target name="download-ipp" unless="ivyplusplus.available">
<mkdir dir="lib" />
<get src="https://projectlombok.org/downloads/ivyplusplus.jar" dest="lib/ivyplusplus.jar" usetimestamp="true" />
</target>
<target name="load-ipp" depends="download-ipp">
<taskdef classpath="lib/ivyplusplus.jar" resource="com/zwitserloot/ivyplusplus/antlib.xml" uri="antlib:com.zwitserloot.ivyplusplus" />
<ivy:ensureippversion version="1.38" property="ivyplusplus.minimumAvailable" />
</target>
<target name="redownload-ipp" unless="ivyplusplus.minimumAvailable">
<get src="https://projectlombok.org/downloads/ivyplusplus.jar" dest="lib/ivyplusplus.jar" />
<fail>A new version of ivyplusplus was required and has been downloaded. Rerun the script to continue.</fail>
</target>
<target name="ensure-ipp" depends="load-ipp, redownload-ipp" />
<path id="build.path">
<fileset dir="lib/build">
<include name="*.jar" />
</fileset>
</path>
<path id="runtime.path">
<fileset dir="lib/runtime">
<include name="*.jar" />
</fileset>
</path>
<path id="runtimeInjector.path">
<fileset dir="lib/runtimeInjector">
<include name="*.jar" />
</fileset>
</path>
<path id="test.path">
<fileset dir="lib/test">
<include name="*.jar" />
</fileset>
</path>
<target name="-pointlessCheck">
<uptodate property="pointless" targetfile="dist/lombok-patcher.jar">
<srcfiles dir="." includes="src/**/*.java test/**/*.java lib/build/** lib/runtime/**" />
</uptodate>
</target>
<target name="clean" description="Deletes build artefacts.">
<delete dir="build" quiet="true" />
<delete dir="lib/runtime" quiet="true" />
<delete dir="lib/runtimeInjector" quiet="true" />
<delete dir="lib/build" quiet="true" />
<delete dir="lib/test" quiet="true" />
<delete dir="lib/contrib" quiet="true" />
</target>
<target name="distclean" depends="clean" description="Deletes everything downloaded or built by this script.">
<delete dir="dist" quiet="true" />
<delete dir="lib" quiet="true" />
<delete file=".classpath" quiet="true" />
<delete file=".project" quiet="true" />
<delete dir=".settings" quiet="true" />
</target>
<target name="version" depends="ensure-ipp" description="Shows the version number.">
<mkdir dir="build/pack" />
<ivy:compile srcdir="src/patcher" destdir="build/pack" target="1.5" source="1.5" ecj="true" includes="lombok/patcher/Version.java" />
<java
classname="lombok.patcher.Version"
classpath="build/pack"
failonerror="true"
output="build/version.txt" />
<ivy:loadversion property="lombok.patcher.version" file="build/version.txt" />
<echo level="info">Lombok patcher version: ${lombok.patcher.version}</echo>
</target>
<target name="unpackLibs" depends="ensureRuntimeDeps, ensureRuntimeInjectorDeps" unless="pointless">
<unjar dest="build/pack">
<path refid="runtime.path" />
</unjar>
<unjar dest="build/packInjector">
<path refid="runtimeInjector.path" />
</unjar>
<delete file="build/pack/module-info.class" quiet="true" />
</target>
<target name="compile" depends="unpackLibs, ensureBuildDeps" description="Compiles lombok.patcher" unless="pointless">
<ivy:compile destdir="build/pack" target="1.5" source="1.5" ecj="true">
<src path="src/patcher" />
<classpath refid="build.path" />
</ivy:compile>
<ivy:compile destdir="build/pack" target="1.5" source="1.5" ecj="true">
<src path="src/injector" />
<classpath path="build/pack" />
<classpath refid="build.path" />
</ivy:compile>
</target>
<target name="compileTests" depends="compile, ensureTestDeps" description="Compiles the unit tests" unless="skipTests">
<ivy:compile destdir="build/tests" target="1.5" source="1.5" ecj="true">
<src path="test" />
<classpath path="build/pack" />
<classpath refid="test.path" />
</ivy:compile>
</target>
<target name="-test.quiet">
<property name="tests.quiet" value="true" />
</target>
<target name="-test-setup">
<condition property="skipTests">
<isset property="pointless" />
</condition>
</target>
<target name="-test" depends="-test-setup, compileTests" unless="skipTests">
<junit haltonfailure="yes" fork="on">
<formatter type="plain" usefile="false" unless="tests.quiet" />
<classpath path="build/pack" />
<classpath path="build/tests" />
<classpath refid="test.path" />
<batchtest>
<fileset dir="test">
<include name="**/Test*.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="test" depends="-test" description="Runs the unit tests" />
<target name="dist" depends="-pointlessCheck, -test.quiet, -test, version, compile" unless="pointless" description="Creates the distributable">
<mkdir dir="dist" />
<jar basedir="build/pack" destfile="dist/lombok.patcher-${lombok.patcher.version}.jar" />
<jar destfile="dist/lombok.injector-${lombok.patcher.version}.jar">
<fileset dir="build/pack" />
<fileset dir="build/packInjector" />
</jar>
<copy file="dist/lombok.patcher-${lombok.patcher.version}.jar" tofile="dist/lombok.patcher.jar" />
</target>
<target name="config-ivy" depends="ensure-ipp">
<ivy:configure file="buildScripts/ivysettings.xml" />
</target>
<target name="deps" depends="ensureBuildDeps, ensureRuntimeDeps, ensureTestDeps" />
<target name="ensureBuildDeps" depends="config-ivy">
<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="build" />
<ivy:retrieve />
</target>
<target name="ensureRuntimeDeps" depends="config-ivy">
<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="runtime" />
<ivy:retrieve />
</target>
<target name="ensureRuntimeInjectorDeps" depends="config-ivy">
<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="runtimeInjector" />
<ivy:retrieve />
</target>
<target name="ensureTestDeps" depends="config-ivy">
<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="test" />
<ivy:retrieve />
</target>
<target name="contrib" depends="config-ivy" description="Downloads and builds useful but optional extras, such as sources to used libraries.">
<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="contrib" />
<ivy:retrieve />
</target>
<target name="show-dep-report" depends="ensureRuntimeDeps" description="Displays a dependencies report">
<ivy:show-dep-report />
</target>
<target name="publish" depends="dist" description="Creates distributable and uploads to projectlombok.org">
<echo>automated uploading and deployment temporarily disabled. Upload dist/lombok.patcher-${lombok.patcher.version}.jar to the server and deploy manually.</echo>
</target>
<target name="eclipse" depends="deps, contrib" description="Creates eclipse project files and downloads all dependencies. Open this directory as project in eclipse after running this target.">
<ivy:eclipsegen source="1.5">
<srcdir dir="src/patcher" />
<srcdir dir="src/injector" />
<srcdir dir="test" />
<conf name="build" sources="contrib" />
<conf name="test" sources="contrib" />
<export org="org.ow2.asm" name="asm" />
<export org="org.ow2.asm" name="asm-tree" />
<export org="org.ow2.asm" name="asm-commons" />
<settings>
<url url="https://projectlombok.org/downloads/lombok.eclipse.settings" />
</settings>
</ivy:eclipsegen>
</target>
</project>