diff options
author | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2020-05-29 00:17:20 +0200 |
---|---|---|
committer | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2020-06-23 15:55:18 +0200 |
commit | 0bbedd092a1f0f506d106943b4b400c7986c5f36 (patch) | |
tree | f07bdd4d4c2d69bd7e204d8e15e99209106aee3b /buildScripts | |
parent | 22ac024abb3680b298bef78052f5a13239513b29 (diff) | |
download | lombok-0bbedd092a1f0f506d106943b4b400c7986c5f36.tar.gz lombok-0bbedd092a1f0f506d106943b4b400c7986c5f36.tar.bz2 lombok-0bbedd092a1f0f506d106943b4b400c7986c5f36.zip |
[build] rewriting the build system
Diffstat (limited to 'buildScripts')
37 files changed, 2160 insertions, 542 deletions
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 @@ +<!-- + Copyright (C) 2010-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.build-support" default="dist" xmlns:ivy="antlib:com.zwitserloot.ivyplusplus" basedir=".."> + <description> +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. + </description> + + <condition property="executable.suffix" value=".exe" else=""> + <os family="windows" /> + </condition> + + <condition property="java_home.exe" value="/usr/libexec/java_home"> + <os family="mac" /> + </condition> + + <target name="-ask.target-jdk.via-javahome" if="java_home.exe" unless="target.jdk"> + <input addproperty="target.jdk.ver">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):</input> + <condition property="target.jdk.ver.missing" value="true"> + <equals arg1="${target.jdk.ver}" arg2="" trim="true" /> + </condition> + <fail if="target.jdk.ver.missing">Aborted (no version entered)</fail> + <exec executable="${java_home.exe}" outputproperty="target.jdk" failonerror="true"> + <arg value="-v" /> + <arg value="${target.jdk.ver}" /> + </exec> + <echo>Using VM at: ${target.jdk}</echo> + </target> + + <target name="-ask.target-jdk" depends="-ask.target-jdk.via-javahome" unless="target.jdk"> + <input addproperty="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):</input> + </target> + + <target name="make.javac-patch-jar" depends="-ask.target-jdk" description="to test javac13 on JDK14, for example, you need a jar (not a jmod), to use with --patch-modules. This task makes those."> + <exec executable="${target.jdk}/bin/java${executable.suffix}" outputproperty="target.javac.version.full" errorproperty="target.javac.version.err"> + <arg value="--version" /> + </exec> + <condition property="target.javac.tooearly" > + <contains string="${target.javac.version.err}" substring="Unrecognized option" /> + </condition> + <fail if="target.javac.tooearly">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.</fail> + + <delete dir="build/jdk-compiler-jar" quiet="true" /> + <mkdir dir="build/jdk-compiler-jar" /> + <echo file="build/jdk-compiler-jar/version.txt">${target.javac.version.full}</echo> + <copy file="build/jdk-compiler-jar/version.txt" tofile="build/jdk-compiler-jar/shortversion.txt" /> + <replaceregexp file="build/jdk-compiler-jar/version.txt" match="^openjdk ([^ ]+) (\d{4}-\d{2}-\d{2}).*$" replace="\1_\2" flags="si" /> + <replaceregexp file="build/jdk-compiler-jar/shortversion.txt" match="^openjdk ([^ ]+) (\d{4}-\d{2}-\d{2}).*$" replace="\1" flags="si" /> + <loadfile property="target.javac.version" srcfile="build/jdk-compiler-jar/version.txt" /> + <loadfile property="target.javac.shortversion" srcfile="build/jdk-compiler-jar/shortversion.txt" /> + + <mkdir dir="build/jdk-compiler-jar/java.compiler" /> + <exec executable="${target.jdk}/bin/jmod${executable.suffix}"> + <arg value="--dir" /> + <arg file="build/jdk-compiler-jar/java.compiler" /> + <arg value="extract" /> + <arg file="${target.jdk}/jmods/java.compiler.jmod" /> + </exec> + <jar destfile="build/javac${target.javac.version}-java.compiler.jar" index="true"> + <fileset dir="build/jdk-compiler-jar/java.compiler/classes" /> + <fileset dir="build/jdk-compiler-jar/java.compiler/legal" /> + </jar> + + <mkdir dir="build/jdk-compiler-jar/jdk.compiler" /> + <exec executable="${target.jdk}/bin/jmod${executable.suffix}"> + <arg value="--dir" /> + <arg file="build/jdk-compiler-jar/jdk.compiler" /> + <arg value="extract" /> + <arg file="${target.jdk}/jmods/jdk.compiler.jmod" /> + </exec> + <jar destfile="build/javac${target.javac.version}-jdk.compiler.jar" index="true"> + <fileset dir="build/jdk-compiler-jar/jdk.compiler/classes" /> + <fileset dir="build/jdk-compiler-jar/jdk.compiler/legal" /> + </jar> + + <tstamp> + <format property="target.javac.pubstamp" pattern="yyyyMMddHHmmss" /> + </tstamp> + <echo file="buildScripts/ivy-repo/net.java.openjdk.custom-javac${target.javac.shortversion}-${target.javac.version}.xml"><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></echo> + <echo>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}</echo> + </target> +</project> 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 @@ +<!-- + 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.compile" default="dist" xmlns:ivy="antlib:com.zwitserloot.ivyplusplus" basedir=".."> + <description> +This buildfile is part of projectlombok.org. It takes care of compiling and building lombok itself. + </description> + + <property name="mapstruct-binding.version" value="0.1.0" /> + + <!-- compiles just 'version.java' and runs the produced class file, setting up the various version properties --> + <target name="version" depends="ipp.setup, deps.jdk-runtime" description="Shows the version number" unless="lombok.version"> + <mkdir dir="build/lombok" /> + <ivy:compile destdir="build/lombok" source="1.5" target="1.5" ecj="true" nowarn="true"> + <bootclasspath path="${jdk-rt.loc}" /> + <src path="src/core" /> + <include name="lombok/core/Version.java" /> + </ivy:compile> + <java + classname="lombok.core.Version" + classpath="build/lombok" + failonerror="true" + output="build/version.txt"> + <arg value="full" /> + </java> + <ivy:loadversion property="lombok.fullversion" file="build/version.txt" /> + <java + classname="lombok.core.Version" + classpath="build/lombok" + failonerror="true" + output="build/version.txt" /> + <ivy:loadversion property="lombok.version" file="build/version.txt" /> + <echo level="info">Lombok version: ${lombok.version} (${lombok.fullversion})</echo> + </target> + + <target name="compile" depends="version, deps" description="Compiles the code"> + <!-- + 1. Compile stubs. + 2. Compile lombok-utils. + 3. Compile transplants. + 4. Compile lombok. + 5. Run SPI processor. + 6. Create other manifest entries. --> + + <!-- + ant includes the destination dir on the classpath (and there are good reasons to do this), but that also means + the bleeding edge lombok from the previous build is run (as lombok is an annotation processor), which means if + there are bugs in it, you can't compile anymore until you 'ant clean'. That's very undesirable. so we kill the processor, + which stops lombok from running. We re-create the file at the end of this target. --> + <delete file="build/lombok/META-INF/services/javax.annotation.processing.Processor" quiet="true" /> + + <!-- + first, compile stubs. Lombok needs to produce class files that run in a wide variety of JDK, javac, and ecj/eclipse versions. + Instead of depending on conflicting versions, we write stub files; just enough for compilation to succeed. + + However, the stubs themselves also have a ton of dependencies; to avoid _that_, we have stubs for stubs, too! --> + <ivy:compile destdir="build/stubsstubs" source="1.5" target="1.5" ecj="true"> + <bootclasspath path="${jdk-rt.loc}" /> + <src path="src/stubsstubs" /> + </ivy:compile> + <ivy:compile destdir="build/stubs" source="1.5" target="1.5" ecj="true"> + <bootclasspath path="${jdk-rt.loc}" /> + <src path="src/stubs" /> + <src path="src/javac-only-stubs" /> + <classpath location="build/stubsstubs" /> + <classpath location="build/stubs" /> + </ivy:compile> + + <!-- + compile the eclipse agent's transplant sources. + This is code that is not actually run within lombok; it is bytecode that the eclipse agent extracts from the class file + within its own jar and injects it into the eclipse classes as a patch. + + To keep the project clean of warnings, a few SuppressWarnings have been added, but we don't want them there during compilation, + so remove them first. + + For legacy eclipse support we include them in both class file format 48 (java 1.4) and 50 (java 1.6), though in practice + we don't support eclipses that run on anything below java 1.8 anymore. --> + <mkdir dir="build/transformedSources" /> + <copy todir="build/transformedSources"> + <fileset dir="src/eclipseAgent"> + <include name="**/*Transplants.java" /> + </fileset> + <filterchain> + <lineContainsRegExp negate="true"> + <regexp pattern="^\s*@SuppressWarnings.*$" /> + </lineContainsRegExp> + </filterchain> + </copy> + + <ivy:compile destdir="build/lombok" source="1.4" target="1.4" ecj="true"> + <bootclasspath location="build/stubs" /> + <bootclasspath path="${jdk-rt.loc}" /> + <src path="build/transformedSources" /> + </ivy:compile> + + <ivy:compile destdir="build/lombok/Class50" source="1.4" target="1.6" ecj="true"> + <bootclasspath location="build/stubs" /> + <bootclasspath path="${jdk-rt.loc}" /> + <src path="build/transformedSources" /> + </ivy:compile> + + <ivy:compile destdir="build/lombok" source="1.5" target="1.5" ecj="true"> + <bootclasspath location="build/stubs" /> + <bootclasspath path="${jdk-rt.loc}" /> + <src path="src/utils" /> + <exclude name="lombok/javac/**" /> + <classpath path="build/lombok" /> + <classpath refid="cp.javac6" /> + <classpath refid="cp.ecj8" /> + </ivy:compile> + <ivy:compile destdir="build/lombok" source="1.6" target="1.6" ecj="true"> + <bootclasspath location="build/stubs" /> + <bootclasspath path="${jdk-rt.loc}" /> + <src path="src/utils" /> + <include name="lombok/javac/**" /> + <classpath location="build/lombok" /> + <classpath refid="cp.javac6" /> + </ivy:compile> + + <!-- + compile lombok proper. We target java 1.6 to be as compatible with older releases as we can, using a JDK6 boot rt to ensure we don't + use API that didn't exist in those versions yet. --> + <ivy:compile destdir="build/lombok" source="1.6" target="1.6" ecj="true" nowarn="true"> + <bootclasspath location="build/stubs" /> + <bootclasspath path="${jdk-rt.loc}" /> + <src path="src/launch" /> + <src path="src/core" /> + <src path="src/installer" /> + <src path="src/eclipseAgent" /> + <src path="src/delombok" /> + <exclude name="**/*Transplants.java" /> + <classpath location="build/lombok" /> + <classpath refid="cp.build" /> + <classpath refid="cp.eclipse-oxygen" /> + <classpath refid="cp.javac6" /> + </ivy:compile> + + <!-- This is really part of the eclipse agent, but references lombok, so that had to be compiled first --> + <ivy:compile destdir="build/lombok/Class50" source="1.5" target="1.6" ecj="true"> + <bootclasspath location="build/stubs" /> + <bootclasspath path="${jdk-rt.loc}" /> + <src path="src/eclipseAgent" /> + <include name="lombok/launch/PatchFixesHider.java" /> + <classpath location="build/lombok" /> + <classpath refid="cp.build" /> + <classpath refid="cp.eclipse-oxygen" /> + </ivy:compile> + + <!-- + a couple of classes to cater to the bits of javac8+ that require j8 language constructs/API types; the main lombok + compile refers to these via reflection --> + <ivy:compile destdir="build/lombok" source="1.8" target="1.8" ecj="true" nowarn="true" includesystembootclasspath="true"> + <bootclasspath location="build/stubs" /> + <src path="src/core8" /> + <classpath location="build/lombok" /> + <classpath refid="cp.javac8" /> + </ivy:compile> + + <!-- + We also act as a jigsaw module so that module-based compile runs can use module-style dependency management. Obviously, + that bit we can only compile with jdk9+. --> + <ivy:compile destdir="build/lombok" release="9"> + <src path="src/core9" /> + <compilerarg value="-Xlint:none" /> + <classpath location="build/lombok" /> + <classpath refid="cp.build" /> + </ivy:compile> + + <!-- Run the SPI processor to create the services files listing all lombok handlers --> + <delete dir="build/lombok-proc-result" quiet="true" /> + <ivy:compile destdir="build/lombok-proc-result" release="9" nowarn="true"> + <classpath location="build/stubs" /> + <compilerarg value="-proc:only" /> + <compilerarg value="-processor" /> + <compilerarg value="org.mangosdk.spi.processor.SpiProcessor" /> + <src path="src/core" /> + <src path="src/installer" /> + <src path="src/eclipseAgent" /> + <src path="src/delombok" /> + <classpath location="build/lombok" /> + <classpath refid="cp.build" /> + <classpath refid="cp.javac6" /> + <classpath refid="cp.eclipse-oxygen" /> + </ivy:compile> + + <copy todir="build/lombok"> + <fileset dir="build/lombok-proc-result"> + <include name="META-INF/services/*" /> + </fileset> + </copy> + + <mkdir dir="build/lombok/META-INF" /> + <mkdir dir="build/lombok/META-INF/services" /> + <echo file="build/lombok/META-INF/services/javax.annotation.processing.Processor">lombok.launch.AnnotationProcessorHider$AnnotationProcessor +lombok.launch.AnnotationProcessorHider$ClaimingProcessor</echo> + <mkdir dir="build/lombok/META-INF/gradle" /> + <echo file="build/lombok/META-INF/gradle/incremental.annotation.processors">lombok.launch.AnnotationProcessorHider$AnnotationProcessor,isolating +lombok.launch.AnnotationProcessorHider$ClaimingProcessor,isolating</echo> + </target> + + <!-- compiles the bit of API from mapstruct that lombok compiles against. --> + <target name="mapstruct.compile"> + <mkdir dir="build/mapstruct" /> + <ivy:compile destdir="build/mapstruct" release="9"> + <src path="src/j9stubs" /> + </ivy:compile> + <mkdir dir="build/lombok/secondaryLoading.SCL.lombok/org/mapstruct/ap/spi" /> + <move + file="build/mapstruct/org/mapstruct/ap/spi/AstModifyingAnnotationProcessor.class" + tofile="build/lombok/secondaryLoading.SCL.lombok/org/mapstruct/ap/spi/AstModifyingAnnotationProcessor.SCL.lombok" /> + </target> + + <target name="-deps.unpack" depends="deps"> + <ivy:cachedunjar dest="build/lombok" marker="build/unpackDeps.marker"> + <path refid="cp.stripe" /> + </ivy:cachedunjar> + </target> + + <target name="dist" depends="version, compile, latest-changes.build, mapstruct.compile, -deps.unpack" description="Builds the 'everything' lombok.jar"> + <mkdir dir="dist" /> + <copy file="doc/changelog.markdown" tofile="build/changelog.txt" /> + <tstamp><format property="release.timestamp" pattern="yyyy-MM-dd" /></tstamp> + <echo file="release-timestamp.txt">${release.timestamp}</echo> + + <!-- the ant jar task doesn't quite let us do all we need to, so build with zip, then do the jar bits afterwards --> + <zip destfile="dist/lombok-${lombok.version}.jar"> + <fileset dir="build" includes="changelog.txt, latestchanges.html" /> + <fileset dir="." includes="README.md, LICENSE, AUTHORS, release-timestamp.txt" /> + + <!-- + most class files that need to be in the lombok distro are loaded in a separate class loader; + we want any project that includes lombok.jar as a dependency to NOT get a bunch of otherwise public + lombok classes served up in autocomplete dialogs, amongst other reasons. + + Thus, we list here only the few class files that serve as 'entry points'. --> + <fileset dir="build/lombok"> + <include name="module-info.class" /> + <include name="lombok/*.class" /> + <include name="lombok/experimental/**" /> + <include name="lombok/extern/**" /> + <include name="lombok/launch/**" /> + <include name="lombok/delombok/ant/Tasks*" /> + <include name="lombok/javac/apt/Processor.class" /> + <include name="lombok/META-INF/**" /> + </fileset> + + <!-- now include everything else but renamed for the shadowloader system, to make these clsases invisible to other projects. --> + <mappedresources> + <fileset dir="build/lombok"> + <exclude name="com/sun/tools/javac/**" /> + <exclude name="module-info.class" /> + <exclude name="lombok/*.class" /> + <exclude name="lombok/experimental/**" /> + <exclude name="lombok/extern/**" /> + <exclude name="lombok/launch/**" /> + <exclude name="lombok/delombok/ant/Tasks*" /> + <exclude name="lombok/javac/apt/Processor.class" /> + <exclude name="lombok/META-INF/**" /> + </fileset> + <firstmatchmapper> + <globmapper from="*.class" to="*.SCL.lombok" /> + <identitymapper /> + </firstmatchmapper> + </mappedresources> + </zip> + + <!-- ... but manifest is not part of the ant zip task, so do that with the jar task --> + <jar destfile="dist/lombok-${lombok.version}.jar" update="true"> + <manifest> + <attribute name="Premain-Class" value="lombok.launch.Agent" /> + <attribute name="Agent-Class" value="lombok.launch.Agent" /> + <attribute name="Can-Redefine-Classes" value="true" /> + <attribute name="Main-Class" value="lombok.launch.Main" /> + <attribute name="Lombok-Version" value="${lombok.version}" /> + </manifest> + </jar> + <delete file="release-timestamp.txt" /> + <symlink overwrite="true" link="dist/lombok.jar" resource="lombok-${lombok.version}.jar" /> + <property name="lombok.dist.built" value="true" /> + </target> + + <target name="compile.support" depends="ipp.setup, deps" description="Compiles code that is used solely by the build, such as website and IDE project creation"> + <ivy:compile includeDestClasses="false" includeantruntime="false" destdir="build/support" debug="on" source="1.8" target="1.8"> + <compilerarg value="-proc:none" /> + <compilerarg value="-Xlint:-options" /> + <classpath refid="cp.buildtools" /> + <src path="src/support" /> + </ivy:compile> + </target> +</project> 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 @@ +<!-- + Copyright (C) 2010-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.create-eclipse-project" default="" xmlns:ivy="antlib:com.zwitserloot.ivyplusplus" basedir=".."> + <description> +This buildfile is part of projectlombok.org. It creates the infrastructure needed to develop lombok on eclipse. + </description> + + <target name="eclipse" depends="eclipse.projectfiles, eclipse.testtarget.default" description="Downloads dependencies, create eclipse project files, as well as debug/run test targets. Open this directory as project in eclipse (via import... existing projects)" /> + + <target name="eclipse.projectfiles" depends="deps"> + <ivy:eclipsegen source="1.6"> + <srcdir dir="src/core" /> + <srcdir dir="src/core8" /> + <srcdir dir="src/launch" /> + <srcdir dir="src/utils" /> + <srcdir dir="src/eclipseAgent" /> + <srcdir dir="src/installer" /> + <srcdir dir="src/delombok" /> + <srcdir dir="src/stubs" /> + <srcdir dir="src/testAP" /> + <srcdir dir="src/support" /> + <srcdir dir="experimental/src" /> + <srcdir dir="test/transform/src" /> + <srcdir dir="test/core/src" /> + <srcdir dir="test/bytecode/src" /> + <srcdir dir="test/configuration/src" /> + <srcdir dir="test/stubs" /> + <conf name="build" sources="sources" /> + <conf name="javac6" sources="sources" /> + <conf name="eclipse-oxygen" sources="sources" /> + <conf name="test" sources="sources" /> + <conf name="buildtools" sources="sources" /> + <local org="org.projectlombok" name="lombok.patcher" dir="../lombok.patcher" /> + <settings> + <url url="https://projectlombok.org/downloads/lombok.eclipse.settings" /> + </settings> + <apt location="lib/build/projectlombok.org-spi.jar" /> + </ivy:eclipsegen> + </target> + + <target name="eclipse.testtarget.default" depends="deps, compile.support"> + <property name="cp.test" refid="cp.test" /> + <property name="cp.stripe" refid="cp.stripe" /> + <property name="cp.eclipse-202006" refid="cp.eclipse-202006" /> + + <java classname="lombok.eclipseCreate.CreateEclipseDebugTarget" failonerror="true"> + <classpath> + <path refid="cp.buildtools" /> + <pathelement location="build/support" /> + </classpath> + <arg value="name=Lombok-test Base" /> + <arg value="testType=lombok.TestBase" /> + <arg value="jvmTarget=1.8" /> + <arg value="conf.test=${cp.test}" /> + <arg value="conf.stripe=${cp.stripe}" /> + <arg value="favorite" /> + </java> + + <java classname="lombok.eclipseCreate.CreateEclipseDebugTarget" failonerror="true"> + <classpath> + <path refid="cp.buildtools" /> + <pathelement location="build/support" /> + </classpath> + <arg value="name=Lombok-test Eclipse-202006" /> + <arg value="testType=lombok.TestEclipse" /> + <arg value="jvmTarget=1.8" /> + <arg value="conf.test=${cp.test}" /> + <arg value="conf.stripe=${cp.stripe}" /> + <arg value="conf.eclipse-oxygen=${cp.eclipse-202006}" /> + <arg value="favorite" /> + </java> + + <java classname="lombok.eclipseCreate.CreateEclipseDebugTarget" failonerror="true"> + <classpath> + <path refid="cp.buildtools" /> + <pathelement location="build/support" /> + </classpath> + <arg value="name=Lombok-test Javac14" /> + <arg value="testType=lombok.TestJavac" /> + <arg value="jvmTarget=14" /> + <arg value="conf.test=${cp.test}" /> + <arg value="conf.stripe=${cp.stripe}" /> + <arg value="favorite" /> + </java> + </target> + + <target name="eclipse.testtarget.javac" depends="compile.support" description="Makes an eclipse launch target for running the tests for javac"> + <property name="cp.test" refid="cp.test" /> + <property name="cp.stripe" refid="cp.stripe" /> + + <input message="Which javac do you want to target? Enter a version, such as '11'." validargs="8,11,13,14,15" addproperty="testtarget.jvmTarget.input" /> + + <condition property="testtarget.jvmtarget" value="1.8" else="${testtarget.jvmTarget.input}"><equals arg1="${testtarget.jvmTarget.input}" arg2="8" /></condition> + <property name="testtarget.confname" value="javac${testtarget.jvmTarget.input}" /> + <property name="testtarget.confcp" refid="cp.javac${testtarget.jvmTarget.input}" /> + + <java classname="lombok.eclipseCreate.CreateEclipseDebugTarget" failonerror="true"> + <classpath> + <path refid="cp.buildtools" /> + <pathelement location="build/support" /> + </classpath> + <arg value="name=Lombok-test Javac ${testtarget.jvmTarget.input}" /> + <arg value="testType=lombok.TestJavac" /> + <arg value="jvmTarget=${testtarget.jvmTarget}" /> + <arg value="conf.test=${cp.test}" /> + <arg value="conf.stripe=${cp.stripe}" /> + <arg value="conf.${testtarget.confname}=${testtarget.confcp}" /> + <arg value="favorite" /> + </java> + </target> + + <target name="eclipse.testtarget.eclipse" depends="compile.support" description="Makes an eclipse launch target for running the tests for eclipse support"> + <property name="cp.test" refid="cp.test" /> + <property name="cp.stripe" refid="cp.stripe" /> + + <input message="Which JDK do you want to target? Enter a version, such as '11'. Suggested (default): 8" validargs="8,11,14" defaultvalue="8" addproperty="testtarget.jvmTarget.input" /> + <input message="Which eclipse do you want to target? Enter a version, such as 'oxygen'." validargs="oxygen" addproperty="testtarget.eclipseTarget" /> + + <condition property="testtarget.jvmtarget" value="1.8" else="${testtarget.jvmTarget.input}"><equals arg1="${testtarget.jvmTarget.input}" arg2="8" /></condition> + <property name="testtarget.confname" value="eclipse-${testtarget.eclipseTarget}" /> + <property name="testtarget.confcp" refid="cp.eclipse-${testtarget.eclipseTarget}" /> + + <java classname="lombok.eclipseCreate.CreateEclipseDebugTarget" failonerror="true"> + <classpath> + <path refid="cp.buildtools" /> + <pathelement location="build/support" /> + </classpath> + <arg value="name=Lombok-test Eclipse-${testtarget.eclipseTarget}" /> + <arg value="testType=lombok.TestEclipse" /> + <arg value="jvmTarget=${testtarget.jvmTarget}" /> + <arg value="conf.test=${cp.test}" /> + <arg value="conf.stripe=${cp.stripe}" /> + <arg value="conf.${testtarget.confname}=${testtarget.confcp}" /> + <arg value="favorite" /> + </java> + </target> + + <target name="eclipse.testtarget.ecj" depends="compile.support" description="Makes an eclipse launch target for running the tests for ecj support"> + <property name="cp.test" refid="cp.test" /> + <property name="cp.stripe" refid="cp.stripe" /> + + <input message="Which JDK do you want to target? Enter a version, such as '11'. Suggested (default): 8" validargs="8,11,14" defaultvalue="8" addproperty="testtarget.jvmTarget.input" /> + <input message="Which ecj do you want to target? Enter a version, such as '8'." validargs="8,11,14" addproperty="testtarget.ecjTarget" /> + + <condition property="testtarget.jvmtarget" value="1.8" else="${testtarget.jvmTarget.input}"><equals arg1="${testtarget.jvmTarget.input}" arg2="8" /></condition> + <property name="testtarget.confname" value="ecj${testtarget.ecjTarget}" /> + <property name="testtarget.confcp" refid="cp.ecj${testtarget.ecjTarget}" /> + + <java classname="lombok.eclipseCreate.CreateEclipseDebugTarget" failonerror="true"> + <classpath> + <path refid="cp.buildtools" /> + <pathelement location="build/support" /> + </classpath> + <arg value="name=Lombok-test ECJ${testtarget.ecjTarget}" /> + <arg value="testType=lombok.TestEclipse" /> + <arg value="jvmTarget=${testtarget.jvmTarget}" /> + <arg value="conf.test=${cp.test}" /> + <arg value="conf.stripe=${cp.stripe}" /> + <arg value="conf.${testtarget.confname}=${testtarget.confcp}" /> + <arg value="favorite" /> + </java> + </target> +</project> 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 @@ +<!-- + Copyright (C) 2010-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.create-intellij-project" default="" xmlns:ivy="antlib:com.zwitserloot.ivyplusplus" basedir=".."> + <description> +This buildfile is part of projectlombok.org. It creates the infrastructure needed to develop lombok on intellij. + </description> + + <target name="intellij" depends="deps" description="Creates intellij project files and downloads all dependencies. Open this directory as a project in IntelliJ after running this target"> + <echo> ** 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!</echo> + <echo>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.</echo> + <echo>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.</echo> + <input>Press return to continue</input> + <ivy:intellijgen> + <conf name="build" sources="contrib" /> + <conf name="test" sources="contrib" /> + <module name="lombok" depends="build, test"> + <srcdir dir="src/core" /> + <srcdir dir="src/core8" /> + <srcdir dir="src/launch" /> + <srcdir dir="src/utils" /> + <srcdir dir="src/eclipseAgent" /> + <srcdir dir="src/installer" /> + <srcdir dir="src/delombok" /> + <srcdir dir="src/stubs" /> + <srcdir dir="src/testAP" /> + <srcdir dir="src/support" /> + <srcdir dir="experimental/src" /> + <srcdir dir="test/transform/src" test="true" /> + <srcdir dir="test/core/src" test="true" /> + <srcdir dir="test/bytecode/src" test="true" /> + <srcdir dir="test/configuration/src" test="true" /> + <srcdir dir="test/stubs" test="true" /> + </module> + <settings> + <url url="https://projectlombok.org/downloads/lombok.intellij.settings" /> + </settings> + <apt enabled="true" /> + </ivy:intellijgen> + </target> +</project> 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 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.pde.ui.RuntimeWorkbench"> -<booleanAttribute key="append.args" value="true"/> -<booleanAttribute key="askclear" value="false"/> -<booleanAttribute key="automaticAdd" value="true"/> -<booleanAttribute key="automaticValidate" value="false"/> -<stringAttribute key="bootstrap" value=""/> -<stringAttribute key="checked" value="[NONE]"/> -<booleanAttribute key="clearConfig" value="false"/> -<booleanAttribute key="clearws" value="false"/> -<booleanAttribute key="clearwslog" value="true"/> -<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/LombokizedEclipse"/> -<booleanAttribute key="default" value="true"/> -<booleanAttribute key="includeOptional" value="true"/> -<stringAttribute key="location" value="${project_loc:lombok}/debug/workspace"/> -<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.pde.ui.launcher.PDESourceLookupDirector"/> -<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <sourceLookupDirector> <sourceContainers duplicates="false"> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;lombok&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;javaProject name=&quot;lombok.patcher&quot;/&gt;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;default/&gt;&#10;" typeId="org.eclipse.debug.core.containerType.default"/> </sourceContainers> </sourceLookupDirector> "/> -<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> -<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/> -</listAttribute> -<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> -<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl}"/> -<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/> -<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m -Xmx512m -XX:MaxPermSize=256m -Dorg.eclipse.swt.internal.carbon.smallFonts -javaagent:${project_loc:lombok}/dist/lombok.jar -Xbootclasspath/a:${project_loc:lombok}/dist/lombok.jar -Dlombok.patcher.patchDebugDir=${project_loc:lombok}/debug/patchedClasses"/> -<stringAttribute key="pde.version" value="3.3"/> -<stringAttribute key="product" value="org.eclipse.sdk.ide"/> -<booleanAttribute key="show_selected_only" value="false"/> -<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/> -<booleanAttribute key="tracing" value="false"/> -<booleanAttribute key="useCustomFeatures" value="false"/> -<booleanAttribute key="useDefaultConfig" value="true"/> -<booleanAttribute key="useDefaultConfigArea" value="true"/> -<booleanAttribute key="useProduct" value="false"/> -<booleanAttribute key="usefeatures" value="false"/> -</launchConfiguration> 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. --> -<project name="lombok-eclipse-p2" basedir=".." xmlns:ivy="antlib:com.zwitserloot.ivyplusplus"> +<project name="lombok.eclipsep2" basedir=".." xmlns:ivy="antlib:com.zwitserloot.ivyplusplus"> <description> This buildfile is part of projectlombok.org. It is responsible for building the eclipse P2 update site. </description> - <taskdef classpath="lib/ivyplusplus.jar" resource="com/zwitserloot/ivyplusplus/antlib.xml" uri="antlib:com.zwitserloot.ivyplusplus" /> - - <target name="-p2-clean"> + <target name="eclipsep2.clean"> <delete dir="build/p2" quiet="true" /> </target> - <target name="dist-eclipse-p2" depends="build-eclipse-p2"> - <tar destfile="dist/eclipse-p2.tar.bz2" compression="bzip2"> - <tarfileset dir="build/p2" /> - </tar> + <target name="-eclipsep2.get-epoch"> + <mkdir dir="build/p2-support" /> + <echo file="build/p2-support/Epoch.java">public class Epoch {public static void main(String[] args) {System.out.print(System.currentTimeMillis());}}</echo> + <javac srcdir="build/p2-support" release="8" includeAntRuntime="false" destdir="build/p2-support" /> + <java classname="Epoch" classpath="build/p2-support" fork="false" outputproperty="dt.epochMillis" /> </target> - <target name="build-eclipse-p2" depends="-set-epoch-millis"> - <property name="lombok.version" value="1.18.99" /> + <target name="eclipsep2.build" depends="version, -eclipsep2.get-epoch"> <tstamp><format property="dt.year" pattern="yyyy" /></tstamp> <mkdir dir="build/p2" /> <mkdir dir="build/p2/features" /> @@ -111,10 +109,25 @@ This buildfile is part of projectlombok.org. It is responsible for building the <delete file="build/p2/content.xml" /> </target> - <target name="-set-epoch-millis"> - <mkdir dir="build/p2-support" /> - <echo file="build/p2-support/Epoch.java">public class Epoch {public static void main(String[] args) {System.out.print(System.currentTimeMillis());}}</echo> - <javac srcdir="build/p2-support" release="8" includeAntRuntime="false" destdir="build/p2-support" /> - <java classname="Epoch" classpath="build/p2-support" fork="false" outputproperty="dt.epochMillis" /> + <target name="eclipsep2.pack" depends="eclipsep2.build"> + <tar destfile="dist/eclipse-p2.tar.bz2" compression="bzip2"> + <tarfileset dir="build/p2" /> + </tar> + </target> + + <target name="eclipsep2.publish" depends="setup.ssh, eclipsep2.pack"> + <ivy:scpUpload + from="dist/eclipse-p2.tar.bz2" + to="/data/lombok/staging" + server="projectlombok.org" + username="${ssh.username}" + keyfile="${ssh.keyfile}" + knownHosts="ssh.knownHosts" /> + <ivy:sshExec + cmd="/data/lombok/stagingCmd/deployP2" + server="projectlombok.org" + username="${ssh.username}" + keyfile="${ssh.keyfile}" + knownHosts="ssh.knownHosts" /> </target> </project> 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 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.jdt.junit.launchconfig"> - <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> - <listEntry value="/lombok/test/core/src/lombok/RunAllTests.java"/> - </listAttribute> - <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> - <listEntry value="1"/> - </listAttribute> - <listAttribute key="org.eclipse.debug.ui.favoriteGroups"> - <listEntry value="org.eclipse.debug.ui.launchGroup.debug"/> - </listAttribute> - <stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/> - <booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/> - <stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> - <stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/> - <booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/> - <listAttribute key="org.eclipse.jdt.launching.CLASSPATH"> - <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.@JAVA_VERSION@" path="1" type="4"/> "/> - <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/lombok/@ECJ_LOCATION@" path="3" type="2"/> "/> - <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/lombok/@JAVAC_LOCATION@" path="3" type="2"/> "/> - <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/lombok/lib/test/com.google.guava-guava.jar" path="3" type="2"/> "/> - <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/lombok/lib/test/com.google.code.findbugs-findbugs.jar" path="3" type="2"/> "/> - <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="true" project="lombok"/> </runtimeClasspathEntry> "/> - </listAttribute> - <booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/> - <stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.@JAVA_VERSION@"/> - <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="lombok.RunAllTests"/> - <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="lombok"/> - <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-javaagent:dist/lombok.jar -Dshadow.override.lombok=${project_loc:lombok}/bin@PATH_SEP@${project_loc:lombok}/lib/runtime/* -Ddelombok.bootclasspath=@RT_LOCATION@"/> -</launchConfiguration> 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 @@ +<!-- + 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.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.</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> 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 @@ +<ivy-module version="2.0"> + <info organisation="net.java.openjdk.custom" module="javac11" revision="11_2018-09-25" publication="20200606144743"> + <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="javac11-java.compiler" conf="runtime" url="https://projectlombok.org/ivyrepo/langtools/javac11_2018-09-25-java.compiler.jar" /> + <artifact name="javac11-jdk.compiler" conf="runtime" url="https://projectlombok.org/ivyrepo/langtools/javac11_2018-09-25-jdk.compiler.jar" /> + </publications> +</ivy-module>
\ 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 @@ +<ivy-module version="2.0"> + <info organisation="net.java.openjdk.custom" module="javac13" revision="13_2019-09-17" publication="20200508032346"> + <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 conf="runtime" url="https://projectlombok.org/ivyrepo/langtools/javac13_2019-09-17.jar" /> + </publications> +</ivy-module>
\ 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 @@ +<ivy-module version="2.0"> + <info organisation="net.java.openjdk.custom" module="javac14" revision="14-ea_2020-03-17" publication="20200508035315"> + <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 conf="runtime" url="https://projectlombok.org/ivyrepo/langtools/javac14-ea_2020-03-17.jar" /> + </publications> +</ivy-module> diff --git a/buildScripts/ivy-repo/net.java.openjdk.custom-javac8-1.8.0.xml b/buildScripts/ivy-repo/net.java.openjdk.custom-javac8-1.8.0.xml new file mode 100644 index 00000000..f02df135 --- /dev/null +++ b/buildScripts/ivy-repo/net.java.openjdk.custom-javac8-1.8.0.xml @@ -0,0 +1,12 @@ +<ivy-module version="2.0"> + <info organisation="net.java.openjdk.custom" module="javac8" revision="1.8.0" publication="20140613120000"> + <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 conf="runtime" url="https://projectlombok.org/ivyrepo/langtools/jdk8-javac.jar" /> + </publications> +</ivy-module> diff --git a/buildScripts/ivy-repo/org.eclipse.custom-core.jobs-3.5.200.xml b/buildScripts/ivy-repo/org.eclipse.custom-core.jobs-3.5.200.xml deleted file mode 100644 index 077f4f47..00000000 --- a/buildScripts/ivy-repo/org.eclipse.custom-core.jobs-3.5.200.xml +++ /dev/null @@ -1,14 +0,0 @@ -<ivy-module version="2.0"> - <info organisation="org.eclipse.custom" module="core.jobs" revision="3.5.200" publication="20120521234600"> - <license name="Eclipse Public Licence v1.0" url="http://www.eclipse.org/org/documents/epl-v10.php" /> - <description homepage="http://www.eclipse.org/eclipse/" /> - </info> - <configurations> - <conf name="default" /> - <conf name="sources" /> - </configurations> - <publications> - <artifact conf="default" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.core.jobs_3.5.200.v20120521-2346.jar" /> - <artifact type="zip" conf="sources" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.core.jobs_3.5.200.v20120521-2346-sources.jar" /> - </publications> -</ivy-module> diff --git a/buildScripts/ivy-repo/org.eclipse.custom-core.jobs-3.5.300.xml b/buildScripts/ivy-repo/org.eclipse.custom-core.jobs-3.5.300.xml deleted file mode 100644 index f4002ee8..00000000 --- a/buildScripts/ivy-repo/org.eclipse.custom-core.jobs-3.5.300.xml +++ /dev/null @@ -1,14 +0,0 @@ -<ivy-module version="2.0"> - <info organisation="org.eclipse.custom" module="core.jobs" revision="3.5.300" publication="20130429181300"> - <license name="Eclipse Public Licence v1.0" url="http://www.eclipse.org/org/documents/epl-v10.php" /> - <description homepage="http://www.eclipse.org/eclipse/" /> - </info> - <configurations> - <conf name="default" /> - <conf name="sources" /> - </configurations> - <publications> - <artifact conf="default" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.core.jobs_3.5.300.v20130429-1813.jar" /> - <artifact type="zip" conf="sources" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.core.jobs_3.5.300.v20130429-1813-sources.jar" /> - </publications> -</ivy-module> diff --git a/buildScripts/ivy-repo/org.eclipse.custom-core.resources-3.7.0.xml b/buildScripts/ivy-repo/org.eclipse.custom-core.resources-3.7.0.xml deleted file mode 100644 index b1ddf043..00000000 --- a/buildScripts/ivy-repo/org.eclipse.custom-core.resources-3.7.0.xml +++ /dev/null @@ -1,14 +0,0 @@ -<ivy-module version="2.0"> - <info organisation="org.eclipse.custom" module="core.resources" revision="3.7.0" publication="20110510071200"> - <license name="Eclipse Public Licence v1.0" url="http://www.eclipse.org/org/documents/epl-v10.php" /> - <description homepage="http://www.eclipse.org/eclipse/" /> - </info> - <configurations> - <conf name="default" /> - <conf name="sources" /> - </configurations> - <publications> - <artifact conf="default" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.core.resources_3.7.100.v20110510-0712.jar" /> - <artifact type="zip" conf="sources" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.core.resources_3.7.100.v20110510-0712-sources.jar" /> - </publications> -</ivy-module> diff --git a/buildScripts/ivy-repo/org.eclipse.custom-core.resources-3.8.100.xml b/buildScripts/ivy-repo/org.eclipse.custom-core.resources-3.8.100.xml deleted file mode 100644 index eac7fe7b..00000000 --- a/buildScripts/ivy-repo/org.eclipse.custom-core.resources-3.8.100.xml +++ /dev/null @@ -1,14 +0,0 @@ -<ivy-module version="2.0"> - <info organisation="org.eclipse.custom" module="core.resources" revision="3.8.100" publication="20130521202600"> - <license name="Eclipse Public Licence v1.0" url="http://www.eclipse.org/org/documents/epl-v10.php" /> - <description homepage="http://www.eclipse.org/eclipse/" /> - </info> - <configurations> - <conf name="default" /> - <conf name="sources" /> - </configurations> - <publications> - <artifact conf="default" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.core.resources_3.8.100.v20130521-2026.jar" /> - <artifact type="zip" conf="sources" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.core.resources_3.8.100.v20130521-2026-sources.jar" /> - </publications> -</ivy-module> diff --git a/buildScripts/ivy-repo/org.eclipse.custom-core.runtime-3.6.0.xml b/buildScripts/ivy-repo/org.eclipse.custom-core.runtime-3.6.0.xml deleted file mode 100644 index a5fe9784..00000000 --- a/buildScripts/ivy-repo/org.eclipse.custom-core.runtime-3.6.0.xml +++ /dev/null @@ -1,14 +0,0 @@ -<ivy-module version="2.0"> - <info organisation="org.eclipse.custom" module="core.runtime" revision="3.6.0" publication="20100505120000"> - <license name="Eclipse Public Licence v1.0" url="http://www.eclipse.org/org/documents/epl-v10.php" /> - <description homepage="http://www.eclipse.org/eclipse/" /> - </info> - <configurations> - <conf name="default" /> - <conf name="sources" /> - </configurations> - <publications> - <artifact conf="default" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.core.runtime_3.6.0.v20100505.jar" /> - <artifact type="zip" conf="sources" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.core.runtime_3.6.0.v20100505-sources.jar" /> - </publications> -</ivy-module> diff --git a/buildScripts/ivy-repo/org.eclipse.custom-core.runtime-3.9.0.xml b/buildScripts/ivy-repo/org.eclipse.custom-core.runtime-3.9.0.xml deleted file mode 100644 index 0e06d062..00000000 --- a/buildScripts/ivy-repo/org.eclipse.custom-core.runtime-3.9.0.xml +++ /dev/null @@ -1,14 +0,0 @@ -<ivy-module version="2.0"> - <info organisation="org.eclipse.custom" module="core.runtime" revision="3.9.0" publication="20130326125500"> - <license name="Eclipse Public Licence v1.0" url="http://www.eclipse.org/org/documents/epl-v10.php" /> - <description homepage="http://www.eclipse.org/eclipse/" /> - </info> - <configurations> - <conf name="default" /> - <conf name="sources" /> - </configurations> - <publications> - <artifact conf="default" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.core.runtime_3.9.0.v20130326-1255.jar" /> - <artifact type="zip" conf="sources" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.core.runtime_3.9.0.v20130326-1255-sources.jar" /> - </publications> -</ivy-module> diff --git a/buildScripts/ivy-repo/org.eclipse.custom-ecj-3.6.2.xml b/buildScripts/ivy-repo/org.eclipse.custom-ecj-3.6.2.xml deleted file mode 100644 index 7da4c2ce..00000000 --- a/buildScripts/ivy-repo/org.eclipse.custom-ecj-3.6.2.xml +++ /dev/null @@ -1,14 +0,0 @@ -<ivy-module version="2.0"> - <info organisation="org.eclipse.custom" module="ecj" revision="3.6.2" publication="20110401190400"> - <license name="Eclipse Public Licence v1.0" url="http://www.eclipse.org/org/documents/epl-v10.php" /> - <description homepage="http://www.eclipse.org/eclipse/" /> - </info> - <configurations> - <conf name="default" /> - <conf name="sources" /> - </configurations> - <publications> - <artifact conf="default" url="https://projectlombok.org/ivyrepo/eclipse/ecj-3.6.2.jar" /> - <artifact type="zip" conf="sources" url="https://projectlombok.org/ivyrepo/eclipse/ecjsrc-3.6.2.zip" /> - </publications> -</ivy-module> diff --git a/buildScripts/ivy-repo/org.eclipse.custom-ecj-4.3.1.xml b/buildScripts/ivy-repo/org.eclipse.custom-ecj-4.3.1.xml deleted file mode 100644 index 8d0a8f0c..00000000 --- a/buildScripts/ivy-repo/org.eclipse.custom-ecj-4.3.1.xml +++ /dev/null @@ -1,14 +0,0 @@ -<ivy-module version="2.0"> - <info organisation="org.eclipse.custom" module="ecj" revision="4.3.1" publication="20140210214200"> - <license name="Eclipse Public Licence v1.0" url="http://www.eclipse.org/org/documents/epl-v10.php" /> - <description homepage="http://www.eclipse.org/eclipse/" /> - </info> - <configurations> - <conf name="default" /> - <conf name="sources" /> - </configurations> - <publications> - <artifact conf="default" url="https://projectlombok.org/ivyrepo/eclipse/ecj-4.3.1.jar" /> - <artifact type="zip" conf="sources" url="https://projectlombok.org/ivyrepo/eclipse/ecjsrc-4.3.1.zip" /> - </publications> -</ivy-module> diff --git a/buildScripts/ivy-repo/org.eclipse.custom-ecj-I20140430.xml b/buildScripts/ivy-repo/org.eclipse.custom-ecj-I20140430.xml deleted file mode 100644 index 193f8a27..00000000 --- a/buildScripts/ivy-repo/org.eclipse.custom-ecj-I20140430.xml +++ /dev/null @@ -1,14 +0,0 @@ -<ivy-module version="2.0"> - <info organisation="org.eclipse.custom" module="ecj" revision="I20140430" publication="20140430080000"> - <license name="Eclipse Public Licence v1.0" url="http://www.eclipse.org/org/documents/epl-v10.php" /> - <description homepage="http://www.eclipse.org/eclipse/" /> - </info> - <configurations> - <conf name="default" /> - <conf name="sources" /> - </configurations> - <publications> - <artifact conf="default" url="https://projectlombok.org/ivyrepo/eclipse/ecj-I20140430-0800.jar" /> - <artifact type="zip" conf="sources" url="https://projectlombok.org/ivyrepo/eclipse/ecjsrc-I20140430-0800.zip" /> - </publications> -</ivy-module> diff --git a/buildScripts/ivy-repo/org.eclipse.custom-equinox.common-3.6.0.xml b/buildScripts/ivy-repo/org.eclipse.custom-equinox.common-3.6.0.xml deleted file mode 100644 index 69d18ae4..00000000 --- a/buildScripts/ivy-repo/org.eclipse.custom-equinox.common-3.6.0.xml +++ /dev/null @@ -1,14 +0,0 @@ -<ivy-module version="2.0"> - <info organisation="org.eclipse.custom" module="equinox.common" revision="3.6.0" publication="20100503120000"> - <license name="Eclipse Public Licence v1.0" url="http://www.eclipse.org/org/documents/epl-v10.php" /> - <description homepage="http://www.eclipse.org/eclipse/" /> - </info> - <configurations> - <conf name="default" /> - <conf name="sources" /> - </configurations> - <publications> - <artifact conf="default" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.equinox.common_3.6.0.v20100503.jar" /> - <artifact type="zip" conf="sources" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.equinox.common_3.6.0.v20100503-sources.jar" /> - </publications> -</ivy-module>
\ No newline at end of file diff --git a/buildScripts/ivy-repo/org.eclipse.custom-equinox.common-3.6.200.xml b/buildScripts/ivy-repo/org.eclipse.custom-equinox.common-3.6.200.xml deleted file mode 100644 index d0a128ec..00000000 --- a/buildScripts/ivy-repo/org.eclipse.custom-equinox.common-3.6.200.xml +++ /dev/null @@ -1,14 +0,0 @@ -<ivy-module version="2.0"> - <info organisation="org.eclipse.custom" module="equinox.common" revision="3.6.200" publication="20130402150500"> - <license name="Eclipse Public Licence v1.0" url="http://www.eclipse.org/org/documents/epl-v10.php" /> - <description homepage="http://www.eclipse.org/eclipse/" /> - </info> - <configurations> - <conf name="default" /> - <conf name="sources" /> - </configurations> - <publications> - <artifact conf="default" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.equinox.common_3.6.200.v20130402-1505.jar" /> - <artifact type="zip" conf="sources" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.equinox.common_3.6.200.v20130402-1505-sources.jar" /> - </publications> -</ivy-module>
\ No newline at end of file diff --git a/buildScripts/ivy-repo/org.eclipse.custom-jdt.core-3.6.0.xml b/buildScripts/ivy-repo/org.eclipse.custom-jdt.core-3.6.0.xml deleted file mode 100644 index 2c46df18..00000000 --- a/buildScripts/ivy-repo/org.eclipse.custom-jdt.core-3.6.0.xml +++ /dev/null @@ -1,14 +0,0 @@ -<ivy-module version="2.0"> - <info organisation="org.eclipse.custom" module="jdt.core" revision="3.6.0" publication="20100505120000"> - <license name="Eclipse Public Licence v1.0" url="http://www.eclipse.org/org/documents/epl-v10.php" /> - <description homepage="http://www.eclipse.org/eclipse/" /> - </info> - <configurations> - <conf name="default" /> - <conf name="sources" /> - </configurations> - <publications> - <artifact conf="default" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.jdt.core_3.6.0.v_A58.jar" /> - <artifact type="zip" conf="sources" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.jdt.core_3.6.0.v_A58-sources.jar" /> - </publications> -</ivy-module> diff --git a/buildScripts/ivy-repo/org.eclipse.custom-jdt.core-3.9.1.xml b/buildScripts/ivy-repo/org.eclipse.custom-jdt.core-3.9.1.xml deleted file mode 100644 index 946aa65a..00000000 --- a/buildScripts/ivy-repo/org.eclipse.custom-jdt.core-3.9.1.xml +++ /dev/null @@ -1,14 +0,0 @@ -<ivy-module version="2.0"> - <info organisation="org.eclipse.custom" module="jdt.core" revision="3.9.1" publication="20130905083700"> - <license name="Eclipse Public Licence v1.0" url="http://www.eclipse.org/org/documents/epl-v10.php" /> - <description homepage="http://www.eclipse.org/eclipse/" /> - </info> - <configurations> - <conf name="default" /> - <conf name="sources" /> - </configurations> - <publications> - <artifact conf="default" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.jdt.core_3.9.1.v20130905-0837.jar" /> - <artifact type="zip" conf="sources" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.jdt.core_3.9.1.v20130905-0837-sources.jar" /> - </publications> -</ivy-module> diff --git a/buildScripts/ivy-repo/org.eclipse.custom-jdt.ui-3.6.0.xml b/buildScripts/ivy-repo/org.eclipse.custom-jdt.ui-3.6.0.xml deleted file mode 100644 index 6dcf54f0..00000000 --- a/buildScripts/ivy-repo/org.eclipse.custom-jdt.ui-3.6.0.xml +++ /dev/null @@ -1,14 +0,0 @@ -<ivy-module version="2.0"> - <info organisation="org.eclipse.custom" module="jdt.ui" revision="3.6.0" publication="20100602160000"> - <license name="Eclipse Public Licence v1.0" url="http://www.eclipse.org/org/documents/epl-v10.php" /> - <description homepage="http://www.eclipse.org/eclipse/" /> - </info> - <configurations> - <conf name="default" /> - <conf name="sources" /> - </configurations> - <publications> - <artifact conf="default" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.jdt.ui_3.6.0.v20100602-1600.jar" /> - <artifact type="zip" conf="sources" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.jdt.ui_3.6.0.v20100602-1600-sources.jar" /> - </publications> -</ivy-module> diff --git a/buildScripts/ivy-repo/org.eclipse.custom-jdt.ui-3.9.1.xml b/buildScripts/ivy-repo/org.eclipse.custom-jdt.ui-3.9.1.xml deleted file mode 100644 index e57bad7a..00000000 --- a/buildScripts/ivy-repo/org.eclipse.custom-jdt.ui-3.9.1.xml +++ /dev/null @@ -1,14 +0,0 @@ -<ivy-module version="2.0"> - <info organisation="org.eclipse.custom" module="jdt.ui" revision="3.9.1" publication="20130820142700"> - <license name="Eclipse Public Licence v1.0" url="http://www.eclipse.org/org/documents/epl-v10.php" /> - <description homepage="http://www.eclipse.org/eclipse/" /> - </info> - <configurations> - <conf name="default" /> - <conf name="sources" /> - </configurations> - <publications> - <artifact conf="default" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.jdt.ui_3.9.1.v20130820-1427.jar" /> - <artifact type="zip" conf="sources" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.jdt.ui_3.9.1.v20130820-1427-sources.jar" /> - </publications> -</ivy-module> diff --git a/buildScripts/ivy-repo/org.eclipse.custom-osgi-3.6.0.xml b/buildScripts/ivy-repo/org.eclipse.custom-osgi-3.6.0.xml deleted file mode 100644 index 7cca0e05..00000000 --- a/buildScripts/ivy-repo/org.eclipse.custom-osgi-3.6.0.xml +++ /dev/null @@ -1,14 +0,0 @@ -<ivy-module version="2.0"> - <info organisation="org.eclipse.custom" module="osgi" revision="3.6.0" publication="20100517120000"> - <license name="Eclipse Public Licence v1.0" url="http://www.eclipse.org/org/documents/epl-v10.php" /> - <description homepage="http://www.eclipse.org/eclipse/" /> - </info> - <configurations> - <conf name="default" /> - <conf name="sources" /> - </configurations> - <publications> - <artifact conf="default" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.osgi_3.6.0.v20100517.jar" /> - <artifact type="zip" conf="sources" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.osgi_3.6.0.v20100517-sources.jar" /> - </publications> -</ivy-module> diff --git a/buildScripts/ivy-repo/org.eclipse.custom-osgi-3.9.0.xml b/buildScripts/ivy-repo/org.eclipse.custom-osgi-3.9.0.xml deleted file mode 100644 index 83e009eb..00000000 --- a/buildScripts/ivy-repo/org.eclipse.custom-osgi-3.9.0.xml +++ /dev/null @@ -1,14 +0,0 @@ -<ivy-module version="2.0"> - <info organisation="org.eclipse.custom" module="osgi" revision="3.9.0" publication="20130529171000"> - <license name="Eclipse Public Licence v1.0" url="http://www.eclipse.org/org/documents/epl-v10.php" /> - <description homepage="http://www.eclipse.org/eclipse/" /> - </info> - <configurations> - <conf name="default" /> - <conf name="sources" /> - </configurations> - <publications> - <artifact conf="default" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.osgi_3.9.0.v20130529-1710.jar" /> - <artifact type="zip" conf="sources" url="https://projectlombok.org/ivyrepo/eclipse/org.eclipse.osgi_3.9.0.v20130529-1710-sources.jar" /> - </publications> -</ivy-module> diff --git a/buildScripts/ivy.xml b/buildScripts/ivy.xml index 1d8fc26b..14530f06 100644 --- a/buildScripts/ivy.xml +++ b/buildScripts/ivy.xml @@ -1,64 +1,63 @@ <ivy-module version="2.0"> <info organisation="projectlombok.org" module="lombok" /> <configurations> - <conf name="eclipseBuild" /> - <conf name="netbeansBuild" /> - <conf name="buildBase" extends="netbeansBuild, javac6" /> - <conf name="build" extends="buildBase, eclipseBuild" /> - <conf name="moduleBuild" /> - <conf name="buildWithoutEclipse" extends="buildBase" /> - <conf name="runtime" /> - <conf name="test" extends="runtime" /> - <conf name="contrib" /> - <conf name="ecj7" /> - <conf name="ecj8" /> - <conf name="ecj9" /> + <!-- dependencies for the build itself, such as tools to create the website or deploy to servers. --> + <conf name="buildtools" /> + + <!-- dependencies needed only for the 'manage lombok supporters' part of the build --> + <conf name="supporters" /> + + <!-- test: base dependencies required to run the tests. Does not include javac or ecj. --> + <conf name="test" /> + + <!-- stripe: dependencies that need to be on the classpath during builds --> + <conf name="build" /> + + <!-- stripe: dependencies that need to be striped into lombok.jar itself, and are required for both build and test/run purposes --> + <conf name="stripe" /> + + <!-- sources of various dependencies where having the sources is useful (for example for debugging purposes) --> + <conf name="sources" /> + + <!-- and now for custom configs for testing lombok against --> + <conf name="javac6" /> <conf name="javac7" /> - <conf name="supporters" /> + <conf name="javac8" /> + + <conf name="ecj8" /> + <conf name="ecj11" /> + <conf name="ecj14" /> + + <conf name="eclipse-oxygen" /> + <conf name="eclipse-202006" /> + + <conf name="mapstruct" /> </configurations> <dependencies> - <dependency org="org.projectlombok" name="lombok.patcher" rev="0.36" conf="buildBase->default; runtime->default" /> - <dependency org="zwitserloot.com" name="cmdreader" rev="1.2" conf="buildBase->runtime; runtime" /> - - <dependency org="junit" name="junit" rev="4.8.2" conf="test->default; contrib->sources" /> - <dependency org="log4j" name="log4j" rev="1.2.17" conf="test->default; contrib->sources" /> - <dependency org="org.apache.logging.log4j" name="log4j-api" rev="2.11.1" conf="test->default; contrib->sources" /> - <dependency org="commons-logging" name="commons-logging" rev="1.2" conf="test->default; contrib->sources" /> - <dependency org="org.slf4j" name="slf4j-api" rev="1.8.0-beta2" conf="test->default; contrib->sources" /> - <dependency org="org.slf4j" name="slf4j-ext" rev="1.8.0-beta2" conf="test->default; contrib->sources" /> - <dependency org="org.jboss.logging" name="jboss-logging" rev="3.3.0.Final" conf="test->default; contrib->sources" /> - <dependency org="com.google.flogger" name="flogger" rev="0.2" conf="test->default; contrib->sources" /> - - <dependency org="com.google.guava" name="guava" rev="18.0" conf="test->default; contrib->sources" /> + + <dependency org="org.projectlombok" name="lombok.patcher" rev="0.36" conf="build,stripe->default" /> + <dependency org="zwitserloot.com" name="cmdreader" rev="1.2" conf="build,stripe->runtime" /> + <dependency org="projectlombok.org" name="spi" rev="0.2.7" conf="build" /> + <dependency org="org.apache.ant" name="ant" rev="1.10.5" conf="build->default" /> + + <!-- test deps --> + <dependency org="junit" name="junit" rev="4.8.2" conf="test->default; sources" /> + <dependency org="log4j" name="log4j" rev="1.2.17" conf="test->default; sources" /> + <dependency org="org.apache.logging.log4j" name="log4j-api" rev="2.11.1" conf="test->default; sources" /> + <dependency org="commons-logging" name="commons-logging" rev="1.2" conf="test->default; sources" /> + <dependency org="org.slf4j" name="slf4j-api" rev="1.8.0-beta2" conf="test->default; sources" /> + <dependency org="org.slf4j" name="slf4j-ext" rev="1.8.0-beta2" conf="test->default; sources" /> + <dependency org="org.jboss.logging" name="jboss-logging" rev="3.3.0.Final" conf="test->default; sources" /> + <dependency org="com.google.flogger" name="flogger" rev="0.2" conf="test->default; sources" /> + <dependency org="com.google.guava" name="guava" rev="18.0" conf="test->default; sources" /> <dependency org="com.google.code.findbugs" name="findbugs" rev="3.0.1" conf="test->master" /> - <dependency org="org.apache.ant" name="ant" rev="1.10.5" conf="buildBase->default; contrib->sources" /> - <dependency org="projectlombok.org" name="spi" rev="0.2.7" conf="buildBase->build" /> - <dependency org="com.hierynomus" name="sshj" rev="0.26.0" conf="buildBase->default" /> - <dependency org="projectlombok.org" name="markdownj" rev="1.02b4" conf="buildBase->build" /> - <dependency org="de.java2html" name="java2html" rev="5.0" conf="buildBase->default" /> - <dependency org="org.freemarker" name="freemarker" rev="2.3.28" conf="buildBase->default" /> - - <dependency org="net.java.openjdk.custom" name="javac6" rev="1.6.0.18" conf="javac6->runtime; contrib->sources" /> - <dependency org="net.java.openjdk.custom" name="javac7" rev="1.7.0" conf="javac7->runtime; contrib->sources" /> - <dependency org="org.eclipse.custom" name="ecj" rev="4.3.1" conf="ecj7->default; contrib->sources" /> - <dependency org="org.eclipse.jdt.core.compiler" name="ecj" rev="4.6.1" conf="ecj8->default; contrib->sources" /> - <dependency org="org.eclipse.jdt" name="ecj" rev="3.15.1" conf="ecj9->default; eclipseBuild->default" /> - <dependency org="org.eclipse.jdt" name="org.eclipse.jdt.compiler.apt" rev="1.3.300" conf="ecj9->default; eclipseBuild->default" /> - - <dependency org="netbeans.org" name="boot" rev="6.8beta" conf="netbeansBuild->build" /> - <dependency org="netbeans.org" name="openide.modules" rev="6.8beta" conf="netbeansBuild->build" /> - <dependency org="netbeans.org" name="openide.util" rev="6.8beta" conf="netbeansBuild->build" /> - <dependency org="netbeans.org" name="modules.java.source" rev="6.8beta" conf="netbeansBuild->build" /> - - <dependency org="org.eclipse.platform" name="org.eclipse.core.runtime" rev="3.17.0" conf="eclipseBuild->default; contrib->sources" transitive="false" /> - <dependency org="org.eclipse.jdt" name="org.eclipse.jdt.core" rev="3.20.0" conf="eclipseBuild->default; contrib->sources" transitive="false" /> - <dependency org="org.eclipse.jdt" name="org.eclipse.jdt.ui" rev="3.12.2" conf="eclipseBuild->default; contrib->sources" transitive="false" /> - <dependency org="org.eclipse.platform" name="org.eclipse.equinox.common" rev="3.10.600" conf="eclipseBuild->default; contrib->sources" transitive="false" /> - <dependency org="org.eclipse.platform" name="org.eclipse.osgi" rev="3.15.100" conf="eclipseBuild->default; contrib->sources" transitive="false" /> - <dependency org="org.eclipse.platform" name="org.eclipse.core.resources" rev="3.13.600" conf="eclipseBuild->default; contrib->sources" transitive="false" /> - <dependency org="org.eclipse.platform" name="org.eclipse.core.jobs" rev="3.10.600" conf="eclipseBuild->default; contrib->sources" transitive="false" /> + <!-- build tooling --> + <dependency org="com.hierynomus" name="sshj" rev="0.26.0" conf="buildtools->default" /> + <dependency org="projectlombok.org" name="markdownj" rev="1.02b4" conf="buildtools->build" /> + <dependency org="de.java2html" name="java2html" rev="5.0" conf="buildtools->default" /> + <dependency org="org.freemarker" name="freemarker" rev="2.3.28" conf="buildtools->default" /> <dependency org="org.eclipse.jgit" name="org.eclipse.jgit.ant" rev="5.2.0.201812061821-r" conf="supporters->default" /> <dependency org="org.eclipse.jgit" name="org.eclipse.jgit" rev="5.2.0.201812061821-r" conf="supporters->default" /> @@ -66,6 +65,40 @@ <dependency org="com.rimerosolutions.ant" name="ant-git-tasks" rev="1.3.2" conf="supporters->default" /> <dependency org="org.slf4j" name="slf4j-simple" rev="1.8.0-beta2" conf="supporters->default" /> - <dependency org="org.mapstruct" name="mapstruct-processor" rev="1.3.0.Beta1" conf="moduleBuild->default" /> + <!-- javacs --> + <dependency org="net.java.openjdk.custom" name="javac6" rev="1.6.0.18" conf="javac6->runtime" /> + <dependency org="net.java.openjdk.custom" name="javac7" rev="1.7.0" conf="javac7->runtime" /> + <dependency org="net.java.openjdk.custom" name="javac8" rev="1.8.0" conf="javac8->runtime" /> + + <!-- ecjs --> + + <dependency org="org.eclipse.jdt" name="ecj" rev="3.22.0.v20200530-2032" conf="ecj14->master" /> + <dependency org="org.eclipse.jdt" name="ecj" rev="3.16.0" conf="ecj11->master" /> + <!-- until oct 2016, ecj was released under org 'org.eclipse.jdt.core.compiler', and the versioning followed eclipse's versions. --> + <!-- after that, it switched to group 'org.eclipse.jdt', and follows its own version. That means 3.16.0 is a later release than 4.6.1 on the old group! --> + <dependency org="org.eclipse.jdt.core.compiler" name="ecj" rev="4.4.2" conf="ecj8->master" /> + + <!-- eclipses --> + + <dependency org="org.eclipse.platform" name="org.eclipse.core.runtime" rev="3.13.0" conf="eclipse-oxygen->default" transitive="false" /> + <dependency org="org.eclipse.jdt" name="org.eclipse.jdt.core" rev="3.13.102" conf="eclipse-oxygen->default" transitive="false" /> + <dependency org="org.eclipse.jdt" name="org.eclipse.jdt.ui" rev="3.13.100" conf="eclipse-oxygen->default" transitive="false" /> + <dependency org="org.eclipse.platform" name="org.eclipse.equinox.common" rev="3.9.0" conf="eclipse-oxygen->default" transitive="false" /> + <dependency org="org.eclipse.platform" name="org.eclipse.core.resources" rev="3.12.0" conf="eclipse-oxygen->default" transitive="false" /> + <dependency org="org.eclipse.platform" name="org.eclipse.core.jobs" rev="3.9.0" conf="eclipse-oxygen->default" transitive="false" /> + <dependency org="org.eclipse.platform" name="org.eclipse.osgi" rev="3.12.100" conf="eclipse-oxygen->default" transitive="false" /> + <dependency org="org.eclipse.platform" name="org.eclipse.text" rev="3.6.100" conf="eclipse-oxygen->default" transitive="false" /> + + <dependency org="org.eclipse.platform" name="org.eclipse.core.runtime" rev="3.18.0" conf="eclipse-202006->default" transitive="false" /> + <dependency org="org.eclipse.jdt" name="org.eclipse.jdt.core" rev="3.22.0" conf="eclipse-202006->default" transitive="false" /> + <dependency org="org.eclipse.jdt" name="org.eclipse.jdt.ui" rev="3.21.100" conf="eclipse-202006->default" transitive="false" /> + <dependency org="org.eclipse.platform" name="org.eclipse.equinox.common" rev="3.12.0" conf="eclipse-202006->default" transitive="false" /> + <dependency org="org.eclipse.platform" name="org.eclipse.core.resources" rev="3.13.700" conf="eclipse-202006->default" transitive="false" /> + <dependency org="org.eclipse.platform" name="org.eclipse.core.jobs" rev="3.10.800" conf="eclipse-202006->default" transitive="false" /> + <dependency org="org.eclipse.platform" name="org.eclipse.osgi" rev="3.15.300" conf="eclipse-202006->default" transitive="false" /> + <dependency org="org.eclipse.platform" name="org.eclipse.text" rev="3.10.200" conf="eclipse-202006->default" transitive="false" /> + + <!-- integration with other libraries --> + <dependency org="org.mapstruct" name="mapstruct-processor" rev="1.3.1.Final" conf="mapstruct->default" transitive="false" /> </dependencies> </ivy-module> diff --git a/buildScripts/ivysettings.xml b/buildScripts/ivysettings.xml index bafdc801..765dad02 100644 --- a/buildScripts/ivysettings.xml +++ b/buildScripts/ivysettings.xml @@ -4,6 +4,7 @@ <filesystem name="projectLocalRepo"> <ivy pattern="${ivy.settings.dir}/ivy-repo/[organization]-[module]-[revision].xml" /> </filesystem> + <ibiblio name="eclipse-staging-repo" m2compatible="true" root="https://repo.eclipse.org/content/repositories/eclipse-staging" /> <ibiblio name="maven-repo2" m2compatible="true" root="https://repo1.maven.org/maven2" /> </chain> </resolvers> diff --git a/buildScripts/mapstruct-old.ant.xml b/buildScripts/mapstruct-old.ant.xml new file mode 100644 index 00000000..cf14dd93 --- /dev/null +++ b/buildScripts/mapstruct-old.ant.xml @@ -0,0 +1,169 @@ +<!-- + 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.mapstruct-old" xmlns:ivy="antlib:com.zwitserloot.ivyplusplus" basedir=".."> + <description> +This buildfile is part of projectlombok.org. It contains leftover tasks from the previous version +of the build that are related to mapstruct. We will clean this up or remove it soon. + </description> + + <target name="testAp-compile" depends="ensureBuildDeps"> + <delete file="build/testAP/META-INF/services/javax.annotation.processing.Processor" quiet="true" /> + <ivy:compile destdir="build/testAP" source="1.7" target="1.7" ecj="true"> + <bootclasspath path="${rt-openjdk8}" /> + <src path="src/testAP" /> + </ivy:compile> + + <mkdir dir="build/testAP/META-INF" /> + <mkdir dir="build/testAP/META-INF/services" /> + <echo file="build/testAP/META-INF/services/javax.annotation.processing.Processor">org.projectlombok.testAp.TestAp</echo> + </target> + + <target name="testAp-dist" depends="testAp-compile"> + <mkdir dir="dist" /> + <tstamp> + <format property="releaseTimestamp" pattern="yyyy-MM-dd" /> + </tstamp> + <zip destfile="dist/testAp-${releaseTimestamp}.jar"> + <fileset dir="." includes="LICENSE" /> + <fileset dir="build/testAp" /> + </zip> + <copy file="dist/testAp-${releaseTimestamp}.jar" tofile="dist/testAp.jar" /> + </target> + + <target name="testAp" depends="testAp-dist, dist"> + <echo>Running in order: First Lombok, Then testAP</echo> + + <delete dir="build/useTestAp" quiet="true" /> + <mkdir dir="build/useTestAp" /> + <javac verbose="false" source="1.7" target="1.7" destdir="build/useTestAp" includeantruntime="false"> + <src path="src/useTestAP" /> + <classpath location="dist/lombok.jar" /> + <classpath location="dist/testAp.jar" /> + <compilerarg value="-processor" /> + <compilerarg value="lombok.launch.AnnotationProcessorHider$AnnotationProcessor,org.projectlombok.testAp.TestAp" /> + </javac> + + <echo>Running in order: First TestAP, Then Lombok</echo> + + <delete dir="build/useTestAp" quiet="true" /> + <mkdir dir="build/useTestAp" /> + <javac verbose="false" source="1.7" target="1.7" destdir="build/useTestAp" includeantruntime="false"> + <src path="src/useTestAP" /> + <classpath location="dist/lombok.jar" /> + <classpath location="dist/testAp.jar" /> + <compilerarg value="-processor" /> + <compilerarg value="org.projectlombok.testAp.TestAp,lombok.launch.AnnotationProcessorHider$AnnotationProcessor" /> + </javac> + </target> + + <target name="-compileMapstruct"> + <mkdir dir="build/mapstruct" /> + <javac includeAntRuntime="false" source="1.9" target="1.9" destdir="build/mapstruct"> + <src path="src/j9stubs" /> + <!-- This includes org.mapstruct.ap.spi.AstModifyingAnnotationProcessor; putting this on the classpath doesn't work (needs to be internal or a module) so we just add it and then delete the class file for convenience. --> + </javac> + <mkdir dir="build/lombok/secondaryLoading.SCL.lombok/org/mapstruct/ap/spi" /> + <move file="build/mapstruct/org/mapstruct/ap/spi/AstModifyingAnnotationProcessor.class" tofile="build/lombok/secondaryLoading.SCL.lombok/org/mapstruct/ap/spi/AstModifyingAnnotationProcessor.SCL.lombok" /> + </target> + + <target name="-mapstructBindingPrepare" depends="-compileMapstruct"> + <mkdir dir="build/mapstruct-module-path" /> + <copy file="dist/lombok.jar" todir="build/mapstruct-module-path" /> + <jar destfile="build/mapstruct-module-path/mapstruct-processor.jar" basedir="build/mapstruct" includes="org/**"> + <manifest> + <attribute name="Automatic-Module-Name" value="org.mapstruct.processor" /> + </manifest> + </jar> + + <mkdir dir="build/mapstruct-binding/maven" /> + <copy tofile="build/mapstruct-binding/maven/pom.xml" overwrite="true" file="doc/mapstruct-binding-maven-pom.xml"> + <filterchain> + <replacetokens> + <token key="VERSION" value="${mapstruct-binding.version}" /> + </replacetokens> + </filterchain> + </copy> + </target> + + <target name="-mapstructBindingDoc" depends="-mapstructBindingPrepare"> + <mkdir dir="build/mapstruct-binding/api" /> + <javadoc + Package="true" + packagenames="lombok.*" + sourcepath="src/bindings/mapstruct" + classpath="build/mapstruct" + defaultexcludes="yes" + destdir="build/mapstruct-binding/api" + windowtitle="Lombok Mapstruct Binding" + source="1.8" /> + + <!-- bugfix for boneheaded javadoc bug where ?is-external=true is inserted before an anchor ref, breaking the anchor ref. + is-external=true doesn't actually do anything, so, we'll just get rid of it. --> + <replaceregexp match="\?is-external=true#" replace="#" flags="gi"> + <fileset dir="build/mapstruct-binding/api" includes="**/*.html" /> + </replaceregexp> + + <jar destfile="dist/lombok-mapstruct-binding-${mapstruct-binding.version}-javadoc.jar" basedir="build/mapstruct-binding/api" includes="**" /> + </target> + + <target name="-mapstructBindingJar" depends="dist,-mapstructBindingPrepare"> + <mkdir dir="build/mapstruct-binding/classes" /> + <echo file="build/mapstruct-binding/classes/META-INF/services/org.mapstruct.ap.spi.AstModifyingAnnotationProcessor">lombok.mapstruct.NotifierHider$AstModificationNotifier</echo> + + <javac includeAntRuntime="false" source="1.9" target="1.9" destdir="build/mapstruct-binding/classes" modulepath="build/mapstruct-module-path"> + <src path="src/bindings/mapstruct" /> + </javac> + <jar destfile="dist/lombok-mapstruct-binding-${mapstruct-binding.version}.jar" basedir="build/mapstruct-binding/classes" includes="**" /> + </target> + + <target name="-mapstructBindingSrc" depends="-mapstructBindingJar"> + <jar destfile="dist/lombok-mapstruct-binding-${mapstruct-binding.version}-sources.jar" basedir="src/bindings/mapstruct" includes="**" /> + </target> + + <target name="mapstructBinding" depends="dist,-mapstructBindingJar,-mapstructBindingDoc,-mapstructBindingSrc"> + </target> + + <target name="mapstructMaven" depends="mapstructBinding,-mvn-ext" description="Create a maven repo for mapstruct binding into a build dir."> + <property environment="env" /> + <delete quiet="true" dir="build/mapstruct-binding-maven" /> + <mkdir dir="build/mapstruct-binding-maven" /> + <condition property="mvn-exe" value="${env.MAVEN_HOME}/bin/mvn${mvn-ext}" else="mvn${mvn-ext}"> + <isset property="env.MAVEN_HOME" /> + </condition> + + <exec executable="${mvn-exe}" failifexecutionfails="false" resultproperty="mvn-result"> + <arg value="deploy:deploy-file" /> + <arg value="-Dfile=dist/lombok-mapstruct-binding-${mapstruct-binding.version}.jar" /> + <arg value="-Dsources=dist/lombok-mapstruct-binding-${mapstruct-binding.version}-sources.jar" /> + <arg value="-Djavadoc=dist/lombok-mapstruct-binding-${mapstruct-binding.version}-javadoc.jar" /> + <arg value="-DgroupId=org.projectlombok" /> + <arg value="-DartifactId=lombok-mapstruct-binding" /> + <arg value="-Dversion=${mapstruct-binding.version}" /> + <arg value="-DpomFile=build/mapstruct-binding/maven/pom.xml" /> + <arg value="-Durl=file://${basedir}/build/mapstruct-binding-maven" /> + </exec> + <condition property="mvn-notfound" value="true"> + <not><isset property="mvn-result" /></not> + </condition> + <fail message="mvn is not on your path and/or MAVEN_HOME is not set. Add mvn to your path or set MAVEN_HOME to continue." if="mvn-notfound" /> + </target> +</project> diff --git a/buildScripts/maven.ant.xml b/buildScripts/maven.ant.xml new file mode 100644 index 00000000..329eacec --- /dev/null +++ b/buildScripts/maven.ant.xml @@ -0,0 +1,126 @@ +<!-- + 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.maven" xmlns:ivy="antlib:com.zwitserloot.ivyplusplus" basedir=".."> + <description> +This buildfile is part of projectlombok.org. It makes maven-compatible repositories. + </description> + + <condition property="exe.mvn.base" value="mvn.cmd" else="mvn"> + <os family="windows" /> + </condition> + <condition property="exe.mvn" value="${env.MAVEN_HOME}/bin/${exe.mvn.base}" else="${exe.mvn.base}"> + <isset property="env.MAVEN_HOME" /> + </condition> + + <macrodef name="maven.make"> + <attribute name="version-name" /> + <sequential> + <jar destfile="dist/lombok-${lombok.version}-javadoc.jar"> + <fileset dir="doc/api" /> + </jar> + + <jar destfile="dist/lombok-${lombok.version}-sources.jar"> + <fileset dir="src/core" /> + <fileset dir="src/launch" /> + <fileset dir="src/utils" /> + <fileset dir="src/eclipseAgent" /> + <fileset dir="src/installer" /> + <fileset dir="src/delombok" /> + <fileset dir="test/transform/src" /> + <fileset dir="test/core/src" /> + </jar> + + <copy tofile="build/pom.xml" overwrite="true" file="doc/maven-pom.xml"> + <filterchain> + <replacetokens> + <token key="VERSION" value="@{version-name}" /> + </replacetokens> + </filterchain> + </copy> + </sequential> + </macrodef> + + <target name="maven" depends="version, dist, javadoc.build" description="Creates a maven repo for the current release into a build dir. The intent is for you to put that on a server someplace. Will invoke your local mvn installation."> + <mkdir dir="build" /> + <mkdir dir="dist" /> + + <maven.make version-name="${lombok.version}" /> + <tar destfile="dist/mavenPublish.tar.bz2" compression="bzip2"> + <tarfileset dir="dist"> + <include name="lombok-${lombok.version}.jar" /> + <include name="lombok-${lombok.version}-sources.jar" /> + <include name="lombok-${lombok.version}-javadoc.jar" /> + </tarfileset> + <tarfileset dir="build" includes="pom.xml" /> + </tar> + </target> + + <target name="maven.publish" depends="maven, setup.ssh"> + <ivy:scpUpload + from="dist/mavenPublish.tar.bz2" + to="/data/lombok/staging" + server="projectlombok.org" + username="${ssh.username}" + keyfile="${ssh.keyfile}" + knownHosts="ssh.knownHosts" /> + <ivy:sshExec + cmd="/data/lombok/stagingCmd/publishToMavenCentral" + server="projectlombok.org" + username="${ssh.username}" + keyfile="${ssh.keyfile}" + knownHosts="ssh.knownHosts" /> + <echo>The artifact has been published to staging. Now go to https://oss.sonatype.org/ and log in as Reinier, then doublecheck if all is well and 'release' it.</echo> + <ivy:sshExec + cmd="/data/lombok/stagingCmd/showMavenCentralPassword" + server="projectlombok.org" + username="${ssh.username}" + keyfile="${ssh.keyfile}" + knownHosts="ssh.knownHosts" /> + </target> + + <target name="maven.edge" depends="version, dist, javadoc.build" description="Create a maven repo for the current snapshot into a build dir. The intent is for you to put that on a server someplace. Will invoke your local mvn installation."> + <delete quiet="true" dir="build/edge-releases" /> + <mkdir dir="build/edge-releases" /> + + <maven.make version-name="edge-SNAPSHOT" /> + + <local name="mvn.result" /> + <exec executable="${exe.mvn}" failifexecutionfails="false" resultproperty="mvn.result"> + <arg value="deploy:deploy-file" /> + <arg value="-Dfile=dist/lombok-${lombok.version}.jar" /> + <arg value="-Dsources=dist/lombok-${lombok.version}-sources.jar" /> + <arg value="-Djavadoc=dist/lombok-${lombok.version}-javadoc.jar" /> + <arg value="-DgroupId=org.projectlombok" /> + <arg value="-DartifactId=lombok" /> + <arg value="-Dversion=edge-SNAPSHOT" /> + <arg value="-DpomFile=build/pom.xml" /> + <arg value="-Durl=file://${basedir}/build/edge-releases" /> + </exec> + + <fail> + mvn is not on your path and/or MAVEN_HOME is not set. Add mvn to your path or set MAVEN_HOME to continue. + <condition> + <not><isset property="mvn.result" /></not> + </condition> + </fail> + </target> +</project> diff --git a/buildScripts/setup.ant.xml b/buildScripts/setup.ant.xml new file mode 100644 index 00000000..c72517c8 --- /dev/null +++ b/buildScripts/setup.ant.xml @@ -0,0 +1,175 @@ +<!-- + 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.setup" default="deps" xmlns:ivy="antlib:com.zwitserloot.ivyplusplus" basedir=".."> + <description> +This buildfile is part of projectlombok.org. It sets up the build itself. + </description> + + <property name="pattern.jdk11plus" value="^(\d\d\d+|1[1-9]|[2-9]\d)(\..*)?$" /> + <property name="ivy.retrieve.pattern" value="lib/[conf]/[organisation]-[artifact].[ext]" /> + <property environment="env" /> + <available file="lib/ivyplusplus.jar" property="ivyplusplus.available" /> + + <property name="jdk-rt.loc" location="lib/openjdk6_rt.jar" /> + <property name="jdk8-rt.loc" location="lib/openjdk8_rt.jar" /> + <available file="${jdk-rt.loc}" property="jdk-rt.available" /> + <available file="${jdk8-rt.loc}" property="jdk8-rt.available" /> + <property name="ssh.configuration.file" location="ssh.configuration" /> + + <target name="-setup.ssh.ask"> + <propertyfile file="${ssh.configuration.file}" /> + <fail> + Your ssh.configuration file is corrupted; delete it and rerun this script. + <condition> + <or> + <and> + <isset property="ssh.username" /> + <equals arg1="" arg2="${ssh.username}" /> + </and> + <and> + <isset property="ssh.keyfile" /> + <equals arg1="" arg2="${ssh.keyfile}" /> + </and> + </or> + </condition> + </fail> + <fail> + The keyfile configured in your ${ssh.configuration.file} file does not exist. + <condition> + <and> + <isset property="ssh.keyfile" /> + <not><available file="${ssh.keyfile}" /></not> + </and> + </condition> + </fail> + + <condition property="ssh.configuration.write"> + <or> + <not><isset property="ssh.username" /></not> + <not><isset property="ssh.keyfile" /></not> + </or> + </condition> + <input message="What is your SSH username on the projectlombok.org server? (Enter to abort)." addproperty="ssh.username" /> + <fail>Aborted<condition><equals arg1="" arg2="${ssh.username}" /></condition></fail> + <input message="Where is your ssh keyfile located? (Enter to abort)." addproperty="ssh.keyfile" defaultvalue="${user.home}/.ssh/id_rsa" /> + <fail>File ${ssh.keyfile} does not exist<condition><not><available file="${ssh.keyfile}" /></not></condition></fail> + </target> + + <target name="-setup.ssh.save" if="ssh.configuration.write"> + <propertyfile file="${ssh.configuration.file}" comment="SSH connect info for projectlombok.org."> + <entry key="ssh.username" value="${ssh.username}" /> + <entry key="ssh.keyfile" value="${ssh.keyfile}" /> + </propertyfile> + <echo>Your connection info has been written to ${ssh.configuration.file} and will be remembered for future invocations.</echo> + </target> + + <target name="setup.ssh" depends="-setup.ssh.ask, -setup.ssh.save" /> + + <target name="clean" description="Removes all generated files."> + <delete dir="build" quiet="true" /> + </target> + + <target name="clean.dist" depends="clean" description="Deletes everything that this build script has ever generated."> + <delete dir="lib" quiet="true" /> + <delete dir="dist" quiet="true" /> + <delete file=".project" quiet="true" /> + <delete file=".classpath" quiet="true" /> + <delete dir=".settings" quiet="true" /> + <delete dir=".idea" quiet="true" /> + <delete file="lombok.iml" quiet="true" /> + <delete dir="ivyCache" quiet="true" /> + </target> + + <target name="-ipp.download" unless="ivyplusplus.available"> + <mkdir dir="lib" /> + <get src="https://projectlombok.org/downloads/ivyplusplus.jar" dest="lib/ivyplusplus.jar" usetimestamp="true" /> + </target> + + <target name="-ipp.load" depends="-ipp.download"> + <taskdef classpath="lib/ivyplusplus.jar" resource="com/zwitserloot/ivyplusplus/antlib.xml" uri="antlib:com.zwitserloot.ivyplusplus" /> + <ivy:ensureippversion version="1.36" property="ivyplusplus.minimumAvailable" /> + </target> + + <target name="-ipp.redownload" 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="ipp.setup" depends="-ipp.load, -ipp.redownload" /> + + <target name="ivy.config" depends="ipp.setup" unless="ivy.config"> + <ivy:configure file="buildScripts/ivysettings.xml" /> + <property name="ivy.config" value="true" /> + </target> + + <target name="deps.jdk6-runtime" unless="jdk-rt.available"> + <echo>To ensure stable builds and avoid accessing API that was not available in JDK6, most of lombok is set up to build against OpenJDK6's runtime, which will now be downloaded...</echo> + <mkdir dir="lib" /> + <get src="https://projectlombok.org/ivyrepo/langtools/rt-openjdk6.jar" dest="${jdk-rt.loc}" verbose="true" usetimestamp="true" /> + </target> + + <target name="deps.jdk8-runtime" unless="jdk8-rt.available"> + <echo>To test java8, we need a java8 runtime, which will now be downloaded...</echo> + <mkdir dir="lib" /> + <get src="https://projectlombok.org/ivyrepo/langtools/rt-openjdk8.jar" dest="${jdk8-rt.loc}" verbose="true" usetimestamp="true" /> + </target> + + <target name="deps.jdk-runtime" depends="deps.jdk6-runtime" /> + + <target name="deps.custom" depends="ivy.config" description="Download the dependencies that comprise a configuration (from ivy.xml)"> + <fail unless="deps.conf">Supply ant with -Ddeps.conf=confname to pick the configuration you want to fetch</fail> + <ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="${deps.conf}" /> + <ivy:retrieve symlink="true" /> + </target> + + <target name="-deps.javac" depends="ivy.config"> + <ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="javac${javac.wanted}" /> + <ivy:retrieve symlink="true" /> + <ivy:cachepath pathid="cp.javac${javac.wanted}" conf="javac${javac.wanted}" /> + </target> + + <target name="deps" depends="ivy.config, deps.jdk-runtime" description="Downloads all dependencies needed for common tasks"> + <ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="javac6,javac8,ecj8,build,eclipse-oxygen,mapstruct,sources,stripe,buildtools,test" /> + <ivy:retrieve symlink="true" /> + <ivy:cachepath pathid="cp.javac6" conf="javac6" /> + <ivy:cachepath pathid="cp.javac8" conf="javac8" /> + <ivy:cachepath pathid="cp.ecj8" conf="ecj8" /> + <ivy:cachepath pathid="cp.build" conf="build" /> + <ivy:cachepath pathid="cp.eclipse-oxygen" conf="eclipse-oxygen" /> + <ivy:cachepath pathid="cp.eclipse-202006" conf="eclipse-202006" /> + <ivy:cachepath pathid="cp.mapstruct" conf="mapstruct" /> + <ivy:cachepath pathid="cp.stripe" conf="stripe" /> + <ivy:cachepath pathid="cp.buildtools" conf="buildtools" /> + <ivy:cachepath pathid="cp.test" conf="test" /> + </target> + + <fail>ant needs to be at least v1.10.0 or higher to build lombok. Your version is: ${ant.version} + <condition> + <not><antversion atleast="1.10.0" /></not> + </condition> + </fail> + <fail>lombok must be compiled on jdk11 or later. Your version is: ${ant.java.version} + <condition> + <not><matches string="${ant.java.version}" pattern="${pattern.jdk11plus}" /></not> + </condition> + </fail> +</project> diff --git a/buildScripts/tests.ant.xml b/buildScripts/tests.ant.xml new file mode 100644 index 00000000..67edf28a --- /dev/null +++ b/buildScripts/tests.ant.xml @@ -0,0 +1,177 @@ +<!-- + 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.tests" default="test" xmlns:ivy="antlib:com.zwitserloot.ivyplusplus" basedir=".."> + <description> +This buildfile is part of projectlombok.org. It takes care of compiling and running tests. + </description> + + <target name="test.compile" depends="deps, compile" description="compiles the tests" unless="skip.tests"> + <mkdir dir="build/tests" /> + <ivy:compile destdir="build/teststubs" source="1.6" target="1.6" ecj="true" nowarn="true"> + <src path="test/stubs" /> + </ivy:compile> + <ivy:compile destdir="build/tests" source="1.5" target="1.5" ecj="true" nowarn="true"> + <bootclasspath path="${jdk-rt.loc}" /> + <classpath refid="cp.test" /> + <classpath refid="cp.eclipse-oxygen" /> + <classpath location="build/lombok" /> + <classpath location="build/tests" /> + <src path="test/core/src" /> + <src path="test/transform/src" /> + <src path="test/bytecode/src" /> + <src path="test/configuration/src" /> + </ivy:compile> + <mkdir dir="build/teststubs" /> + <ivy:compile destdir="build/teststubs" source="1.6" target="1.6" ecj="true" nowarn="true"> + <src path="test/stubs" /> + </ivy:compile> + </target> + + <target name="test.ecj11" depends="deps, dist" description="Runs a few ecj-specific tests" unless="skip.tests"> + <java jar="lib/ecj11/org.eclipse.jdt-ecj.jar" fork="true" failonerror="true"> + <jvmarg value="-javaagent:dist/lombok.jar=ecj" /> + <arg line="-source 1.6 -target 1.6 -cp dist/lombok.jar test/ecj/SimpleTest.java" /> + </java> + <echo>run ecj11 with a test file to confirm agent injection works: OK</echo> + </target> + + <property name="test.addopens.raw"> + --add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED + --add-opens jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED + --add-opens jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED + --add-opens jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED + --add-opens jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED + --add-opens jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED + --add-opens jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED + --add-opens jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED + </property> + <property name="test.limitmodules">--limit-modules java.base,jdk.unsupported</property> + + <loadresource property="test.addopens"> + <propertyresource name="test.addopens.raw" /> + <filterchain><tokenfilter> + <filetokenizer /> + <replaceregex pattern="\s+" replace=" " flags="g" /> + </tokenfilter></filterchain> + </loadresource> + + <target name="test.javac6" depends="test.compile" description="runs the tests on your default VM, using javac6 as underlying compiler"> + <echo>Running TestJavac on JVM${ant.java.version}, with lowest supported javac: 1.6.</echo> + <junit haltonfailure="yes" fork="true" forkmode="once"> + <jvmarg value="-Xbootclasspath/a:${jdk-rt.loc}" /> + <jvmarg line="${test.limitmodules}" /> + <jvmarg value="-Ddelombok.bootclasspath=${jdk-rt.loc}" /> + <formatter type="plain" usefile="false" unless="tests.quiet" /> + <classpath refid="cp.test" /> + <classpath refid="cp.stripe" /> + <classpath refid="cp.javac6" /> + <classpath location="build/lombok" /> + <classpath location="build/tests" /> + <test name="lombok.TestJavac" /> + </junit> + </target> + + <target name="test.javac8" depends="test.compile, deps.jdk8-runtime" description="runs the tests on your default VM, using javac8 as underlying compiler"> + <echo>Running TestJavac on JVM${ant.java.version}, with javac: 1.8.</echo> + <junit haltonfailure="yes" fork="true" forkmode="once"> + <jvmarg value="-Xbootclasspath/a:${jdk8-rt.loc}" /> + <jvmarg line="${test.limitmodules}" /> + <jvmarg value="-Ddelombok.bootclasspath=${jdk8-rt.loc}" /> + <formatter type="plain" usefile="false" unless="tests.quiet" /> + <classpath refid="cp.test" /> + <classpath refid="cp.stripe" /> + <classpath refid="cp.javac8" /> + <classpath location="build/lombok" /> + <classpath location="build/tests" /> + <test name="lombok.TestJavac" /> + </junit> + </target> + + <macrodef name="test.javacX"> + <attribute name="version" /> + <sequential> + <find-vm version="@{version}" /> + <echo>Running TestJavac with JVM ${jvm.loc.@{version}}.</echo> + + <junit haltonfailure="yes" fork="true" forkmode="once" jvm="${jvm.loc.@{version}}/bin/${exe.java}"> + <jvmarg line="${test.addopens}" /> + <formatter type="plain" usefile="false" unless="tests.quiet" /> + <classpath refid="cp.test" /> + <classpath refid="cp.stripe" /> + <classpath location="build/lombok" /> + <classpath location="build/tests" /> + <test name="lombok.TestJavac" /> + </junit> + </sequential> + </macrodef> + + <target name="test.javac11" depends="test.compile" description="runs the tests on your default VM, using javac11 as underlying compiler"> + <test.javacX version="11" /> + </target> + + <target name="test.javac14" depends="test.compile" description="runs the tests on your default VM, using javac14 as underlying compiler"> + <test.javacX version="14" /> + </target> + + <target name="test.javacCurrent" depends="test.compile" description="runs the tests on your default VM, using its javac as underlying compiler"> + <echo>Running TestJavac on JVM${ant.java.version}, with the javac built into your VM distributon.</echo> + <junit haltonfailure="yes" fork="true" forkmode="once"> + <jvmarg line="${test.addopens}" /> + <formatter type="plain" usefile="false" unless="tests.quiet" /> + <classpath refid="cp.test" /> + <classpath refid="cp.stripe" /> + <classpath location="build/lombok" /> + <classpath location="build/tests" /> + <test name="lombok.TestJavac" /> + </junit> + </target> + + <macrodef name="test.eclipse-X"> + <attribute name="version" /> + <sequential> + <echo>Running TestEclipse on eclipse-@{version} on JVM${ant.java.version}.</echo> + <junit haltonfailure="yes" fork="true" forkmode="once"> + <jvmarg value="-Xbootclasspath/a:${jdk8-rt.loc}" /> + <jvmarg value="-javaagent:dist/lombok.jar" /> + <jvmarg line="${test.addopens}" /> + <formatter type="plain" usefile="false" unless="tests.quiet" /> + <classpath refid="cp.test" /> + <classpath refid="cp.stripe" /> + <classpath refid="cp.eclipse-@{version}" /> + <classpath location="build/lombok" /> + <classpath location="build/tests" /> + <test name="lombok.TestEclipse" /> + </junit> + </sequential> + </macrodef> + + <target name="test.eclipse-oxygen" depends="test.compile" description="runs the tests on your default VM, testing the oxygen release of eclipse"> + <test.eclipse-X version="oxygen" /> + </target> + + <target name="test.eclipse-202006" depends="test.compile" description="runs the tests on your default VM, testing the 2020-03 release of eclipse"> + <test.eclipse-X version="202006" /> + </target> + + <target name="test" depends="test.javacCurrent, test.eclipse-202006" description="runs the tests against the default JVM, javac, and eclipse" /> + <target name="test.broad" depends="test.javac8, test.javac14, test.eclipse-oxygen, test.eclipse-202006" description="runs the tests against the default JVM, javac, and eclipse" /> +</project> diff --git a/buildScripts/vm-finder.ant.xml b/buildScripts/vm-finder.ant.xml new file mode 100644 index 00000000..2b2c4c4c --- /dev/null +++ b/buildScripts/vm-finder.ant.xml @@ -0,0 +1,191 @@ +<!-- + 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.vm-finder" xmlns:ivy="antlib:com.zwitserloot.ivyplusplus" basedir=".."> + <description> +This buildfile is part of projectlombok.org. It contains platform specific code to find installed JVMs. + </description> + + <available property="exe.java_home" value="/usr/libexec/java_home" file="/usr/libexec/java_home" /> + <property name="env.SystemRoot" value="C:\Windows" /> + <available property="exe.reg" value="${env.SystemRoot}/System32/reg.exe" file="${env.SystemRoot}/System32/reg.exe" /> + <condition property="exe.java" value="java.exe" else="java"> + <os family="windows" /> + </condition> + + <property name="jvm.locations.file" location="jvm.locations" /> + <property prefix="jvm.locations" file="${jvm.locations.file}" /> + + <target name="-find.vm.property"> + <condition property="jvm.loc" value="${jvm.loc.force}"> + <and> + <isset property="jvm.loc.force" /> + <not><matches string="${jvm.loc.force}" pattern="^\$\{jvm[0-9\.]+\.loc\}$" /></not> + </and> + </condition> + <condition property="jvm.loc.invalid"> + <and> + <isset property="jvm.loc" /> + <not><available file="${jvm.loc}/bin/${exe.java}" type="file" /></not> + </and> + </condition> + <fail if="jvm.loc.invalid"> + . + +ERROR: You explicitly specified the home of JVM${find-vm.version} as: ${jvm.loc} in the ${jvm.locations.file} file. +However, ${jvm.loc}/bin/${exe.java} does not exist or is not executable. Please fix the entry in jvm.locations, or delete it +and rerun the build; this build is capable of finding VMs automatically on many platforms. + </fail> + </target> + + <target name="-find.vm.java_home" if="exe.java_home" unless="jvm.loc"> + <fail unless="find-vm.version">Set property find-vm.version first</fail> + <local name="java_home.answer" /> + <local name="java_home.result" /> + <exec executable="${exe.java_home}" errorproperty="discard" outputproperty="java_home.answer" failifexecutionfails="false" resultproperty="java_home.result"> + <arg value="-v" /> + <arg value="${find-vm.version}" /> + </exec> + <condition property="jvm.loc" value="${java_home.answer}"> + <equals arg1="0" arg2="${java_home.result}" /> + </condition> + </target> + + <target name="-find.vm.reg" if="exe.reg" unless="jvm.loc"> + <fail unless="find-vm.version">Set property find-vm.version first</fail> + + <macrodef name="findkey"> + <attribute name="idx" /> + <attribute name="key" /> + <attribute name="regex" /> + <attribute name="value" /> + <sequential> + <local name="reg.answer1.@{idx}" /> + <local name="reg.result1.@{idx}" /> + <local name="reg.first.@{idx}" /> + <local name="reg.answer2.@{idx}" /> + <local name="reg.result2.@{idx}" /> + <exec executable="${exe.reg}" errorproperty="discard" outputproperty="reg.answer1.@{idx}" failifexecutionfails="false" resultproperty="reg.result1.@{idx}"> + <arg value="query" /> + <arg value="@{key}" /> + <arg value="/f" /> + <arg value="${find-vm.version}"/> + <arg value="/k" /> + </exec> + + <loadresource property="reg.first.@{idx}"> + <propertyresource name="reg.answer1.@{idx}" /> + <filterchain> + <tokenfilter> + <containsregex flags="i" pattern="@{regex}" replace="\1" /> + <trim /> + <ignoreblank /> + </tokenfilter> + <headfilter lines="1" /> + <striplinebreaks /> + </filterchain> + </loadresource> + <exec executable="${exe.reg}" errorproperty="discard" outputproperty="reg.answer2.@{idx}" failifexecutionfails="false" resultproperty="reg.result2.@{idx}"> + <arg value="query" /> + <arg value="${reg.first.@{idx}}" /> + <arg value="/s" /> + <arg value="/f" /> + <arg value="@{value}" /> + <arg value="/v" /> + <arg value="@{value}" /> + </exec> + <loadresource property="jvm.loc"> + <propertyresource name="reg.answer2.@{idx}" /> + <filterchain> + <tokenfilter> + <trim /> + <containsregex flags="i" pattern="\s*@{value}\s*REG_SZ\s*(.*)$" replace="\1" /> + <ignoreblank /> + </tokenfilter> + <headfilter lines="1" /> + <striplinebreaks /> + </filterchain> + </loadresource> + </sequential> + </macrodef> + + <findkey idx="1" key="hklm\Software\AdoptOpenJDK\JDK" value="Path" + regex="\s*(HKEY.*\\AdoptOpenJDK\\JDK\\${find-vm.version}(?:\.\S*)?)\s*$" /> + <findkey idx="2" key="hklm\Software\JavaSoft\Java Development Kit" value="JavaHome" + regex="\s*(HKEY.*\\JavaSoft\\Java Development Kit\\${find-vm.version}(?:\.\S*)?)\s*$" /> + </target> + + <target name="-find.vm.ask" unless="jvm.loc"> + <fail unless="find-vm.version">Set property find-vm.version first</fail> + <echo>A JVM${find-vm.version} is required to run the request tests.</echo> + <echo>this script can automatically find VMs on mac and windows but did not find a suitable VM.</echo> + <input message="Enter the full path to JVM${find-vm.version}:" addproperty="jvm.loc" /> + <condition property="jvm.loc.aborted"> + <matches pattern="^\s*$" string="${jvm.loc}" /> + </condition> + <fail if="jvm.loc.aborted">aborted</fail> + <fail if="jvm.loc.invalid">. + +ERROR: That does not appear to be a valid location; ${jvm.loc}/bin/${exe.java} should exist. + <condition> + <not><available file="${jvm.loc}/bin/${exe.java}" type="file" /></not> + </condition> + </fail> + <exec executable="${jvm.loc}/bin/${exe.java}" errorproperty="jvm.versioncheck.answer" failifexecutionfails="false" resultproperty="jvm.versioncheck.result"> + <arg value="-version" /> + </exec> + <fail> + That does not appear to be a valid JVM${find-vm.version} - perhaps it isn't the right version? + <condition> + <not><and> + <equals arg1="${jvm.versioncheck.result}" arg2="0" /> + <contains string="${jvm.versioncheck.answer}" substring="version "${find-vm.version}" /> + </and></not> + </condition> + </fail> + <propertyfile file="${jvm.locations.file}" comment="Locations of various JVMs to be used to run lombok tests if targeting specific versions."> + <entry key="j${find-vm.version}" value="${jvm.loc}" /> + </propertyfile> + <echo>Your choice of VM has been written to ${jvm.locations.file} and will be remembered for future invocations.</echo> + </target> + + <target name="-find.vm.save" if="jvm.loc"> + <mkdir dir="build" /> + <echo file="build/vmloc.${find-vm.version}.tmp" message="${jvm.loc}" /> + </target> + + <target name="-find.vm" depends="-find.vm.property, -find.vm.java_home, -find.vm.reg, -find.vm.ask, -find.vm.save"> + <fail unless="jvm.loc">JVM ${find-vm.version} cannot be found</fail> + </target> + + <macrodef name="find-vm"> + <attribute name="version" /> + <sequential> + <delete quiet="true" file="build/vmloc.@{version}.tmp" /> + <antcall target="-find.vm"> + <param name="find-vm.version" value="@{version}" /> + <param name="jvm.loc.force" value="${jvm.locations.j@{version}}" /> + </antcall> + <loadfile property="jvm.loc.@{version}" failonerror="true" srcFile="build/vmloc.@{version}.tmp" /> + <delete quiet="true" file="build/vmloc.@{version}.tmp" /> + </sequential> + </macrodef> +</project> diff --git a/buildScripts/website.ant.xml b/buildScripts/website.ant.xml index b6212b37..15bca92d 100644 --- a/buildScripts/website.ant.xml +++ b/buildScripts/website.ant.xml @@ -1,5 +1,5 @@ <!-- - Copyright (C) 2010-2020 The Project Lombok Authors. + 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 @@ -25,118 +25,77 @@ This buildfile is part of projectlombok.org. It is responsible for building the such as applying the templates to produce the website, converting the changelog into HTML, and creating javadoc. </description> - <taskdef classpath="lib/ivyplusplus.jar" resource="com/zwitserloot/ivyplusplus/antlib.xml" uri="antlib:com.zwitserloot.ivyplusplus" /> - - <path id="build.path"> - <fileset dir="lib/build"> - <include name="**/*.jar" /> - </fileset> - </path> - + <property name="web.root" value="https://projectlombok.org/" /> <property name="SNIPPET_TAB_STOP" value="2" /> - <target name="-website-clean"> + <target name="-website.clean"> <delete dir="build/website" quiet="true" /> </target> - <target name="website-only" description="Prepares the website for distribution using the lombok version currently 'live'." depends="-fetch-version-from-site, -show-version, -ensure-version, -website-main, -delete-edge-page" /> - - <target name="-delete-edge-page"> - <delete file="build/website/download-edge.html" /> - </target> - - <target name="website" description="Prepares the website for distribution" depends="javadoc, -website-main" /> - - <target name="website-supporters" description="Updates website supporters store and adds it to the website build."> - <ant antfile="buildScripts/supporters.ant.xml" target="deployToWebsiteBuild" inheritAll="false" /> - </target> - - <target name="-fetch-version-from-site" depends="-compile-webclasses"> - <fail if="lombok.version">lombok.version already set.</fail> - <fail if="lombok.fullversion">lombok.fullversion already set.</fail> - <java classname="lombok.website.FetchCurrentVersion" outputproperty="lombok.version" failonerror="true"> + <!-- Fetches the current (latest) lombok available from projectlombok.org, tracking this 'latest available version' in ant properties --> + <target name="-website.fetch-version" depends="compile.support"> + <java classname="lombok.website.FetchCurrentVersion" outputproperty="lombok.version.live" failonerror="true"> <classpath> - <path refid="build.path" /> - <pathelement location="build/webclasses" /> + <path refid="cp.buildtools" /> + <pathelement location="build/support" /> </classpath> + <arg value="${web.root}" /> <arg value="base" /> </java> - <java classname="lombok.website.FetchCurrentVersion" outputproperty="lombok.fullversion" failonerror="true"> + <java classname="lombok.website.FetchCurrentVersion" outputproperty="lombok.fullversion.live" failonerror="true"> <classpath> - <path refid="build.path" /> - <pathelement location="build/webclasses" /> + <path refid="cp.buildtools" /> + <pathelement location="build/support" /> </classpath> + <arg value="${web.root}" /> <arg value="full" /> </java> </target> - <target name="-ensure-version" unless="lombok.version"> - <fail>Supply lombok.version</fail> - </target> - - <target name="-show-version"> - <echo>Version: ${lombok.version}</echo> - <echo>Full: ${lombok.fullversion}</echo> - </target> - - <target name="-ensure-fullversion" unless="lombok.fullversion"> - <fail>Supply lombok.fullversion</fail> - </target> - - <target name="-compile-webclasses"> - <mkdir dir="build/webclasses" /> - <javac includeDestClasses="false" includeantruntime="false" destdir="build/webclasses" debug="on" source="1.8" target="1.8"> - <compilerarg value="-proc:none" /> - <compilerarg value="-Xlint:-options" /> - <classpath refid="build.path" /> - <src path="src/website" /> - </javac> + <target name="website.print-live-version" depends="-website.fetch-version" description="Print the current version of lombok available from projectlombok.org"> + <echo>Live version: ${lombok.version.live}</echo> + <echo>Live full versionstring : ${lombok.fullversion.live}</echo> </target> - <target name="changelogToHtml" depends="-compile-webclasses"> + <target name="changelog.build" depends="version, deps, compile.support" description="Turns the current changelog (doc/changelog.txt) into HTML"> <mkdir dir="build/website" /> <java classname="lombok.website.WebsiteMaker" failonerror="true"> <classpath> - <path refid="build.path" /> - <pathelement location="build/webclasses" /> - </classpath> + <path refid="cp.buildtools" /> + <pathelement location="build/support" /> + </classpath> + <arg value="${web.root}" /> <arg value="${lombok.version}" /> <arg value="${lombok.fullversion}" /> <arg value="changelog" /> </java> </target> - <target name="-website-main" depends="-ensure-version, -ensure-fullversion, -website-clean, -compile-webclasses, changelogToHtml"> - <mkdir dir="build/website" /> - <copy todir="build/website"> - <fileset dir="website/resources" /> - <fileset dir="."> - <include name="LICENSE" /> - </fileset> - </copy> - - <get src="https://code.jquery.com/jquery-3.3.1.min.js" dest="build/website/js/jquery.min.js" /> + <target name="-website.clientdeps"> + <mkdir dir="build/website/js" /> + <get src="https://code.jquery.com/jquery-3.3.1.min.js" dest="build/website/js/jquery.min.js" usetimestamp="true" /> <fail message="jQuery checksum failed"> <condition><not> <checksum file="build/website/js/jquery.min.js" algorithm="SHA-384" property="b6c405aa91117aeed92e1055d9566502eef370e57ead76d8945d9ca81f2dc48ffc6996a38e9e01a9df95e83e4882f293" verifyproperty="jquery.ok" /> </not></condition> </fail> - <get src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js" dest="build/website/js/modernizr.min.js" /> + <get src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js" dest="build/website/js/modernizr.min.js" usetimestamp="true" /> <fail message="modernizr checksum failed"> <condition><not> <checksum file="build/website/js/modernizr.min.js" algorithm="SHA-384" property="6cf577980d9ea3779da2ae7a57370f0661b537541551f8d833154824f3f3c85272159f0615f37b369b74e99af6deab6c" verifyproperty="modernizr.ok" /> </not></condition> </fail> - <get src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/js/bootstrap.min.js" dest="build/website/js/bootstrap.min.js" /> + <get src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/js/bootstrap.min.js" dest="build/website/js/bootstrap.min.js" usetimestamp="true" /> <fail message="bootstrap checksum failed"> <condition><not> <checksum file="build/website/js/bootstrap.min.js" algorithm="SHA-384" property="0a17eaab1b995029c948adfe31798f348c84e996d687620ca84db8d6b622a89c7232267a396fc9999439b2dc0450b4f2" verifyproperty="bootstrap.ok" /> </not></condition> </fail> - - <get src="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" dest="build/website/css/font-awesome.min.css" /> + + <mkdir dir="build/website/css" /> + <get src="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" dest="build/website/css/font-awesome.min.css" usetimestamp="true" /> <fail message="font-awesome checksum failed"> <condition><not> <checksum file="build/website/css/font-awesome.min.css" algorithm="SHA-384" property="c2f7d7a6aa596554062ba4c08793d594639f40d1d2a03db16c4f9090fc4200594d11ebe8107dd2974b226d570e4159cd" verifyproperty="fontawesome.ok" /> @@ -144,71 +103,175 @@ such as applying the templates to produce the website, converting the changelog </fail> <mkdir dir="build/website/fonts" /> - <get src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.woff" dest="build/website/fonts/fontawesome-webfont.woff" /> + <get src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.woff" dest="build/website/fonts/fontawesome-webfont.woff" usetimestamp="true" /> <fail message="woff checksum failed"> <condition><not> <checksum file="build/website/fonts/fontawesome-webfont.woff" algorithm="SHA-384" property="9a2008ccbb9e142d9ad62db6439db4a0543073f376c2d6987bddd0cab298963e5fd13d3e0e4404a4cb3b4be32f9135bf" verifyproperty="woff.ok" /> </not></condition> </fail> - <get src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.woff2" dest="build/website/fonts/fontawesome-webfont.woff2" /> + <get src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.woff2" dest="build/website/fonts/fontawesome-webfont.woff2" usetimestamp="true" /> <fail message="woff2 checksum failed"> <condition><not> <checksum file="build/website/fonts/fontawesome-webfont.woff2" algorithm="SHA-384" property="c267dab02b05137a7d06041209c8a227447a1af392b0a29924c5c1bd3882b966b7ca96b9c971958d2773b94fce37a3fa" verifyproperty="woff2.ok" /> </not></condition> </fail> - + </target> + + <macrodef name="website.make"> + <attribute name="version" /> + <attribute name="fullversion" /> + <attribute name="cmd" /> + <sequential> + <mkdir dir="build/website" /> + <copy todir="build/website"> + <fileset dir="website/resources" /> + <fileset dir="." includes="LICENSE" /> + </copy> + + <java classname="lombok.website.WebsiteMaker" failonerror="true"> + <classpath> + <path refid="cp.buildtools" /> + <pathelement location="build/support" /> + </classpath> + <arg value="${web.root}" /> + <arg value="@{version}" /> + <arg value="@{fullversion}" /> + <arg value="@{cmd}" /> + </java> + </sequential> + </macrodef> + + <target name="website.release-build" depends="version, -website.clean, compile.support, -website.clientdeps"> + <website.make version="${lombok.version}" fullversion="${lombok.fullversion}" cmd="all-newrelease" /> + </target> + + <target name="website.build" depends="-website.fetch-version, -website.clean, compile.support, -website.clientdeps" description="Builds the website based on current live version"> + <website.make version="${lombok.version.live}" fullversion="${lombok.fullversion.live}" cmd="all" /> + </target> + + <target name="website.print-all-versions" depends="compile.support"> <java classname="lombok.website.WebsiteMaker" failonerror="true"> <classpath> - <path refid="build.path" /> - <pathelement location="build/webclasses" /> + <path refid="cp.buildtools" /> + <pathelement location="build/support" /> </classpath> - <arg value="${lombok.version}" /> - <arg value="${lombok.fullversion}" /> - <arg value="all" /> + <arg value="${web.root}" /> + <arg value="1" /> + <arg value="1" /> + <arg value="print-allversions" /> </java> </target> - <target name="-website-dist"> + <target name="website.pack" depends="website.build"> <mkdir dir="dist" /> <tar destfile="dist/website.tar.bz2" compression="bzip2"> - <tarfileset dir="build/website" /> - <tarfileset dir="doc/api" prefix="api" /> + <tarfileset dir="build/website" excludes="download-edge.html" /> </tar> </target> - <target name="-website-only-dist"> + <target name="website.publish" depends="setup.ssh, website.pack" description="Builds the website, compresses it, sends it to the projectlombok.org server and deploys it"> + <ivy:scpUpload + from="dist/website.tar.bz2" + to="/data/lombok/staging" + server="projectlombok.org" + username="${ssh.username}" + keyfile="${ssh.keyfile}" + knownHosts="ssh.knownHosts" /> + <ivy:sshExec + cmd="/data/lombok/stagingCmd/deployWebsite" + server="projectlombok.org" + username="${ssh.username}" + keyfile="${ssh.keyfile}" + knownHosts="ssh.knownHosts" /> + </target> + + <target name="javadoc.build" description="Generates the javadoc" depends="version, compile" unless="skip.javadoc"> + <delete dir="build/api" quiet="true" /> + <delete dir="doc/api" quiet="true" /> + <mkdir dir="build/api" /> + <property name="javadoc.overview.html" location="build/javadoc.overview.html" /> + <echo file="${javadoc.overview.html}"><![CDATA[<html><body> + Welcome to the lombok javadoc. If you're just looking to learn more about using lombok + You probably want to look at <a href="https://projectlombok.org/features/all">the feature documentation</a>. Otherwise, + check the <a href="lombok/package-summary.html">lombok</a> package. If you're trying to extend lombok or + write your own plugins, the other packages are what you're looking for.</body></html> + ]]></echo> + <tstamp> + <format property="javadoc.year" pattern="yyyy" /> + </tstamp> + <javadoc sourcepath="src/core" defaultexcludes="yes" destdir="build/api" windowtitle="Lombok" source="1.8" Overview="${javadoc.overview.html}"> + <package name="lombok" /> + <package name="lombok.experimental" /> + <package name="lombok.extern.*" /> + <classpath location="build/lombok" /> + <header><![CDATA[<a href='https://projectlombok.org/' target='_blank'>Lombok</a> - ]]>v${lombok.version}</header> + <bottom><![CDATA[<i>Copyright © 2009-${javadoc.year} The Project Lombok Authors, licensed under the <a href='http://www.opensource.org/licenses/mit-license.php' target='_blank'>MIT licence</a>.]]></bottom> + </javadoc> + <!-- bugfix for boneheaded javadoc bug where ?is-external=true is inserted before an anchor ref, breaking the anchor ref. + is-external=true doesn't actually do anything except mess with titles, so, we'll just get rid of it. --> + <replaceregexp match="\?is-external=true#" replace="#" flags="gi"> + <fileset dir="build/api" includes="**/*.html" /> + </replaceregexp> + <mkdir dir="doc/api" /> + <copy todir="doc/api"> + <fileset dir="build/api" includes="**/*.html" /> + <filterchain> + <linecontainsregexp negate="true"> + <regexp pattern="(Generated by javadoc)|(.META NAME=.date.)|(meta name=.dc.created.)" /> + </linecontainsregexp> + </filterchain> + </copy> + <copy todir="doc/api"> + <fileset dir="build/api" includes="**/*.css" /> + <filterchain> + <linecontainsregexp negate="true"> + <regexp pattern="@import.*dejavu.css.*" /> + </linecontainsregexp> + </filterchain> + </copy> + <copy todir="doc/api"> + <fileset dir="build/api"> + <exclude name="**/*.html" /> + <exclude name="**/*.css" /> + </fileset> + </copy> + <echo append="true" file="doc/api/module-search-index.js"></echo> + <echo append="true" file="doc/api/tag-search-index.js"></echo> + </target> + + <target name="javadoc.pack" depends="javadoc.build"> <mkdir dir="dist" /> - <tar destfile="dist/website.tar.bz2" compression="bzip2"> - <tarfileset dir="build/website" /> + <tar destfile="dist/javadoc.tar.bz2" compression="bzip2"> + <tarfileset dir="build/api" /> </tar> + <echo>File dist/javadoc.tar.bz2 is available</echo> </target> - <target name="website-publish" depends="website, website-supporters, -website-dist, -send-site-to-remote" /> - <target name="website-only-publish" depends="website-only, website-supporters, -website-only-dist, -send-site-to-remote" /> - <target name="-send-site-to-remote" depends="-requires-ssh"> + <target name="javadoc.publish" depends="setup.ssh, javadoc.pack"> <ivy:scpUpload - from="dist/website.tar.bz2" + from="dist/javadoc.tar.bz2" to="/data/lombok/staging" server="projectlombok.org" username="${ssh.username}" keyfile="${ssh.keyfile}" knownHosts="ssh.knownHosts" /> <ivy:sshExec - cmd="/data/lombok/stagingCmd/deployWebsite" + cmd="/data/lombok/stagingCmd/deployJavadoc" server="projectlombok.org" username="${ssh.username}" keyfile="${ssh.keyfile}" knownHosts="ssh.knownHosts" /> </target> - <target name="latestChanges" depends="-compile-webclasses, -ensure-version, -ensure-fullversion"> + <target name="latest-changes.build" depends="compile.support, version" description="Creates the latest changes HTML file from the markdown in doc/changelog"> <mkdir dir="build/website" /> <java classname="lombok.website.WebsiteMaker" failonerror="true"> <classpath> - <path refid="build.path" /> - <pathelement location="build/webclasses" /> + <path refid="cp.buildtools" /> + <pathelement location="build/support" /> </classpath> + <arg value="${web.root}" /> <arg value="${lombok.version}" /> <arg value="${lombok.fullversion}" /> <arg value="changelog-latest" /> @@ -217,13 +280,42 @@ such as applying the templates to produce the website, converting the changelog </java> </target> - <target name="edgeRelease-build" depends="-compile-webclasses, -ensure-version, -ensure-fullversion"> + <target name="release.pack" depends="dist, website.release-build"> + <tar destfile="dist/website-release.tar.bz2" compression="bzip2"> + <tarfileset dir="dist" includes="lombok-${lombok.version}.jar" prefix="downloads/" /> + <tarfileset dir="dist" includes="lombok-${lombok.version}.jar" fullpath="downloads/lombok.jar" /> + <tarfileset dir="dist" includes="lombok-${lombok.version}.jar" fullpath="lombok-edge.jar" /> + <tarfileset dir="build/website" includes="all-versions.html,download.html,download-edge.html" /> + </tar> + </target> + + <target name="-release.publish.site" depends="setup.ssh, release.pack"> + <ivy:scpUpload + from="dist/website-release.tar.bz2" + to="/data/lombok/staging" + server="projectlombok.org" + username="${ssh.username}" + keyfile="${ssh.keyfile}" + knownHosts="ssh.knownHosts" /> + <ivy:sshExec + cmd="/data/lombok/stagingCmd/deployRelease" + server="projectlombok.org" + username="${ssh.username}" + keyfile="${ssh.keyfile}" + knownHosts="ssh.knownHosts" /> + </target> + + <target name="release.publish" depends="maven, -release.publish.site, website, eclipsep2.publish, maven.publish" /> + + <target name="edge.pack" depends="compile.support, version, dist, maven.edge"> + <delete file="build/website/download-edge.html" /> <mkdir dir="build/website-edge" /> <java classname="lombok.website.WebsiteMaker" failonerror="true"> <classpath> - <path refid="build.path" /> - <pathelement location="build/webclasses" /> + <path refid="cp.buildtools" /> + <pathelement location="build/support" /> </classpath> + <arg value="${web.root}" /> <arg value="${lombok.version}" /> <arg value="${lombok.fullversion}" /> <arg value="download-edge" /> @@ -239,27 +331,7 @@ such as applying the templates to produce the website, converting the changelog </tar> </target> - <target name="-requires-ssh" unless="ssh.username"> - <fail>ssh.username and ssh.keyfile should be set.</fail> - </target> - - <target name="deploy-p2" depends="-requires-ssh"> - <ivy:scpUpload - from="dist/eclipse-p2.tar.bz2" - to="/data/lombok/staging" - server="projectlombok.org" - username="${ssh.username}" - keyfile="${ssh.keyfile}" - knownHosts="ssh.knownHosts" /> - <ivy:sshExec - cmd="/data/lombok/stagingCmd/deployP2" - server="projectlombok.org" - username="${ssh.username}" - keyfile="${ssh.keyfile}" - knownHosts="ssh.knownHosts" /> - </target> - - <target name="edgeRelease" depends="-requires-ssh, edgeRelease-build"> + <target name="edge.publish" depends="setup.ssh, edge.pack" description="Builds an edge release, sends it to the projectlombok.org server and deploys it by updating the download-edge link"> <ivy:scpUpload from="dist/website-edge.tar.bz2" to="/data/lombok/staging" @@ -273,6 +345,7 @@ such as applying the templates to produce the website, converting the changelog username="${ssh.username}" keyfile="${ssh.keyfile}" knownHosts="ssh.knownHosts" /> + <exec executable="/usr/bin/git" failonerror="true"> <arg value="merge-base" /> <arg value="--is-ancestor" /> @@ -291,59 +364,4 @@ such as applying the templates to produce the website, converting the changelog <arg value="edge:refs/heads/edge" /> </exec> </target> - - <target name="javadoc" description="Generates the javadoc" depends="-ensure-version, -ensure-fullversion" unless="skip.javadoc"> - <delete dir="build/api" quiet="true" /> - <delete dir="doc/api" quiet="true" /> - <mkdir dir="build/api" /> - <property name="javadoc.overview.html" location="build/javadoc.overview.html" /> - <echo file="${javadoc.overview.html}"><![CDATA[<html><body> - Welcome to the lombok javadoc. If you're just looking to learn more about using lombok - You probably want to look at <a href="https://projectlombok.org/features/all">the feature documentation</a>. Otherwise, - check the <a href="lombok/package-summary.html">lombok</a> package. If you're trying to extend lombok or - write your own plugins, the other packages are what you're looking for.</body></html> - ]]></echo> - <tstamp> - <format property="javadoc.year" pattern="yyyy"/> - </tstamp> - <javadoc sourcepath="src/core" defaultexcludes="yes" destdir="build/api" windowtitle="Lombok" source="1.8" Overview="${javadoc.overview.html}"> - <package name="lombok" /> - <package name="lombok.experimental" /> - <package name="lombok.extern.*" /> - <classpath refid="build.path" /> - <classpath location="build/lombok" /> - <header><![CDATA[<a href='https://projectlombok.org/' target='_blank'>Lombok</a> - ]]>v${lombok.version}</header> - <bottom><![CDATA[<i>Copyright © 2009-${javadoc.year} The Project Lombok Authors, licensed under the <a href='http://www.opensource.org/licenses/mit-license.php' target='_blank'>MIT licence</a>.]]></bottom> - </javadoc> - <!-- bugfix for boneheaded javadoc bug where ?is-external=true is inserted before an anchor ref, breaking the anchor ref. - is-external=true doesn't actually do anything except mess with titles, so, we'll just get rid of it. --> - <replaceregexp match="\?is-external=true#" replace="#" flags="gi"> - <fileset dir="build/api" includes="**/*.html" /> - </replaceregexp> - <mkdir dir="doc/api" /> - <copy todir="doc/api"> - <fileset dir="build/api" includes="**/*.html" /> - <filterchain> - <linecontainsregexp negate="true"> - <regexp pattern="(Generated by javadoc)|(.META NAME=.date.)|(meta name=.dc.created.)" /> - </linecontainsregexp> - </filterchain> - </copy> - <copy todir="doc/api"> - <fileset dir="build/api" includes="**/*.css" /> - <filterchain> - <linecontainsregexp negate="true"> - <regexp pattern="@import.*dejavu.css.*" /> - </linecontainsregexp> - </filterchain> - </copy> - <copy todir="doc/api"> - <fileset dir="build/api"> - <exclude name="**/*.html" /> - <exclude name="**/*.css" /> - </fileset> - </copy> - <echo append="true" file="doc/api/module-search-index.js"></echo> - <echo append="true" file="doc/api/tag-search-index.js"></echo> - </target> </project> |