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
|
<!--
Copyright (C) 2020 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.info" basedir=".." default="quickstart">
<target name="quickstart">
<echo>
Dear contributor,
For full instructions and information on what this project contains, run:
> ant help
If you want to get started quickly:
1. Run `ant eclipse`.
2. Start up eclipse (https://www.eclipse.org/).
3. In the menu: File > Import... > Existing Project Into Workspace
4. Browse to this directory and import it:
(${basedir})
5. In eclipse: Run > Debug configurations... >
then pick one of the configs named `Lombok test`.
6. Run `ant dist`.
Have fun!</echo>
</target>
<target name="help" description="Start here!">
<echo>
Just want to get started quickly? Run:
> ant quickstart
---
Lombok is specced to run on a wide array of underlying platforms:
* Any JVM from 1.6 up to the upcoming next official release.
* Javac, from 1.6 up to the upcoming next official release.
* ECJ, from ecj 4.4.2 (2015/java8) up to the upcoming next official release.
* Eclipse, from eclipse-oxygen up to the upcoming next official release.
The build is a little more complicated to cater to these requirements.
This build script can perform the following tasks:
* IDE
Create project files so that you can work on lombok in eclipse or intellij.
Includes creating debuggable test targets.
* compile
Turn java files into class files.
* test
Run the tests against the various combinations of VM, Javac, eclipse and ecj
we support, including finding suitable VMs to run them on.
* packaging
Create the lombok 'everything' jar, that can serve as eclipse agent, as
installer, as library you include on the classpath with javac, and which
does not inject its transitive dependencies into your project namespace.
* website
Builds the website and documentation (projectlombok.org) from templates,
including creating the version history page and changelog, and deploying
builds to the website (and the maven repo hosted there).
* p2
We host an experimental eclipse marketplace installer.
For more info on any of these sections, run for example `ant help.IDE`.
If you're new to lombok, you should start with `ant help.IDE`,
then move on to `ant help.test`.</echo>
</target>
<target name="help.IDE">
<echo>
We strongly suggest you use eclipse to develop lombok.
Experimentally, developing with intellij is possible as well.
IDE support consists of two features:
1. Generate project files so that this directory can be imported as project.
2. Generate debug/run launch files so you can debug lombok in your IDE.
> ant eclipse
> ant intellij
These commands generate project files and download all dependencies required
to develop Project Lombok in the named IDE. Run these commands first, then
import this directory as project in your IDE.
> ant eclipse.testtarget.eclipse
> ant eclipse.testtarget.ecj
> ant eclipse.testtarget.javac
These 3 commands generate launch targets (these appear in your debug menu),
for testing the stated platform (eclipse, ecj, or javac) and will ask you
which version of the VM and the relevant platform are to be targeted by
these tests. Note that `ant eclipse` already generates default test targets,
you don't need these unless you're specifically testing lombok behaviour on
some specific version of the JVM or a target platform.
NB: No debug/launch targets are currently generated for intellij.
Got the know how? We'd love a contribution!</echo>
</target>
<target name="help.compile">
<echo>
The build compilation system is self contained and generally invoked by the
other jobs this build script can do; you rarely need to mess with it.
The compilation is quite complicated; parts of lombok are injected into
for example eclipse at runtime via an agent mechanism. To produce the bytecode
that is to be injected, we need to compile against various different versions
of the core java libraries as well as eclipse/ecj. To make this process smooth
and fast, lombok has a 'stubs' concept: We have signature-only versions of
various classes of other libraries. We compile these first, then we compile
the rest of lombok with these stub classes on the classpath, and then we
package lombok without the stubs.
Various bits of lombok are targeted at different versions, and therefore,
different parts of lombok are compiled with different `-release` targets.
> ant compile
Compiles lombok itself
> ant compile.support
Compiles code that isn't part of the lombok distribution, but which is used
for other jobs; For example, eclipse debug target generation, and fetching
the current lombok stable release version number on offer at
the projectlombok.org website involve java code.</echo>
</target>
<target name="help.packaging">
<echo>
Lombok is shipped as an 'everything' jar; it is a stand-alone java app,
with both a GUI and a command line interface, it's an agent, it's an
annotation processor, and it's a module.
In addition, lombok is a compile-time only dependency, designed to be included
in every project a lombok user has. Therefore, we don't want any of the
lombok classes that you aren't meant to use directly to be visible,
showing up in auto-complete dialogs. Starting with JDK9, the module system's
'export' feature does a lot of this, but we also want to avoid contaminating
things on JDK8 and below. As a consequence, lombok uses a classloader system,
and most classes are included in the jar with a different name, not as
.class files, thus avoiding contaminating the namespace.
The packaging targets take care of setting up the file rename as well as
registering all the various manifest and file entries needed so that lombok
can be an everything jar.
> ant dist
packages the lombok build into a single jar.
> ant maven
> ant maven.publish
'maven' packages the lombok build ready to upload to mavencentral (sonatype).
'maven.publish' also sends this via the lombok server to oss.sonatype.org.
</echo>
</target>
<target name="help.test">
<echo>
Lombok tests need to be run against a targeted platform.
> ant test.javacCurrent
> ant test.javac6
> ant test.javac8
> ant test.javac11
> ant test.javac14
This runs the test suite that tests lombok on javac, as well as testing
the delombok feature.
`javacCurrent` runs the tests on the JVM running this build: ${ant.java.version}
`javac6` and `javac8` are run on the JVM running this build, by downloading
the complete java runtime classes from those versions, including javac, and
using module limits to exclude your VM's own javac.
You _DO NOT_ need an installed JDK1.6 or JDK1.8 to run these.
`javac11`, `javac14`, etc require that you have a JDK of that version
installed on your system. The build will automatically find such a JDK in most
cases; alternatively, the system will ask you to provide a path to them.
The tests are then run by invoking that VM to run them.
You can force a particular VM by making a file named `jvm.locations`, and putting
in it, for example:
j11 = /Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home
Or just enter the path your VM installation when prompted, and the build will
automatically create this file for you to remember your choice.
> ant test.eclipse-oxygen
> ant test.eclipse-202006
This runs the test suite that tests lombok on eclipse/ecj.
The tests are run on your current VM (${ant.java.version}), fetching
the relevant bits of the chosen eclipse release to test against.
> ant test
Runs the 'default' targets for all supported platforms. This should catch
most problems.
> ant test.broad
Runs tests against a selection of versions designed to catch virtually all
problems. Doesn't quite test _every_ supported combination.
> ant test.compile
Compiles the test suite; generally invoked by the other test targets;
you don't need to explicitly invoke this yourself.</echo>
</target>
<target name="help.website">
<echo>
This build also builds the website, which is a static site generated via
freemarker templates. Parts of the site build also involve other custom
software, such as building the 'all available versions' page by checking
the available versions on the live website, compiling markdown
(as used by the changelog) into html, and generated color-coded syntax
in HTML for the example snippets.
> ant changelog.build
Turns the changelog at doc/changelog.markdown into
build/website/changelog.html.
> ant website.build
> ant website.release-build
> ant website.publish
> ant website.release-publish
'build' Builds the website into build/website, _without_ reflecting a new release; this is
just in case you e.g. edited some documentation.
'publish' deploys this to the server.
'release-build' builds the website _with_ reflecting a new release, updating all-versions,
the download page, updating the javadoc, etc.
'release-ppublic' deploys this to the server.
> ant website.open
First builds the website, then hosts it locally and opens it in your browser so
you can see the website in its full, template-applied form.
> ant latest-changes.build
Makes a changelog variant that lists only the newest changes; it is included
in the distribution for convenience.
> ant javadoc.build
'build' Builds the javadoc into build/api.
> ant edge.publish
'pack' creates a bzip with all relevant files needed to deploy a new edge
release to the server: A fresh build of the lombok everything jar, plus the
maven repo update so that the edge release can be fetched as a maven dep,
and an update to the download-edge page listing the latest changes included
in the edge release.
'publish' sends the edge release to projectlombok.org directly.</echo>
</target>
<target name="help.p2">
<echo>
This is still an experimental feature.
We ship lombok as an eclipse plugin. The plugin isn't much of a plugin; the
install script of the plugin fulfills the same role as lombok's installer
(which is: add a line configuring lombok as an agent during eclipse bootup),
and the uninstall script removes it.
> ant eclipsep2.build
> ant eclipsep2.pack
> ant eclipsep2.publish
'build' generates the various files required to appear as an eclipse plugin,
and makes the jar(s).
'pack' makes a bzip ready to ship to a server.
'publish' ships it and runs a script server-side to put these files in the
right place; requires SSH access to the server.</echo>
</target>
</project>
|