From 0bbedd092a1f0f506d106943b4b400c7986c5f36 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Fri, 29 May 2020 00:17:20 +0200 Subject: [build] rewriting the build system --- buildScripts/build-support.ant.xml | 113 +++++++ buildScripts/compile.ant.xml | 309 ++++++++++++++++++ buildScripts/create-eclipse-project.ant.xml | 182 +++++++++++ buildScripts/create-intellij-project.ant.xml | 59 ++++ buildScripts/eclipse-debug-target.template | 35 -- buildScripts/eclipse-p2.ant.xml | 43 ++- buildScripts/eclipse-run-tests.template | 30 -- buildScripts/info.ant.xml | 306 ++++++++++++++++++ ...t.java.openjdk.custom-javac11-11_2018-09-25.xml | 13 + ...t.java.openjdk.custom-javac13-13_2019-09-17.xml | 12 + ...ava.openjdk.custom-javac14-14-ea_2020-03-17.xml | 12 + .../net.java.openjdk.custom-javac8-1.8.0.xml | 12 + .../org.eclipse.custom-core.jobs-3.5.200.xml | 14 - .../org.eclipse.custom-core.jobs-3.5.300.xml | 14 - .../org.eclipse.custom-core.resources-3.7.0.xml | 14 - .../org.eclipse.custom-core.resources-3.8.100.xml | 14 - .../org.eclipse.custom-core.runtime-3.6.0.xml | 14 - .../org.eclipse.custom-core.runtime-3.9.0.xml | 14 - .../ivy-repo/org.eclipse.custom-ecj-3.6.2.xml | 14 - .../ivy-repo/org.eclipse.custom-ecj-4.3.1.xml | 14 - .../ivy-repo/org.eclipse.custom-ecj-I20140430.xml | 14 - .../org.eclipse.custom-equinox.common-3.6.0.xml | 14 - .../org.eclipse.custom-equinox.common-3.6.200.xml | 14 - .../ivy-repo/org.eclipse.custom-jdt.core-3.6.0.xml | 14 - .../ivy-repo/org.eclipse.custom-jdt.core-3.9.1.xml | 14 - .../ivy-repo/org.eclipse.custom-jdt.ui-3.6.0.xml | 14 - .../ivy-repo/org.eclipse.custom-jdt.ui-3.9.1.xml | 14 - .../ivy-repo/org.eclipse.custom-osgi-3.6.0.xml | 14 - .../ivy-repo/org.eclipse.custom-osgi-3.9.0.xml | 14 - buildScripts/ivy.xml | 139 +++++--- buildScripts/ivysettings.xml | 1 + buildScripts/mapstruct-old.ant.xml | 169 ++++++++++ buildScripts/maven.ant.xml | 126 ++++++++ buildScripts/setup.ant.xml | 175 ++++++++++ buildScripts/tests.ant.xml | 177 ++++++++++ buildScripts/vm-finder.ant.xml | 191 +++++++++++ buildScripts/website.ant.xml | 360 +++++++++++---------- 37 files changed, 2160 insertions(+), 542 deletions(-) create mode 100644 buildScripts/build-support.ant.xml create mode 100644 buildScripts/compile.ant.xml create mode 100644 buildScripts/create-eclipse-project.ant.xml create mode 100644 buildScripts/create-intellij-project.ant.xml delete mode 100644 buildScripts/eclipse-debug-target.template delete mode 100644 buildScripts/eclipse-run-tests.template create mode 100644 buildScripts/info.ant.xml create mode 100644 buildScripts/ivy-repo/net.java.openjdk.custom-javac11-11_2018-09-25.xml create mode 100644 buildScripts/ivy-repo/net.java.openjdk.custom-javac13-13_2019-09-17.xml create mode 100644 buildScripts/ivy-repo/net.java.openjdk.custom-javac14-14-ea_2020-03-17.xml create mode 100644 buildScripts/ivy-repo/net.java.openjdk.custom-javac8-1.8.0.xml delete mode 100644 buildScripts/ivy-repo/org.eclipse.custom-core.jobs-3.5.200.xml delete mode 100644 buildScripts/ivy-repo/org.eclipse.custom-core.jobs-3.5.300.xml delete mode 100644 buildScripts/ivy-repo/org.eclipse.custom-core.resources-3.7.0.xml delete mode 100644 buildScripts/ivy-repo/org.eclipse.custom-core.resources-3.8.100.xml delete mode 100644 buildScripts/ivy-repo/org.eclipse.custom-core.runtime-3.6.0.xml delete mode 100644 buildScripts/ivy-repo/org.eclipse.custom-core.runtime-3.9.0.xml delete mode 100644 buildScripts/ivy-repo/org.eclipse.custom-ecj-3.6.2.xml delete mode 100644 buildScripts/ivy-repo/org.eclipse.custom-ecj-4.3.1.xml delete mode 100644 buildScripts/ivy-repo/org.eclipse.custom-ecj-I20140430.xml delete mode 100644 buildScripts/ivy-repo/org.eclipse.custom-equinox.common-3.6.0.xml delete mode 100644 buildScripts/ivy-repo/org.eclipse.custom-equinox.common-3.6.200.xml delete mode 100644 buildScripts/ivy-repo/org.eclipse.custom-jdt.core-3.6.0.xml delete mode 100644 buildScripts/ivy-repo/org.eclipse.custom-jdt.core-3.9.1.xml delete mode 100644 buildScripts/ivy-repo/org.eclipse.custom-jdt.ui-3.6.0.xml delete mode 100644 buildScripts/ivy-repo/org.eclipse.custom-jdt.ui-3.9.1.xml delete mode 100644 buildScripts/ivy-repo/org.eclipse.custom-osgi-3.6.0.xml delete mode 100644 buildScripts/ivy-repo/org.eclipse.custom-osgi-3.9.0.xml create mode 100644 buildScripts/mapstruct-old.ant.xml create mode 100644 buildScripts/maven.ant.xml create mode 100644 buildScripts/setup.ant.xml create mode 100644 buildScripts/tests.ant.xml create mode 100644 buildScripts/vm-finder.ant.xml (limited to 'buildScripts') diff --git a/buildScripts/build-support.ant.xml b/buildScripts/build-support.ant.xml new file mode 100644 index 00000000..107f5f47 --- /dev/null +++ b/buildScripts/build-support.ant.xml @@ -0,0 +1,113 @@ + + + +This buildfile is part of projectlombok.org. It is responsible for tasks that help with setting up the build infrastructure. +None of these tasks are normally needed, unless modifying how the build works, such as updating dependencies. + + + + + + + + + + + + You need to specify the JDK9+ jdk whose jdk.compiler and java.compiler modules are to be converted. Use -Dtarget.jdk.ver=14 to automate this, or type a version in now (for example: 11): + + + + Aborted (no version entered) + + + + + Using VM at: ${target.jdk} + + + + You need to specify the JDK9+ jdk whose jdk.compiler and java.compiler modules are to be converted. Run ant with -Dtarget.jdk=/full/path/here to automate this, or type the path in now (for example: /Library/JavaVirtualMachines/jdk-14.jdk/Contents/Home): + + + + + + + + + + This tool converts javac as stored in jmods of JDK distributions; JDK8 and below doesn't ship like that, and you don't need this for 8 and below. + + + + ${target.javac.version.full} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <ivy-module version="2.0"> + <info organisation="net.java.openjdk.custom" module="javac${target.javac.shortversion}" revision="${target.javac.version}" publication="${target.javac.pubstamp}"> + <license name="GNU General Public License v2 with Classpath Exception" url="https://openjdk.java.net/legal/gplv2+ce.html" /> + <description homepage="https://openjdk.java.net" /> + </info> + <configurations> + <conf name="runtime" /> + </configurations> + <publications> + <artifact name="javac${target.javac.shortversion}-java.compiler" conf="runtime" url="https://projectlombok.org/ivyrepo/langtools/javac${target.javac.version}-java.compiler.jar" /> + <artifact name="javac${target.javac.shortversion}-jdk.compiler" conf="runtime" url="https://projectlombok.org/ivyrepo/langtools/javac${target.javac.version}-jdk.compiler.jar" /> + </publications> +</ivy-module> + File build/javac${target.javac.version}-java.compiler.jar and build/javac${target.javac.version}-jdk.compiler.jar are available for upload; custom ivy target made as GAV net.java.openjdk.custom::javac${target.javac.shortversion}::${target.javac.version} + + diff --git a/buildScripts/compile.ant.xml b/buildScripts/compile.ant.xml new file mode 100644 index 00000000..a68d6dc1 --- /dev/null +++ b/buildScripts/compile.ant.xml @@ -0,0 +1,309 @@ + + + +This buildfile is part of projectlombok.org. It takes care of compiling and building lombok itself. + + + + + + + + + + + + + + + + + + + Lombok version: ${lombok.version} (${lombok.fullversion}) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + lombok.launch.AnnotationProcessorHider$AnnotationProcessor +lombok.launch.AnnotationProcessorHider$ClaimingProcessor + + lombok.launch.AnnotationProcessorHider$AnnotationProcessor,isolating +lombok.launch.AnnotationProcessorHider$ClaimingProcessor,isolating + + + + + + + + + + + + + + + + + + + + + + + ${release.timestamp} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/buildScripts/create-eclipse-project.ant.xml b/buildScripts/create-eclipse-project.ant.xml new file mode 100644 index 00000000..93eed3b0 --- /dev/null +++ b/buildScripts/create-eclipse-project.ant.xml @@ -0,0 +1,182 @@ + + + +This buildfile is part of projectlombok.org. It creates the infrastructure needed to develop lombok on eclipse. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/buildScripts/create-intellij-project.ant.xml b/buildScripts/create-intellij-project.ant.xml new file mode 100644 index 00000000..abb8c589 --- /dev/null +++ b/buildScripts/create-intellij-project.ant.xml @@ -0,0 +1,59 @@ + + + +This buildfile is part of projectlombok.org. It creates the infrastructure needed to develop lombok on intellij. + + + + ** WARNING ** The core lombok contributors all use eclipse to develop lombok. This script will attempt to set up your lombok directory up as intellij project; whether can be used in a modern intellij is currently unknown. Please do continue, but be aware that trying to work on lombok from intellij may run into problems. If you want to adopt 'work on lombok via intellij' as a task, we're open to it! + NOT IMPLEMENTED: The project should optimally be configured as a java1.6, using the rt.jar in lib/openjdk6_rt.jar as boot basis, to ensure lombok remains 1.6 compatible. + NOT IMPLEMENTED: Ability to run tests targeted at a specific jvm/javac/ecj/eclipse release; the relevant entrypoint test classes are lombok.RunBaseAndJavacTests and lombok.RunEclipseTests - you can run the eclipse tests even on intellij; an eclipse installation is not required. + Press return to continue + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/buildScripts/eclipse-debug-target.template b/buildScripts/eclipse-debug-target.template deleted file mode 100644 index 78e01575..00000000 --- a/buildScripts/eclipse-debug-target.template +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/buildScripts/eclipse-p2.ant.xml b/buildScripts/eclipse-p2.ant.xml index db33b674..75f6c4eb 100644 --- a/buildScripts/eclipse-p2.ant.xml +++ b/buildScripts/eclipse-p2.ant.xml @@ -19,25 +19,23 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --> - + This buildfile is part of projectlombok.org. It is responsible for building the eclipse P2 update site. - - - + - - - - + + + public class Epoch {public static void main(String[] args) {System.out.print(System.currentTimeMillis());}} + + - - + @@ -111,10 +109,25 @@ This buildfile is part of projectlombok.org. It is responsible for building the - - - public class Epoch {public static void main(String[] args) {System.out.print(System.currentTimeMillis());}} - - + + + + + + + + + diff --git a/buildScripts/eclipse-run-tests.template b/buildScripts/eclipse-run-tests.template deleted file mode 100644 index 0c00c236..00000000 --- a/buildScripts/eclipse-run-tests.template +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/buildScripts/info.ant.xml b/buildScripts/info.ant.xml new file mode 100644 index 00000000..55fea8af --- /dev/null +++ b/buildScripts/info.ant.xml @@ -0,0 +1,306 @@ + + + + +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! + + + + +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`. + + + + +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! + + + + +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. + + + + +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. + + + + + + +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. + + + + +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.pack + > ant website.publish + +'build' Builds the website (by for example applying freemarker templates) into +build/website. +'pack' bzips this up, ready to ship to the server. +'publish' sends this to the server and runs a script to deploy. + + > 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 + > ant javadoc.pack + > ant javadoc.publish + +'build' Builds the javadoc into build/api. +'pack' bzips this up, ready to ship to the server. +'publish' sends this to the server and runs a script to deploy. + + > ant edge.pack + > 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 this to the server, runs a script server-side to deploy the +content, and updates a git tag on success. + + + + +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. + + diff --git a/buildScripts/ivy-repo/net.java.openjdk.custom-javac11-11_2018-09-25.xml b/buildScripts/ivy-repo/net.java.openjdk.custom-javac11-11_2018-09-25.xml new file mode 100644 index 00000000..67b594da --- /dev/null +++ b/buildScripts/ivy-repo/net.java.openjdk.custom-javac11-11_2018-09-25.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/buildScripts/ivy-repo/net.java.openjdk.custom-javac13-13_2019-09-17.xml b/buildScripts/ivy-repo/net.java.openjdk.custom-javac13-13_2019-09-17.xml new file mode 100644 index 00000000..af861d7e --- /dev/null +++ b/buildScripts/ivy-repo/net.java.openjdk.custom-javac13-13_2019-09-17.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/buildScripts/ivy-repo/net.java.openjdk.custom-javac14-14-ea_2020-03-17.xml b/buildScripts/ivy-repo/net.java.openjdk.custom-javac14-14-ea_2020-03-17.xml new file mode 100644 index 00000000..175de028 --- /dev/null +++ b/buildScripts/ivy-repo/net.java.openjdk.custom-javac14-14-ea_2020-03-17.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/buildSc