diff options
69 files changed, 2795 insertions, 1994 deletions
@@ -19,1155 +19,22 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --> -<project name="lombok" default="dist" xmlns:ivy="antlib:com.zwitserloot.ivyplusplus"> +<project name="lombok" default="quickstart" xmlns:ivy="antlib:com.zwitserloot.ivyplusplus"> <description> This buildfile is part of projectlombok.org. It is the main entry point that contains the common tasks and can be called on to run the main aspects of all the sub-scripts. </description> - <property name="pattern.jdk9Plus" value="^(9|[1-9][0-9])(\..*)?$" /> - <property name="pattern.jdkUpto8" value="^(1\.)?[2-8](\..*)?$" /> - <property name="build.compiler" value="javac1.6" /> - <property name="mapstruct-binding.version" value="0.1.0" /> - <property name="ivy.retrieve.pattern" value="lib/[conf]/[organisation]-[artifact].[ext]" /> - <available file="lib/ivyplusplus.jar" property="ivyplusplus.available" /> - <property name="rt-openjdk6" location="lib/openJDK6Environment/openjdk6_rt.jar" /> - <property name="rt-openjdk8" location="lib/openJDK8Environment/openjdk8_rt.jar" /> - <available file="${rt-openjdk6}" property="rt-openjdk6.available" /> - <available file="${rt-openjdk8}" property="rt-openjdk8.available" /> - - <path id="build.path"> - <fileset dir="lib/build"> - <include name="*.jar" /> - </fileset> - </path> - - <path id="runtime.path"> - <fileset dir="lib/runtime"> - <include name="*.jar" /> - </fileset> - </path> - - <path id="test.path"> - <fileset dir="lib/test"> - <include name="*.jar" /> - </fileset> - </path> - - <path id="eclipseBuild.path"> - <fileset dir="lib/eclipseBuild"> - <include name="*.jar" /> - </fileset> - </path> - - <target name="clean" description="Removes all generated files."> - <delete dir="build" quiet="true" /> - </target> - - <target name="distclean" 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="download-ipp" unless="ivyplusplus.available"> - <mkdir dir="lib" /> - <get src="https://projectlombok.org/downloads/ivyplusplus.jar" dest="lib/ivyplusplus.jar" usetimestamp="true" /> - </target> - - <target name="load-ipp" depends="download-ipp"> - <taskdef classpath="lib/ivyplusplus.jar" resource="com/zwitserloot/ivyplusplus/antlib.xml" uri="antlib:com.zwitserloot.ivyplusplus" /> - <ivy:ensureippversion version="1.34" property="ivyplusplus.minimumAvailable" /> - </target> - - <target name="redownload-ipp" unless="ivyplusplus.minimumAvailable"> - <get src="https://projectlombok.org/downloads/ivyplusplus.jar" dest="lib/ivyplusplus.jar" /> - <fail>A new version of ivyplusplus was required and has been downloaded. Rerun the script to continue.</fail> - </target> - - <target name="ensure-ipp" depends="load-ipp, redownload-ipp" /> - - <target name="config-ivy" depends="ensure-ipp" unless="ivy.config"> - <ivy:configure file="buildScripts/ivysettings.xml" /> - <property name="ivy.config" value="true" /> - </target> - - <target name="deps" depends="ensureBuildDeps, ensureRuntimeDeps, ensureTestDeps, contrib" description="Downloads all dependencies." /> - - <target name="contrib" depends="config-ivy" description="Downloads various non-crucial documentation, sources, etc that are useful when developing lombok.ast."> - <ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="contrib, ecj7, ecj8, ecj9" /> - <ivy:retrieve /> - </target> - - <target name="ensureOpenJdk6Rt" unless="rt-openjdk6.available"> - <mkdir dir="lib/openJDK6Environment" /> - <get src="https://projectlombok.org/ivyrepo/langtools/rt-openjdk6.jar" dest="${rt-openjdk6}" verbose="true" usetimestamp="true" /> - </target> - - <target name="ensureOpenJdk8Rt" unless="rt-openjdk8.available"> - <mkdir dir="lib/openJDK8Environment" /> - <get src="https://projectlombok.org/ivyrepo/langtools/rt-openjdk8.jar" dest="${rt-openjdk8}" verbose="true" usetimestamp="true" /> - </target> - - <target name="ensureBuildDeps" depends="config-ivy,ensureOpenJdk6Rt"> - <ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="build, javac7, moduleBuild" /> - <ivy:retrieve /> - </target> - - <target name="ensureRuntimeDeps" depends="config-ivy"> - <ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="runtime" /> - <ivy:retrieve /> - </target> - - <target name="ensureTestDeps" depends="config-ivy"> - <ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="test, javac6, eclipseBuild" /> - <ivy:retrieve /> - </target> - - <target name="ensureSupportersDeps" depends="config-ivy"> - <ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="supporters" /> - <ivy:retrieve /> - </target> - - <target name="version" depends="ensure-ipp, ensureOpenJdk8Rt" 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="${rt-openjdk8}" /> - <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="-unpackLibs" depends="ensureRuntimeDeps"> - <ivy:cachedunjar dest="build/lombok" marker="build/unpackDeps.marker"> - <path refid="runtime.path" /> - </ivy:cachedunjar> - </target> - - <target name="-ensureJdk9"> - <condition property="java.version.insufficient"> - <matches string="${ant.java.version}" pattern="${pattern.jdkUpto8}" /> - </condition> - <fail if="java.version.insufficient">To compile lombok, you need JDK9 or higher; lombok requires this version because it's rather difficult to produce lombok builds that are compatible on JDK9 without at least building with JDK9. Sorry about that.</fail> - </target> - - <target name="compile" depends="version, ensureBuildDeps, -unpackLibs, -ensureJdk9" description="Compiles the code."> - <fail> -For compiling with Java9 'modulepath' an Ant version 1.9.7+ or 1.10.0+ is required. -Your current version is: - ${ant.version} - <condition> - <not><antversion atleast="1.9.8"/></not> - </condition> - </fail> - - <!-- 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, which means if there are bugs in it, you can't compile - anymore until you 'ant clean'. That's very much not desired, 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" /> - <ivy:compile destdir="build/stubsstubs" source="1.5" target="1.5" ecj="true" nowarn="true"> - <bootclasspath path="${rt-openjdk8}" /> - <src path="src/stubsstubs" /> - <classpath location="build/stubsstubs" /> - </ivy:compile> - <ivy:compile destdir="build/stubs" source="1.5" target="1.5" ecj="true" nowarn="true"> - <bootclasspath path="${rt-openjdk8}" /> - <src path="src/stubs" /> - <src path="src/javac-only-stubs" /> - <classpath location="build/stubsstubs" /> - <classpath location="build/stubs" /> - </ivy:compile> - - <ivy:compile destdir="build/lombok-utils" source="1.5" target="1.5" ecj="true" nowarn="true"> - <bootclasspath location="build/stubs" /> - <bootclasspath path="${rt-openjdk8}" /> - <src path="src/utils" /> - <exclude name="lombok/javac/**" /> - <classpath refid="build.path" /> - </ivy:compile> - - <ivy:compile destdir="build/lombok-utils" source="1.6" target="1.6" ecj="true" nowarn="true"> - <bootclasspath path="${rt-openjdk8}" /> - <bootclasspath location="build/stubs" /> - <src path="src/utils" /> - <include name="lombok/javac/**" /> - <classpath location="build/lombok-utils" /> - <classpath refid="build.path" /> - </ivy:compile> - - <copy todir="build/lombok"> - <fileset dir="build/lombok-utils" /> - </copy> - - <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" nowarn="true"> - <bootclasspath location="build/stubs" /> - <bootclasspath path="${rt-openjdk8}" /> - <src path="build/transformedSources" /> - </ivy:compile> - - <ivy:compile destdir="build/lombok/Class50" source="1.4" target="1.6" ecj="true" nowarn="true"> - <bootclasspath location="build/stubs" /> - <bootclasspath path="${rt-openjdk8}" /> - <src path="build/transformedSources" /> - </ivy:compile> - - <ivy:compile destdir="build/lombok" source="1.5" target="1.5" ecj="true" nowarn="true"> - <bootclasspath location="build/stubs" /> - <bootclasspath path="${rt-openjdk8}" /> - <src path="src/launch" /> - <src path="src/core" /> - <src path="src/installer" /> - <src path="src/eclipseAgent" /> - <exclude name="lombok/javac/**" /> - <exclude name="**/*Transplants.java" /> - <classpath location="build/lombok" /> - <classpath refid="build.path" /> - </ivy:compile> - - <javac includeAntRuntime="false" source="1.9" target="1.9" destdir="build/lombok" modulepath="lib/moduleBuild"> - <compilerarg value="-Xlint:none" /> - <!-- The above is because javac9 warns about 'service interface provided but not exported or used', probably because lombok uses SPI internally, and uses the 'old' classpath discovery system for it. We're fine with this, hence, ignore this warning. --> - <src path="src/core9" /> - </javac> - - <ivy:compile destdir="build/lombok/Class50" source="1.5" target="1.6" ecj="true" nowarn="true"> - <bootclasspath location="build/stubs" /> - <bootclasspath path="${rt-openjdk8}" /> - <src path="src/eclipseAgent" /> - <include name="lombok/launch/PatchFixesHider.java" /> - <classpath location="build/lombok" /> - <classpath refid="build.path" /> - </ivy:compile> - - <ivy:compile destdir="build/lombok" source="1.6" target="1.6" ecj="true" nowarn="true"> - <bootclasspath location="build/stubs" /> - <bootclasspath path="${rt-openjdk8}" /> - <src path="src/core" /> - <src path="src/delombok" /> - <include name="lombok/javac/**" /> - <include name="lombok/delombok/**" /> - <classpath location="build/lombok" /> - <classpath refid="build.path" /> - </ivy:compile> - <delete dir="build/lombok-proc-result" quiet="true" /> - <ivy:compile destdir="build/lombok-proc-result" source="9" target="9"> - <classpath location="build/stubs" /> - <compilerarg value="-proc:only" /> - <compilerarg value="-processor" /> - <compilerarg value="org.mangosdk.spi.processor.SpiProcessor" /> - <src path="src/launch" /> - <src path="src/core" /> - <src path="src/installer" /> - <src path="src/eclipseAgent" /> - <src path="src/delombok" /> - <classpath location="build/lombok" /> - <classpath refid="build.path" /> - </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> - - <target name="-latestChanges" depends="version"> - <ant antfile="buildScripts/website.ant.xml" target="latestChanges" inheritAll="false"> - <property name="lombok.version" value="${lombok.version}" /> - <property name="lombok.fullversion" value="${lombok.fullversion}" /> - </ant> - </target> - - <target name="dist" description="Builds THE lombok.jar file which contains everything." depends="version, compile, -latestChanges, -compileMapstruct"> - <mkdir dir="dist" /> - <copy file="doc/changelog.markdown" tofile="build/changelog.txt" /> - <tstamp> - <format property="releaseTimestamp" pattern="yyyy-MM-dd" /> - </tstamp> - <echo file="release-timestamp.txt">${releaseTimestamp}</echo> - <zip destfile="dist/lombok-${lombok.version}.jar"> - <fileset dir="build" includes="changelog.txt, latestchanges.html" /> - <fileset dir="." includes="README.md" /> - <fileset dir="." includes="LICENSE" /> - <fileset dir="." includes="AUTHORS" /> - <fileset dir="." includes="release-timestamp.txt" /> - <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> - <mappedresources> - <fileset dir="build/lombok"> - <exclude name="com/sun/tools/javac/**" /> - <exclude name="module-info.class" /> - <exclude name="lombok/*.class" /> - <exclude name="lombok/javac/apt/Processor.class" /> - <exclude name="lombok/experimental/**" /> - <exclude name="lombok/extern/**" /> - <exclude name="lombok/launch/**" /> - <exclude name="lombok/delombok/ant/Tasks*" /> - </fileset> - <firstmatchmapper> - <globmapper from="*.class" to="*.SCL.lombok" /> - <identitymapper /> - </firstmatchmapper> - </mappedresources> - </zip> - <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" /> - <copy file="dist/lombok-${lombok.version}.jar" tofile="dist/lombok.jar" /> - <property name="lombok.dist.built" value="true" /> - </target> - - <target name="-eclipse-p2-dist" unless="lombok.version"> - <antcall target="dist" /> - </target> - - <target name="eclipse-p2" depends="config-ssh, version, -eclipse-p2-dist" description="Builds an eclipse p2 update site which allows lombok to be installed as an eclipse plugin"> - <ant antfile="buildScripts/eclipse-p2.ant.xml" target="dist-eclipse-p2" inheritAll="false"> - <property name="lombok.version" value="${lombok.version}" /> - </ant> - <ant antfile="buildScripts/website.ant.xml" target="deploy-p2" inheritAll="false"> - <property name="ssh.username" value="${ssh.username}" /> - <property name="ssh.keyfile" value="${ssh.keyfile}" /> - </ant> - </target> - - <target name="dist-utils" description="Builds lombok-utils.jar, which is a library used by i.e. lombok.ast project." depends="version, compile"> - <mkdir dir="dist" /> - <jar destfile="dist/lombok-utils-${lombok.version}.jar"> - <fileset dir="build/lombok-utils" /> - <fileset dir="." includes="LICENSE" /> - <fileset dir="." includes="AUTHORS" /> - <manifest> - <attribute name="Lombok-Version" value="${lombok.version}" /> - </manifest> - </jar> - <copy file="dist/lombok-utils-${lombok.version}.jar" tofile="dist/lombok-utils.jar" /> - </target> - - <target name="intellij" depends="deps, contrib" 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. We have some ability on letting you work on lombok via intellij, but whether the generated project 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> - <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/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="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> - - <target name="-skipEclipseDeps"> - <property name="eclipse.build.configname" value="buildWithoutEclipse" /> - </target> - - <target name="-addEclipseDeps"> - <property name="eclipse.build.configname" value="build" /> - </target> - - <target name="eclipse" depends="-addEclipseDeps, deps, contrib" description="Creates eclipse project files and downloads all dependencies. Open this directory as project in eclipse after running this target. This will NOT let you start a debug session for eclipse; use target 'eclipseForDebugging' instead to do that."> - <ivy:eclipsegen source="1.6"> - <srcdir dir="src/core" /> - <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/website" /> - <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="${eclipse.build.configname}" sources="contrib" /> - <conf name="test" sources="contrib" /> - <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="ensureEcjDebugDeps" depends="config-ivy"> - <ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="buildWithoutEclipse" /> - <ivy:retrieve /> - </target> - - <target name="loadEclipseLocation"> - <loadfile property="eclipse.location" srcFile="eclipse.location" encoding="UTF-8" quiet="true" /> - </target> - - <target name="setupEclipseLocation" depends="loadEclipseLocation" unless="eclipse.location"> - <echo>To add your eclipse installation's own plugins as dependencies, the build script needs to know where your eclipse is installed. Please enter this now (it's saved for future executions of this task). For example: - - /Applications/eclipse - C:\Program Files\eclipse -</echo> - <input message="Path to eclipse: " addproperty="eclipse.location" /> - <available property="eclipse.found" file="${eclipse.location}/plugins" /> - <fail unless="eclipse.found">Eclipse can't be found in this location; I expect that directory to contain a subdirectory called 'plugins'.</fail> - <echo file="eclipse.location" message="${eclipse.location}" /> - </target> - - <target name="eclipseForDebugging" depends="-skipEclipseDeps, ensureEcjDebugDeps, eclipse, setupEclipseLocation" description="Creates eclipse project files and downloads all dependencies, but borrows all eclipse dependencies (and more) from your existing eclipse installation. This is very useful if you wish to start a debugging eclipse from inside eclipse, and then breakpoint eclipse code itself. Because the deps are inherited, line numbers will line up and such."> - <copy - file="buildScripts/eclipse-debug-target.template" - tofile="LombokizedEclipse.launch" - preservelastmodified="true" - overwrite="true"> - </copy> - - <!-- These are dependencies --> - <antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.core.runtime" /></antcall> - <antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.equinox.common" /></antcall> - <antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.osgi" /></antcall> - <antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.jdt.core" /></antcall> - <antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.jdt.ui" /></antcall> - <antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.jface.text" /></antcall> - <antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.core.resources" /></antcall> - <antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.core.jobs" /></antcall> - - <!-- These are merely useful --> - <antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.text" /></antcall> - <antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.ltk.core.refactoring" /></antcall> - </target> - - <target name="-augmentClasspath"> - <pathconvert property="augment.bin" setonempty="false" pathsep=" :: "> - <fileset dir="${eclipse.location}/plugins" includes="${pluginName}_*" /> - </pathconvert> - - <fail unless="augment.bin"> - You do not have the eclipse plugin '${pluginName}'. I expected it to be in your eclipse plugins directory (followed by an underscore and a version number). - </fail> - - <condition property="multiples"> - <contains string="${augment.bin}" substring=" :: " /> - </condition> - - <condition property="augment.jar" value="${augment.bin}"> - <not><isset property="multiples" /></not> - </condition> - - <input message="You have multiple versions of the same plugin. These are: ${augment.bin}. Please copy/paste the complete path to the one you want to use, press enter to abort:" addproperty="augment.jar" /> - - <condition property="emptyTarget"> - <equals arg1="${augment.jar}" arg2="" /> - </condition> - - <fail> - <condition> - <equals arg1="${augment.jar}" arg2="" /> - </condition> - </fail> - - <pathconvert property="augment.src"> - <map from="${eclipse.location}/plugins/${pluginName}_" to="${eclipse.location}/plugins/${pluginName}.source_" /> - <fileset file="${augment.jar}" /> - </pathconvert> - - <available property="sourceAddition" file="${augment.src}" value=" sourcepath="${augment.src}"" /> - <property name="sourceAddition" value="" /> - - <condition property="sourceWarning" value="WARNING: No source available for this plugin!"> - <equals arg1="${sourceAddition}" arg2="" /> - </condition> - <property name="sourceWarning" value="" /> - - <replaceregexp file=".classpath" flags="is" encoding="UTF-8"> - <regexp pattern="^(.*?)(.)(<classpathentry kind=.lib. path=)(.*)$" /> - <substitution expression="\1\2<classpathentry kind="lib" path="____AUGMENT_BIN____"____AUGMENT_SRC____/>\${line.separator}\2\3\4" /> - </replaceregexp> - <replace file=".classpath" token="____AUGMENT_BIN____" value="${augment.jar}" /> - <replace file=".classpath" token="____AUGMENT_SRC____" value="${sourceAddition}" /> - <echo>Added to project classpath from your eclipse installation: ${pluginName}. -${sourceWarning}</echo> - </target> - - <target name="-test-compile" depends="ensureTestDeps, compile" unless="skipTests"> - <mkdir dir="build/tests" /> - <ivy:compile destdir="build/tests" source="1.5" target="1.5" ecj="true" nowarn="true"> - <bootclasspath path="${rt-openjdk8}" /> - <classpath refid="test.path" /> - <classpath refid="build.path" /> - <classpath path="build/lombok" /> - <classpath path="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-ecj" depends="dist, contrib, setupJavaOracle8TestEnvironment" unless="tests.skip"> - <condition property="ecj.loc" value="lib/ecj9/org.eclipse.jdt-ecj.jar" else="lib/ecj8/org.eclipse.jdt.core.compiler-ecj.jar"> - <matches string="${ant.java.version}" pattern="${pattern.jdk9Plus}" /> - </condition> - <echo>Testing ECJ using ECJ: ${ecj.loc}</echo> - <java jar="${ecj.loc}" fork="true" failonerror="true"> - <jvmarg value="-javaagent:dist/lombok.jar=ecj" /> - <arg value="-source" /> - <arg value="1.6" /> - <arg value="-target" /> - <arg value="1.6" /> - <arg value="-cp" /> - <arg value="dist/lombok.jar" /> - <arg value="test/ecj/SimpleTest.java" /> - </java> - </target> - - <target name="-loadTestEnvironmentProperties"> - <property file="testenvironment.properties" /> - <available file=".project" property="isEclipseProject" /> - </target> - - <target name="-createEclipseLaunchForTestEnvironmentIfEclipseProject" depends="-loadTestEnvironmentProperties" if="isEclipseProject"> - <antcall target="createEclipseLaunchForTestEnvironment" /> - </target> - - <target name="createEclipseLaunchForTestEnvironment" depends="-loadTestEnvironmentProperties, -failIfNoTestEnvironmentProperties" description="Creates an eclipse launch target for the current test environment."> - <copy - file="buildScripts/eclipse-run-tests.template" - tofile="RunLombokTests ${test.location.name}.launch" - preservelastmodified="true" - overwrite="true"> - <filterset> - <filter token="JAVAC_LOCATION" value="${test.location.javac}" /> - <filter token="ECJ_LOCATION" value="${test.location.ecj}" /> - <filter token="RT_LOCATION" value="${test.location.bootclasspath}" /> - <filter token="JAVA_VERSION" value="${test.javaversion}" /> - <filter token="PATH_SEP" value="${path.separator}" /> - </filterset> - </copy> - <echo>WARNING: If you wish to test JDK8 features in eclipse, there must be a JDK8 installation configured in your eclipse, and it must be called 'JavaSE-1.8'.</echo> - </target> - - <target name="setupJavaOpenJDK6TestEnvironment" depends="ensureTestDeps, contrib" description="Sets up the test so that 'ant test' will test against OpenJDK6."> - <mkdir dir="lib/openJDK6Environment" /> - <get src="https://projectlombok.org/ivyrepo/langtools/javac-1.6.0.18.jar" dest="lib/openJDK6Environment/javac6.jar" verbose="true" usetimestamp="true" /> - <get src="https://projectlombok.org/ivyrepo/langtools/rt-openjdk6.jar" dest="${rt-openjdk6}" verbose="true" usetimestamp="true" /> - <propertyfile file="testenvironment.properties"> - <entry key="test.location.javac" value="lib/openJDK6Environment/javac6.jar" /> - <entry key="test.location.ecj" value="lib/ecj7/org.eclipse.custom-ecj.jar" /> - <entry key="test.location.bootclasspath" value="${rt-openjdk6}" /> - <entry key="test.location.name" value="OpenJDK6" /> - <entry key="test.javaversion" value="6" /> - </propertyfile> - <echo>Tests will now run against OpenJDK6</echo> - <antcall target="-createEclipseLaunchForTestEnvironmentIfEclipseProject" /> - </target> - - <target name="setupJavaOpenJDK7TestEnvironment" depends="ensureTestDeps, contrib" description="Sets up the test so that 'ant test' will test against OpenJDK7."> - <mkdir dir="lib/openJDK7Environment" /> - <get src="https://projectlombok.org/ivyrepo/langtools/javac-1.7.0.jar" dest="lib/openJDK7Environment/javac7.jar" verbose="true" usetimestamp="true" /> - <get src="https://projectlombok.org/ivyrepo/langtools/rt-openjdk7.jar" dest="lib/openJDK7Environment/rt-openjdk7.jar" verbose="true" usetimestamp="true" /> - <propertyfile file="testenvironment.properties"> - <entry key="test.location.javac" value="lib/openJDK7Environment/javac7.jar" /> - <entry key="test.location.ecj" value="lib/ecj7/org.eclipse.custom-ecj.jar" /> - <entry key="test.location.bootclasspath" value="lib/openJDK7Environment/rt-openjdk7.jar" /> - <entry key="test.location.name" value="OpenJDK7" /> - <entry key="test.javaversion" value="7" /> - </propertyfile> - <echo>Tests will now run against OpenJDK7</echo> - <antcall target="-createEclipseLaunchForTestEnvironmentIfEclipseProject" /> - </target> - - <target name="setupJavaOracle7TestEnvironment" depends="ensureTestDeps, contrib" description="Sets up the test so that 'ant test' will test against Oracle JDK7."> - <mkdir dir="lib/oracleJDK7Environment" /> - <get src="https://projectlombok.org/ivyrepo/langtools/oracle-jdk7-tools.jar" dest="lib/oracleJDK7Environment/tools.jar" verbose="true" usetimestamp="true" /> - <get src="https://projectlombok.org/ivyrepo/langtools/oracle-jdk7-rt.jar" dest="lib/oracleJDK7Environment/rt.jar" verbose="true" usetimestamp="true" /> - <propertyfile file="testenvironment.properties"> - <entry key="test.location.javac" value="lib/oracleJDK7Environment/tools.jar" /> - <entry key="test.location.ecj" value="lib/ecj7/org.eclipse.custom-ecj.jar" /> - <entry key="test.location.bootclasspath" value="lib/oracleJDK7Environment/rt.jar" /> - <entry key="test.location.name" value="OracleJDK7" /> - <entry key="test.javaversion" value="7" /> - </propertyfile> - <echo>Tests will now run against Oracle JDK7</echo> - <antcall target="-createEclipseLaunchForTestEnvironmentIfEclipseProject" /> - </target> - - <target name="setupJavaOracle8TestEnvironment" depends="ensureTestDeps, contrib" description="Sets up the test so that 'ant test' will test against Oracle JDK8."> - <mkdir dir="lib/oracleJDK8Environment" /> - <get src="https://projectlombok.org/ivyrepo/langtools/jdk8-javac.jar" dest="lib/oracleJDK8Environment/javac8.jar" verbose="true" usetimestamp="true" /> - <get src="https://projectlombok.org/ivyrepo/langtools/oracle-jdk8-rt.jar" dest="lib/oracleJDK8Environment/rt.jar" verbose="true" usetimestamp="true" /> - <get src="https://projectlombok.org/ivyrepo/langtools/jdk8-javac-sources.zip" dest="lib/oracleJDK8Environment/javac8-sources.zip" verbose="true" usetimestamp="true" /> - <propertyfile file="testenvironment.properties"> - <entry key="test.location.javac" value="lib/oracleJDK8Environment/javac8.jar" /> - <entry key="test.location.ecj" value="lib/ecj8/org.eclipse.jdt.core.compiler-ecj.jar" /> - <entry key="test.location.bootclasspath" value="lib/oracleJDK8Environment/rt.jar" /> - <entry key="test.location.name" value="OracleJDK8" /> - <entry key="test.javaversion" value="8" /> - </propertyfile> - <echo>Tests will now run against Oracle JDK8</echo> - <antcall target="-createEclipseLaunchForTestEnvironmentIfEclipseProject" /> - </target> - - <target name="-failIfNoTestEnvironmentProperties" unless="test.javaversion"> - <fail>ERROR: No test environment set up. - -You need to set up a test environment, which consists of a version of javac, and a JRE runtime classpath ('rt.jar'). -Eventually, this environment concept will be extended to also include an ecj and/or eclipse to test against. - -You can let this ant script set them up for you: - -* ant setupJavaOpenJDK6TestEnvironment -* ant setupJavaOpenJDK7TestEnvironment -* ant setupJavaOracle7TestEnvironment -* ant setupJavaOracle8TestEnvironment - -These will set up test environments based on OpenJDK6 and OpenJDK7, and download all required files automatically. This will be a relatively large download. You can switch by running this command again; the downloads are cached so switching is fast. - -You can also create your own by writing a 'testenvironment.properties' file. The relevant properties are: - -* test.location.javac = /path/to/javac6.jar -* test.location.ecj = /path/to/ecj6.jar -* test.location.bootclasspath = /path/to/rt.jar -* test.location.name = RandomUsefulNameToIdentifyThisSetup -* test.javaversion = 6 -</fail> - </target> - - <target name="test" depends="-loadTestEnvironmentProperties, -failIfNoTestEnvironmentProperties, -test-compile, dist, test-ecj, -test-check, -test8, -test9" description="Runs all tests." /> - - <target name="testfast" depends="-loadTestEnvironmentProperties, -failIfNoTestEnvironmentProperties, -test-compile, -test-check, -test8, -test9" /> - - <target name="-test-check"> - <condition property="test9.run"> - <and> - <not><isset property="tests.skip" /></not> - <matches string="${ant.java.version}" pattern="${pattern.jdk9Plus}" /> - </and> - </condition> - <condition property="test8.run"> - <and> - <not><isset property="tests.skip" /></not> - <matches string="${ant.java.version}" pattern="${pattern.jdkUpto8}" /> - </and> - </condition> - </target> - - <target name="-test9" if="test9.run"> - <echo>Running test suite in JDK9+ mode</echo> - <junit haltonfailure="no" fork="true"> - <jvmarg value="-javaagent:dist/lombok.jar" /> - <jvmarg value="-Ddelombok.bootclasspath=${test.location.bootclasspath}" /> - <jvmarg value="--add-opens" /> - <jvmarg value="jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED" /> - <jvmarg value="--add-opens" /> - <jvmarg value="jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED" /> - <jvmarg value="--add-opens" /> - <jvmarg value="jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED" /> - <jvmarg value="--add-opens" /> - <jvmarg value="jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED" /> - <jvmarg value="--add-opens" /> - <jvmarg value="jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED" /> - <jvmarg value="--add-opens" /> - <jvmarg value="jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED" /> - <jvmarg value="--add-opens" /> - <jvmarg value="jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED" /> - <jvmarg value="--add-opens" /> - <jvmarg value="jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED" /> - <formatter type="plain" usefile="false" unless="tests.quiet" /> - <classpath refid="test.path" /> - <classpath path="${test.location.ecj}" /> - <classpath path="${test.location.javac}" /> - <classpath path="build/lombok" /> - <classpath path="build/tests" /> - <classpath path="build/teststubs" /> - <batchtest> - <fileset dir="test/core/src"> - <include name="lombok/RunAllTests.java" /> - </fileset> - </batchtest> - </junit> - </target> - - <target name="-test8" if="test8.run"> - <echo>Running test suite in JDK6-8 mode</echo> - <junit haltonfailure="no" fork="true"> - <jvmarg value="-javaagent:dist/lombok.jar" /> - <jvmarg value="-Ddelombok.bootclasspath=${test.location.bootclasspath}" /> - <formatter type="plain" usefile="false" unless="tests.quiet" /> - <classpath refid="test.path" /> - <classpath path="${test.location.ecj}" /> - <classpath path="${test.location.javac}" /> - <classpath path="build/lombok" /> - <classpath path="build/tests" /> - <classpath path="build/teststubs" /> - <batchtest> - <fileset dir="test/core/src"> - <include name="lombok/RunAllTests.java" /> - </fileset> - </batchtest> - </junit> - </target> - - <target name="utils-javadoc" depends="compile"> - <tstamp> - <format property="javadoc.year" pattern="yyyy"/> - </tstamp> - <mkdir dir="build/utils-api" /> - <javadoc sourcepath="src/utils" defaultexcludes="yes" destdir="build/utils-api" windowtitle="Lombok Utils"> - <classpath refid="build.path" /> - <link href="http://download.oracle.com/javase/6/docs/api/" /> - <header><![CDATA[<a href='https://projectlombok.org/' target='_blank'>Lombok</a> - ]]>v${lombok.version}</header> - <bottom><![CDATA[<i>Copyright © 2011-${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, so, we'll just get rid of it. --> - <replaceregexp match="\?is-external=true#" replace="#" flags="gi"> - <fileset dir="build/utils-api" includes="**/*.html" /> - </replaceregexp> - </target> - - <target name="utils-maven" depends="version, dist-utils, utils-javadoc" description="Build a maven artifact bundle for lombok-utils."> - <jar destfile="dist/lombok-utils-${lombok.version}-javadoc.jar"> - <fileset dir="build/utils-api" /> - </jar> - <jar destfile="dist/lombok-utils-${lombok.version}-sources.jar"> - <fileset dir="src/utils" /> - </jar> - <mkdir dir="build/utils-mavenPublish" /> - <copy tofile="build/utils-mavenPublish/pom.xml" overwrite="true" file="doc/utils-maven-pom.xml"> - <filterchain> - <replacetokens> - <token key="VERSION" value="${lombok.version}" /> - </replacetokens> - </filterchain> - </copy> - <tar destfile="build/utils-mavenPublish/utils-mavenPublish.tar.bz2" compression="bzip2"> - <tarfileset dir="dist"> - <include name="lombok-utils-${lombok.version}.jar" /> - <include name="lombok-utils-${lombok.version}-sources.jar" /> - <include name="lombok-utils-${lombok.version}-javadoc.jar" /> - </tarfileset> - <tarfileset dir="build/utils-mavenPublish" includes="pom.xml" /> - </tar> - </target> - - <target name="javadoc" depends="compile, version" description="Builds javadoc into doc/api."> - <ant antfile="buildScripts/website.ant.xml" target="javadoc" inheritAll="false"> - <property name="lombok.version" value="${lombok.version}" /> - <property name="lombok.fullversion" value="${lombok.fullversion}" /> - </ant> - </target> - - <target name="-prepare-maven" depends="version, dist, javadoc"> - <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> - <mkdir dir="build/mavenPublish" /> - <!-- Could already be set for edge releases --> - <property name="lombok.version.mvn" value="${lombok.version}" /> - <copy tofile="build/mavenPublish/pom.xml" overwrite="true" file="doc/maven-pom.xml"> - <filterchain> - <replacetokens> - <token key="VERSION" value="${lombok.version.mvn}" /> - </replacetokens> - </filterchain> - </copy> - </target> - - <target name="maven" depends="-prepare-maven" description="Build a maven artifact bundle."> - <tar destfile="build/mavenPublish/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/mavenPublish" includes="pom.xml" /> - </tar> - </target> - - <target name="maven-publish" depends="config-ssh, maven, utils-maven" description="Build a maven artifact bundle then upload it to projectlombok.org and ask the server to upload it to maven central"> - <ivy:scpUpload - from="build/mavenPublish/mavenPublish.tar.bz2" - to="/data/lombok/staging" - server="projectlombok.org" - username="${ssh.username}" - keyfile="${ssh.keyfile}" - knownHosts="ssh.knownHosts" /> - <ivy:scpUpload - from="build/utils-mavenPublish/utils-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="publish" description="Publishes the latest build to googlecode." depends="config-ssh, version, dist, dist-utils"> - <ivy:scpUpload - from="dist/lombok-utils-${lombok.version}.jar" - to="/data/lombok/staging" - server="projectlombok.org" - username="${ssh.username}" - keyfile="${ssh.keyfile}" - knownHosts="ssh.knownHosts" /> - <ivy:sshExec - cmd="/data/lombok/stagingCmd/deployLombokUtils '${lombok.version}'" - server="projectlombok.org" - username="${ssh.username}" - keyfile="${ssh.keyfile}" - knownHosts="ssh.knownHosts" /> - <ivy:scpUpload - from="dist/lombok-${lombok.version}.jar" - to="/data/lombok/staging" - server="projectlombok.org" - username="${ssh.username}" - keyfile="${ssh.keyfile}" - knownHosts="ssh.knownHosts" /> - <ivy:sshExec - cmd="/data/lombok/stagingCmd/deployLombok '${lombok.version}'" - server="projectlombok.org" - username="${ssh.username}" - keyfile="${ssh.keyfile}" - knownHosts="ssh.knownHosts" /> - <echo>WARNING: You should now immediately run an edge release!</echo> - </target> - - <target name="publish-all" depends="clean, version, website-publish, maven-publish, publish" - description="Publishes lombok itself, updates the maven repository and the website." /> - - <target name="edge-release" depends="config-ssh, clean, version, dist, make-edge-as-maven_snapshot_repo" - description="Publishes an edge release for those who need to test a cutting edge build."> - <ant antfile="buildScripts/website.ant.xml" target="edgeRelease" inheritAll="false"> - <property name="lombok.version" value="${lombok.version}" /> - <property name="lombok.fullversion" value="${lombok.fullversion}" /> - <property name="ssh.username" value="${ssh.username}" /> - <property name="ssh.keyfile" value="${ssh.keyfile}" /> - </ant> - </target> - - <property file="ssh.configuration" /> - - <target name="config-ssh" unless="ssh.username"> - <input message="What is your SSH username on the projectlombok.org server? (Enter to abort)." addproperty="ssh.username" /> - <condition property="ssh.usernameBlank"><equals arg1="${ssh.username}" arg2="" trim="true" /></condition> - <fail if="ssh.usernameBlank">Aborted.</fail> - <input message="Where is your ssh keyfile located?" addproperty="ssh.keyfile" defaultvalue="${user.home}/.ssh/id_rsa" /> - <input message="SSH configuration saved as 'ssh.configuration'. Delete this file to reconfigure. Press enter to continue." /> - <propertyfile file="ssh.configuration"> - <entry key="ssh.username" value="${ssh.username}" /> - <entry key="ssh.keyfile" value="${ssh.keyfile}" /> - </propertyfile> - </target> - - <target name="website-only" description="Prepares the website for distribution using the lombok version currently 'live'."> - <ant antfile="buildScripts/website.ant.xml" target="website-only" inheritAll="false" /> - </target> - - <target name="website" depends="version, compile" description="Prepares the website for distribution."> - <ant antfile="buildScripts/website.ant.xml" target="website" inheritAll="false"> - <property name="lombok.version" value="${lombok.version}" /> - <property name="lombok.fullversion" value="${lombok.fullversion}" /> - </ant> - </target> - - <target name="website-supporters" depends="ensureSupportersDeps, website-only" description="Updates the supporters repo and adds it to the website build."> - <ant antfile="buildScripts/supporters.ant.xml" target="deployToWebsiteBuild" inheritAll="false" /> - </target> - - <target name="website-supporters-fast" depends="website-only" description="Updates the supporters repo and adds it to the website build."> - <ant antfile="buildScripts/supporters.ant.xml" target="deployToWebsiteBuild" inheritAll="false"> - <property name="noUpdateRepo" value="true" /> - </ant> - </target> - - <target name="website-only-publish" depends="config-ssh, clean, ensureSupportersDeps" - description="Prepares the website (using lombok version current 'live') for distribution and then publishes it to projectlombok.org."> - <ant antfile="buildScripts/website.ant.xml" target="website-only-publish" inheritAll="false"> - <property name="ssh.username" value="${ssh.username}" /> - <property name="ssh.keyfile" value="${ssh.keyfile}" /> - </ant> - </target> - - <target name="website-publish" depends="config-ssh, clean, version, ensureSupportersDeps, compile" - description="Prepares the website for distribution and then publishes it to projectlombok.org."> - <ant antfile="buildScripts/website.ant.xml" target="website-publish" inheritAll="false"> - <property name="lombok.version" value="${lombok.version}" /> - <property name="lombok.fullversion" value="${lombok.fullversion}" /> - <property name="ssh.username" value="${ssh.username}" /> - <property name="ssh.keyfile" value="${ssh.keyfile}" /> - </ant> - </target> - - <target name="-mvn-ext"> - <condition property="mvn-ext" value=".cmd" else=""> - <os family="windows" /> - </condition> - </target> - - <target name="-version-edge"> - <property name="lombok.version.mvn" value="edge-SNAPSHOT" /> - </target> - - <target name="make-edge-as-maven_snapshot_repo" depends="-version-edge,-mvn-ext,-prepare-maven" 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."> - <property environment="env" /> - <delete quiet="true" dir="build/edge-releases" /> - <mkdir dir="build/edge-releases" /> - <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-${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/mavenPublish/pom.xml" /> - <arg value="-Durl=file://${basedir}/build/edge-releases" /> - </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> - - <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> + <import file="buildScripts/info.ant.xml" /> + <import file="buildScripts/setup.ant.xml" /> + <import file="buildScripts/vm-finder.ant.xml" /> + <import file="buildScripts/build-support.ant.xml" /> + <import file="buildScripts/compile.ant.xml" /> + <import file="buildScripts/maven.ant.xml" /> + <import file="buildScripts/tests.ant.xml" /> + <import file="buildScripts/create-eclipse-project.ant.xml" /> + <import file="buildScripts/create-intellij-project.ant.xml" /> + <import file="buildScripts/website.ant.xml" /> + <import file="buildScripts/eclipse-p2.ant.xml" /> + <import file="buildScripts/mapstructBinding.ant.xml" /> </project> 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..386ed3de --- /dev/null +++ b/buildScripts/create-eclipse-project.ant.xml @@ -0,0 +1,181 @@ +<!-- + 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/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..865e8971 --- /dev/null +++ b/buildScripts/create-intellij-project.ant.xml @@ -0,0 +1,58 @@ +<!-- + 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/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/mapstructBinding.ant.xml b/buildScripts/mapstructBinding.ant.xml new file mode 100644 index 00000000..c59b84da --- /dev/null +++ b/buildScripts/mapstructBinding.ant.xml @@ -0,0 +1,125 @@ +<!-- + 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.mapstructBinding" xmlns:ivy="antlib:com.zwitserloot.ivyplusplus" basedir=".."> + <description> +This buildfile is part of projectlombok.org. It builds the mapstruct-lombok binding; we think the +version on mavencentral is the last version that is ever needed; the code itself is trivial and +exists as a separate dependency solely because it is itself dependent on both lombok and mapstruct. + </description> + + <target name="-mapstructBinding.compile"> + <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="-mapstructBinding.prepare" depends="-mapstructBinding.compile"> + <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="-mapstructBinding.doc" depends="-mapstructBinding.prepare"> + <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="-mapstructBinding.jar" depends="dist,-mapstructBinding.prepare"> + <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="-mapstructBinding.src" depends="-mapstructBinding.jar"> + <jar destfile="dist/lombok-mapstruct-binding-${mapstruct-binding.version}-sources.jar" basedir="src/bindings/mapstruct" includes="**" /> + </target> + + <target name="mapstructBinding.pack" depends="dist,-mapstructBinding.jar,-mapstructBinding.doc,-mapstructBinding.src"> + </target> + + <target name="mapstructBinding.maven" depends="mapstructBinding.pack" description="Create a maven repo for mapstruct binding into a build dir."> + <delete quiet="true" dir="build/mapstruct-binding-maven" /> + <mkdir dir="build/mapstruct-binding-maven" /> + <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> + + <local name="mvn.result" /> + <exec executable="${exe.mvn}" 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> + <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/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..9efb2668 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.publish, 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> diff --git a/src/core/lombok/Singular.java b/src/core/lombok/Singular.java index 2ceaad58..08b53973 100644 --- a/src/core/lombok/Singular.java +++ b/src/core/lombok/Singular.java @@ -36,6 +36,6 @@ public @interface Singular { /** @return The singular name of this field. If it's a normal english plural, lombok will figure it out automatically. Otherwise, this parameter is mandatory. */ String value() default ""; - /** @return If true, the plural variant (which takes a collection and adds each element inside) will treat {@code null} as an empty collection, i.e. do nothing. If {@code false) (the default), it is null checked as if annotated with {@code @lombok.NonNull}. */ + /** @return If true, the plural variant (which takes a collection and adds each element inside) will treat {@code null} as an empty collection, i.e. do nothing. If {@code false} (the default), it is null checked as if annotated with {@code @lombok.NonNull}. */ boolean ignoreNullCollections() default false; } diff --git a/src/core/lombok/core/handlers/HandlerUtil.java b/src/core/lombok/core/handlers/HandlerUtil.java index 46ce3825..1c4437d7 100644 --- a/src/core/lombok/core/handlers/HandlerUtil.java +++ b/src/core/lombok/core/handlers/HandlerUtil.java @@ -745,13 +745,6 @@ public class HandlerUtil { return b.toString(); } - /** Matches any of the 8 primitive names, such as {@code boolean}. */ - private static final Pattern PRIMITIVE_TYPE_NAME_PATTERN = Pattern.compile("^(?:boolean|byte|short|int|long|float|double|char)$"); - - public static boolean isPrimitive(String typeName) { - return PRIMITIVE_TYPE_NAME_PATTERN.matcher(typeName).matches(); - } - /** Matches any of the 8 primitive wrapper names, such as {@code Boolean}. */ private static final Pattern PRIMITIVE_WRAPPER_TYPE_NAME_PATTERN = Pattern.compile("^(?:java\\.lang\\.)?(?:Boolean|Byte|Short|Integer|Long|Float|Double|Character)$"); @@ -759,7 +752,7 @@ public class HandlerUtil { // Modification in this code should be documented // 1. In the changelog this should be marked as an INPROBABLE BREAKING CHANGE, since the hashcode will change // 2. In the javadoc of EqualsAndHashcode.Include#rank - if (isPrimitive(typeName)) return 1000; + if (JavaIdentifiers.isPrimitive(typeName)) return 1000; if (PRIMITIVE_WRAPPER_TYPE_NAME_PATTERN.matcher(typeName).matches()) return 800; return 0; } diff --git a/src/core/lombok/experimental/WithBy.java b/src/core/lombok/experimental/WithBy.java index 10155b91..6b16a5e6 100644 --- a/src/core/lombok/experimental/WithBy.java +++ b/src/core/lombok/experimental/WithBy.java @@ -76,7 +76,7 @@ import lombok.AccessLevel; * but with {@code @WithBy}, you'd write: * * <pre> - * movie = movie.withDirectorBy(d -> d.withBirthDateBy(bd -> bd.plusDays(1))); + * movie = movie.withDirectorBy(d -> d.withBirthDateBy(bd -> bd.plusDays(1))); * </pre> */ @Target({ElementType.FIELD, ElementType.TYPE}) diff --git a/src/core/lombok/javac/apt/LombokFileObjects.java b/src/core/lombok/javac/apt/LombokFileObjects.java index f6643db3..880ef1fd 100644 --- a/src/core/lombok/javac/apt/LombokFileObjects.java +++ b/src/core/lombok/javac/apt/LombokFileObjects.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2019 The Project Lombok Authors. + * 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 @@ -22,23 +22,15 @@ package lombok.javac.apt; -import java.io.IOException; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.net.URI; -import java.nio.file.Path; -import java.nio.file.Paths; import java.util.Arrays; -import java.util.Iterator; import java.util.List; -import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; -import javax.tools.FileObject; import javax.tools.JavaFileManager; import javax.tools.JavaFileObject; -import javax.tools.JavaFileObject.Kind; - -import com.sun.tools.javac.file.BaseFileManager; import lombok.core.DiagnosticsReceiver; import lombok.permit.Permit; @@ -116,22 +108,20 @@ final class LombokFileObjects { if (jfmClassName.equals("com.sun.tools.javac.file.JavacFileManager")) { try { Class<?> superType = Class.forName("com.sun.tools.javac.file.BaseFileManager"); - if (superType.isInstance(jfm)) { - return new Java9Compiler(jfm); - } + if (superType.isInstance(jfm)) return java9Compiler(jfm); } catch (Throwable e) {} return Compiler.JAVAC7; } if (KNOWN_JAVA9_FILE_MANAGERS.contains(jfmClassName)) { try { - return new Java9Compiler(jfm); + return java9Compiler(jfm); } catch (Throwable e) {} } try { if (Class.forName("com.sun.tools.javac.file.PathFileObject") == null) throw new NullPointerException(); - return new Java9Compiler(jfm); + return java9Compiler(jfm); } catch (Throwable e) {} try { if (Class.forName("com.sun.tools.javac.file.BaseFileObject") == null) throw new NullPointerException(); @@ -156,122 +146,24 @@ final class LombokFileObjects { return compiler.wrap(new InterceptingJavaFileObject(delegate, fileName, diagnostics, compiler.getDecoderMethod())); } - static class Java9Compiler implements Compiler { - private final BaseFileManager fileManager; - - public Java9Compiler(JavaFileManager jfm) { - fileManager = asBaseFileManager(jfm); - } - - @Override public JavaFileObject wrap(LombokFileObject fileObject) { - Path p; try { - p = toPath(fileObject); - } catch (Exception e) { - p = null; - } - - // J9BFOW extends javac's internal file base impl of javax.tools.JavaFileObject. - // J9JFOW just straight implements it. Probably J9JFOW is fine, but we decided to extend java's internal impl possibly for a reason. - // Some exotic build environments don't _have_ file objects and crash with FileNotFoundEx, so if that happens, let's try the alternative. - if (p != null) return new Javac9BaseFileObjectWrapper(fileManager, p, fileObject); - return new Javac9JavaFileObjectWrapper(fileObject); - } - - @Override public Method getDecoderMethod() { + private static Constructor<?> j9CompilerConstructor = null; + private static Compiler java9Compiler(JavaFileManager jfm) { + try { + if (j9CompilerConstructor == null) j9CompilerConstructor = Class.forName("lombok.javac.apt.Java9Compiler").getConstructor(JavaFileManager.class); + return (Compiler) j9CompilerConstructor.newInstance(jfm); + } catch (ClassNotFoundException e) { return null; - } - - private static Path toPath(LombokFileObject fileObject) { - URI uri = fileObject.toUri(); - if (uri.getScheme() == null) { - uri = URI.create("file:///" + uri); - } - try { - return Paths.get(uri); - } catch (IllegalArgumentException e) { - throw new IllegalArgumentException("Problems in URI '" + uri + "' (" + fileObject.toUri() + ")", e); - } - } - - private static BaseFileManager asBaseFileManager(JavaFileManager jfm) { - if (jfm instanceof BaseFileManager) { - return (BaseFileManager) jfm; - } - return new FileManagerWrapper(jfm); - } - - static class FileManagerWrapper extends BaseFileManager { - JavaFileManager manager; - - public FileManagerWrapper(JavaFileManager manager) { - super(null); - this.manager = manager; - } - - @Override - public int isSupportedOption(String option) { - return manager.isSupportedOption(option); - } - - @Override - public ClassLoader getClassLoader(Location location) { - return manager.getClassLoader(location); - } - - @Override - public Iterable<JavaFileObject> list(Location location, String packageName, Set<Kind> kinds, boolean recurse) throws IOException { - return manager.list(location, packageName, kinds, recurse); - } - - @Override - public String inferBinaryName(Location location, JavaFileObject file) { - return manager.inferBinaryName(location, file); - } - - @Override - public boolean isSameFile(FileObject a, FileObject b) { - return manager.isSameFile(a, b); - } - - @Override - public boolean handleOption(String current, Iterator<String> remaining) { - return manager.handleOption(current, remaining); - } - - @Override - public boolean hasLocation(Location location) { - return manager.hasLocation(location); - } - - @Override - public JavaFileObject getJavaFileForInput(Location location, String className, Kind kind) throws IOException { - return manager.getJavaFileForInput(location, className, kind); - } - - @Override - public JavaFileObject getJavaFileForOutput(Location location, String className, Kind kind, FileObject sibling) throws IOException { - return manager.getJavaFileForOutput(location, className, kind, sibling); - } - - @Override - public FileObject getFileForInput(Location location, String packageName, String relativeName) throws IOException { - return manager.getFileForInput(location, packageName, relativeName); - } - - @Override - public FileObject getFileForOutput(Location location, String packageName, String relativeName, FileObject sibling) throws IOException { - return manager.getFileForOutput(location, packageName, relativeName, sibling); - } - - @Override - public void flush() throws IOException { - manager.flush(); - } - - @Override - public void close() throws IOException { - manager.close(); - } + } catch (NoSuchMethodException e) { + return null; + } catch (InvocationTargetException e) { + Throwable t = e.getCause(); + if (t instanceof RuntimeException) throw (RuntimeException) t; + if (t instanceof Error) throw (Error) t; + throw new RuntimeException(t); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } catch (InstantiationException e) { + throw new RuntimeException(e); } } } diff --git a/src/core/lombok/javac/apt/LombokProcessor.java b/src/core/lombok/javac/apt/LombokProcessor.java index c32e09d5..852e5de6 100644 --- a/src/core/lombok/javac/apt/LombokProcessor.java +++ b/src/core/lombok/javac/apt/LombokProcessor.java @@ -24,6 +24,7 @@ package lombok.javac.apt; import java.io.IOException; import java.io.InputStream; import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.URL; import java.util.ArrayList; @@ -42,7 +43,6 @@ import javax.annotation.processing.RoundEnvironment; import javax.annotation.processing.SupportedAnnotationTypes; import javax.lang.model.SourceVersion; import javax.lang.model.element.Element; -import javax.lang.model.element.QualifiedNameable; import javax.lang.model.element.TypeElement; import javax.tools.Diagnostic.Kind; import javax.tools.JavaFileManager; @@ -371,7 +371,7 @@ public class LombokProcessor extends AbstractProcessor { private String getModuleNameFor(Element element) { while (element != null) { - if (element.getKind().name().equals("MODULE")) return ModuleNameOracle.getModuleName(element); + if (element.getKind().name().equals("MODULE")) return getModuleName(element); Element n = element.getEnclosingElement(); if (n == element) return null; element = n; @@ -379,12 +379,24 @@ public class LombokProcessor extends AbstractProcessor { return null; } - // QualifiedNameable is a java7 thing, so to remain compatible with java6, shove this into an inner class to avoid the ClassNotFoundError. - private static class ModuleNameOracle { - static String getModuleName(Element element) { - if (!(element instanceof QualifiedNameable)) return null; - String name = ((QualifiedNameable) element).getQualifiedName().toString().trim(); + private static Class<?> qualifiedNamableClass = null; + private static Method qualifiedNamableQualifiedNameMethod = null; + // QualifiedNameable isn't in java 6, so to remain compatible with java6, use reflection. + private static String getModuleName(Element element) { + try { + if (qualifiedNamableClass == null) qualifiedNamableClass = Class.forName("javax.lang.model.element.QualifiedNamable"); + if (!qualifiedNamableClass.isInstance(element)) return null; + if (qualifiedNamableQualifiedNameMethod == null) qualifiedNamableQualifiedNameMethod = qualifiedNamableClass.getMethod("getQualifiedName"); + String name = qualifiedNamableQualifiedNameMethod.invoke(element).toString().trim(); return name.isEmpty() ? null : name; + } catch (ClassNotFoundException e) { + return null; + } catch (NoSuchMethodException e) { + return null; + } catch (InvocationTargetException e) { + return null; + } catch (IllegalAccessException e) { + return null; } } diff --git a/src/core/lombok/javac/apt/Javac9BaseFileObjectWrapper.java b/src/core8/lombok/javac/apt/Javac9BaseFileObjectWrapper.java index f71be366..f71be366 100644 --- a/src/core/lombok/javac/apt/Javac9BaseFileObjectWrapper.java +++ b/src/core8/lombok/javac/apt/Javac9BaseFileObjectWrapper.java diff --git a/src/core8/lombok/javac/apt/Javac9Compiler.java b/src/core8/lombok/javac/apt/Javac9Compiler.java new file mode 100644 index 00000000..c02e5929 --- /dev/null +++ b/src/core8/lombok/javac/apt/Javac9Compiler.java @@ -0,0 +1,157 @@ +/* + * 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. + */ + +package lombok.javac.apt; + +import java.io.IOException; +import java.lang.reflect.Method; +import java.net.URI; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Iterator; +import java.util.Set; + +import javax.tools.FileObject; +import javax.tools.JavaFileManager; +import javax.tools.JavaFileObject; +import javax.tools.JavaFileObject.Kind; + +import com.sun.tools.javac.file.BaseFileManager; + +class Java9Compiler implements lombok.javac.apt.LombokFileObjects.Compiler { + private final BaseFileManager fileManager; + + public Java9Compiler(JavaFileManager jfm) { + fileManager = asBaseFileManager(jfm); + } + + @Override public JavaFileObject wrap(LombokFileObject fileObject) { + Path p; try { + p = toPath(fileObject); + } catch (Exception e) { + p = null; + } + + // J9BFOW extends javac's internal file base impl of javax.tools.JavaFileObject. + // J9JFOW just straight implements it. Probably J9JFOW is fine, but we decided to extend java's internal impl possibly for a reason. + // Some exotic build environments don't _have_ file objects and crash with FileNotFoundEx, so if that happens, let's try the alternative. + if (p != null) return new Javac9BaseFileObjectWrapper(fileManager, p, fileObject); + return new Javac9JavaFileObjectWrapper(fileObject); + } + + @Override public Method getDecoderMethod() { + return null; + } + + private static Path toPath(LombokFileObject fileObject) { + URI uri = fileObject.toUri(); + if (uri.getScheme() == null) { + uri = URI.create("file:///" + uri); + } + try { + return Paths.get(uri); + } catch (IllegalArgumentException e) { + throw new IllegalArgumentException("Problems in URI '" + uri + "' (" + fileObject.toUri() + ")", e); + } + } + + private static BaseFileManager asBaseFileManager(JavaFileManager jfm) { + if (jfm instanceof BaseFileManager) { + return (BaseFileManager) jfm; + } + return new FileManagerWrapper(jfm); + } + + static class FileManagerWrapper extends BaseFileManager { + JavaFileManager manager; + + public FileManagerWrapper(JavaFileManager manager) { + super(null); + this.manager = manager; + } + + @Override + public int isSupportedOption(String option) { + return manager.isSupportedOption(option); + } + + @Override + public ClassLoader getClassLoader(Location location) { + return manager.getClassLoader(location); + } + + @Override + public Iterable<JavaFileObject> list(Location location, String packageName, Set<Kind> kinds, boolean recurse) throws IOException { + return manager.list(location, packageName, kinds, recurse); + } + + @Override + public String inferBinaryName(Location location, JavaFileObject file) { + return manager.inferBinaryName(location, file); + } + + @Override + public boolean isSameFile(FileObject a, FileObject b) { + return manager.isSameFile(a, b); + } + + @Override + public boolean handleOption(String current, Iterator<String> remaining) { + return manager.handleOption(current, remaining); + } + + @Override + public boolean hasLocation(Location location) { + return manager.hasLocation(location); + } + + @Override + public JavaFileObject getJavaFileForInput(Location location, String className, Kind kind) throws IOException { + return manager.getJavaFileForInput(location, className, kind); + } + + @Override + public JavaFileObject getJavaFileForOutput(Location location, String className, Kind kind, FileObject sibling) throws IOException { + return manager.getJavaFileForOutput(location, className, kind, sibling); + } + + @Override + public FileObject getFileForInput(Location location, String packageName, String relativeName) throws IOException { + return manager.getFileForInput(location, packageName, relativeName); + } + + @Override + public FileObject getFileForOutput(Location location, String packageName, String relativeName, FileObject sibling) throws IOException { + return manager.getFileForOutput(location, packageName, relativeName, sibling); + } + + @Override + public void flush() throws IOException { + manager.flush(); + } + + @Override + public void close() throws IOException { + manager.close(); + } + } +} diff --git a/src/stubs/java/lang/annotation/ElementType.java b/src/stubs/java/lang/annotation/ElementType.java new file mode 100644 index 00000000..bbab9cda --- /dev/null +++ b/src/stubs/java/lang/annotation/ElementType.java @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package java.lang.annotation; + +/** + * The constants of this enumerated type provide a simple classification of the + * syntactic locations where annotations may appear in a Java program. These + * constants are used in {@link java.lang.annotation.Target Target} + * meta-annotations to specify where it is legal to write annotations of a + * given type. + * + * <p>The syntactic locations where annotations may appear are split into + * <em>declaration contexts</em> , where annotations apply to declarations, and + * <em>type contexts</em> , where annotations apply to types used in + * declarations and expressions. + * + * <p>The constants {@link #ANNOTATION_TYPE}, {@link #CONSTRUCTOR}, {@link + * #FIELD}, {@link #LOCAL_VARIABLE}, {@link #METHOD}, {@link #PACKAGE}, {@link + * #MODULE}, {@link #PARAMETER}, {@link #TYPE}, and {@link #TYPE_PARAMETER} + * correspond to the declaration contexts in JLS 9.6.4.1. + * + * <p>For example, an annotation whose type is meta-annotated with + * {@code @Target(ElementType.FIELD)} may only be written as a modifier for a + * field declaration. + * + * <p>The constant {@link #TYPE_USE} corresponds to the type contexts in JLS + * 4.11, as well as to two declaration contexts: type declarations (including + * annotation type declarations) and type parameter declarations. + * + * <p>For example, an annotation whose type is meta-annotated with + * {@code @Target(ElementType.TYPE_USE)} may be written on the type of a field + * (or within the type of the field, if it is a nested, parameterized, or array + * type), and may also appear as a modifier for, say, a class declaration. + * + * <p>The {@code TYPE_USE} constant includes type declarations and type + * parameter declarations as a convenience for designers of type checkers which + * give semantics to annotation types. For example, if the annotation type + * {@code NonNull} is meta-annotated with + * {@code @Target(ElementType.TYPE_USE)}, then {@code @NonNull} + * {@code class C {...}} could be treated by a type checker as indicating that + * all variables of class {@code C} are non-null, while still allowing + * variables of other classes to be non-null or not non-null based on whether + * {@code @NonNull} appears at the variable's declaration. + * + * @author Joshua Bloch + * @since 1.5 + * @jls 9.6.4.1 @Target + * @jls 4.1 The Kinds of Types and Values + */ +public enum ElementType { + /** Class, interface (including annotation type), or enum declaration */ + TYPE, + + /** Field declaration (includes enum constants) */ + FIELD, + + /** Method declaration */ + METHOD, + + /** Formal parameter declaration */ + PARAMETER, + + /** Constructor declaration */ + CONSTRUCTOR, + + /** Local variable declaration */ + LOCAL_VARIABLE, + + /** Annotation type declaration */ + ANNOTATION_TYPE, + + /** Package declaration */ + PACKAGE, + + /** + * Type parameter declaration + * + * @since 1.8 + */ + TYPE_PARAMETER, + + /** + * Use of a type + * + * @since 1.8 + */ + TYPE_USE, + + /** + * Module declaration. + * + * @since 9 + */ + MODULE +} diff --git a/src/stubsstubs/java/nio/file/Path.java b/src/stubsstubs/java/nio/file/Path.java new file mode 100644 index 00000000..5fb2e7ec --- /dev/null +++ b/src/stubsstubs/java/nio/file/Path.java @@ -0,0 +1,4 @@ +package java.nio.file; + +public class Path { +} diff --git a/src/support/info.txt b/src/support/info.txt new file mode 100644 index 00000000..1723bffe --- /dev/null +++ b/src/support/info.txt @@ -0,0 +1,4 @@ +These classes are not part of lombok itself, but used during the build. For example: +* Code to turn the changelog into HTML ready to ship to projectlombok.org +* Code to create eclipse debug targets + diff --git a/src/website/log4j.properties b/src/support/log4j.properties index 9cafcc3b..9cafcc3b 100644 --- a/src/website/log4j.properties +++ b/src/support/log4j.properties diff --git a/src/support/lombok/eclipseCreate/CreateEclipseDebugTarget.java b/src/support/lombok/eclipseCreate/CreateEclipseDebugTarget.java new file mode 100644 index 00000000..d3b314cb --- /dev/null +++ b/src/support/lombok/eclipseCreate/CreateEclipseDebugTarget.java @@ -0,0 +1,177 @@ +package lombok.eclipseCreate; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.regex.Pattern; + +public class CreateEclipseDebugTarget { + private Map<String, String> args; + private StringBuilder launchContent = new StringBuilder(); + + private static class InvalidCommandLineException extends Exception { + InvalidCommandLineException(String msg) { + super(msg); + + } + InvalidCommandLineException(String msg, Throwable cause) { + super(msg, cause); + } + } + + public static void main(String[] args) throws Exception { + CreateEclipseDebugTarget instance = new CreateEclipseDebugTarget(); + try { + instance.args = parseArgs(args); + if (instance.args.isEmpty()) throw new InvalidCommandLineException(""); + instance.go(); + } catch (InvalidCommandLineException e) { + String msg = e.getMessage(); + if (!msg.isEmpty()) System.err.println("ERROR: " + msg); + if (e.getCause() != null) { + e.getCause().printStackTrace(); + } + printCommandLineHelp(); + System.exit(1); + } catch (IOException e) { + e.printStackTrace(); + System.exit(1); + } + } + + private void go() throws InvalidCommandLineException, IOException { + prologue(); + classpath(); + epilogue(); + String n = getArgString("name"); + File f = new File(n + ".launch").getCanonicalFile(); + + OutputStream out = new FileOutputStream(f); + try { + out.write(launchContent.toString().getBytes("UTF-8")); + } finally { + out.close(); + } + + System.out.println("Debug target created: " + f); + } + + private void prologue() throws InvalidCommandLineException { + String type = getArgString("testType"); + + launchContent.append("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"); + launchContent.append("<launchConfiguration type=\"org.eclipse.jdt.junit.launchconfig\">\n"); + launchContent.append("\t<listAttribute key=\"org.eclipse.debug.core.MAPPED_RESOURCE_PATHS\">\n"); + launchContent.append("\t\t<listEntry value=\"/lombok/test/core/src/").append(type.replace(".", "/")).append(".java\"/>\n"); + launchContent.append("\t</listAttribute>\n"); + launchContent.append("\t<listAttribute key=\"org.eclipse.debug.core.MAPPED_RESOURCE_TYPES\">\n"); + launchContent.append("\t\t<listEntry value=\"1\"/>\n"); + launchContent.append("\t</listAttribute>\n"); + + if (getArgBoolean("favorite")) { + launchContent.append("\t<listAttribute key=\"org.eclipse.debug.ui.favoriteGroups\">\n"); + launchContent.append("\t\t<listEntry value=\"org.eclipse.debug.ui.launchGroup.debug\"/>\n"); + launchContent.append("\t</listAttribute>\n"); + } + + launchContent.append("\t<stringAttribute key=\"org.eclipse.jdt.junit.CONTAINER\" value=\"\"/>\n"); + launchContent.append("\t<booleanAttribute key=\"org.eclipse.jdt.junit.KEEPRUNNING_ATTR\" value=\"false\"/>\n"); + launchContent.append("\t<stringAttribute key=\"org.eclipse.jdt.junit.TESTNAME\" value=\"\"/>\n"); + launchContent.append("\t<stringAttribute key=\"org.eclipse.jdt.junit.TEST_KIND\" value=\"org.eclipse.jdt.junit.loader.junit4\"/>\n"); + launchContent.append("\t<booleanAttribute key=\"org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD\" value=\"true\"/>\n"); + } + + private void classpath() throws InvalidCommandLineException { + launchContent.append("\t<listAttribute key=\"org.eclipse.jdt.launching.CLASSPATH\">\n"); + + String self; try { + self = new File("..").getCanonicalPath(); + } catch (IOException e) { + throw new InvalidCommandLineException("Cannot obtain canonical path to parent directory", e); + } + + launchContent.append("\t\t<listEntry value=\"<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/lombok/bin" path="3" type="2"/> \"/>\n"); + for (Map.Entry<String, String> entry : args.entrySet()) { + if (!entry.getKey().startsWith("conf.")) continue; + String[] files = entry.getValue().split(Pattern.quote(File.pathSeparator)); + for (String file : files) { + String n; + try { + n = new File(file).getCanonicalPath(); + } catch (IOException e) { + throw new InvalidCommandLineException("Cannot obtain canonical path to dependency " + file, e); + } + if (n.startsWith(self)) { + launchContent.append("\t\t<listEntry value=\"<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive=""); + launchContent.append(n.substring(self.length())); + launchContent.append("" path="3" type="2"/> \"/>\n"); + } + } + } + launchContent.append("\t\t<listEntry value=\"<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry internalArchive="/lombok/lib/openjdk6_rt.jar" path="5" type="2"/> \"/>\n"); + launchContent.append("\t</listAttribute>\n"); + } + + private void epilogue() throws InvalidCommandLineException { + String type = getArgString("testType"); + + launchContent.append("\t<booleanAttribute key=\"org.eclipse.jdt.launching.DEFAULT_CLASSPATH\" value=\"false\"/>\n"); + String jvmTarget = getArgString("jvmTarget"); + launchContent.append("\t<stringAttribute key=\"org.eclipse.jdt.launching.JRE_CONTAINER\" value=\"org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-").append(jvmTarget).append("\"/>\n"); + launchContent.append("\t<stringAttribute key=\"org.eclipse.jdt.launching.MAIN_TYPE\" value=\"").append(type).append("\"/>\n"); + launchContent.append("\t<listAttribute key=\"org.eclipse.jdt.launching.MODULEPATH\"/>\n"); + launchContent.append("\t<stringAttribute key=\"org.eclipse.jdt.launching.PROJECT_ATTR\" value=\"lombok\"/>\n"); + launchContent.append("<stringAttribute key=\"org.eclipse.jdt.launching.VM_ARGUMENTS\" value=\"-javaagent:dist/lombok.jar -Dshadow.override.lombok=${project_loc:lombok}/bin"); + for (Map.Entry<String, String> entry : args.entrySet()) { + if (!entry.getKey().startsWith("conf.")) continue; + launchContent.append(File.pathSeparator).append(entry.getValue()); + } + launchContent.append(" -Ddelombok.bootclasspath=lib/openjdk6_rt.jar\"/>\n"); + launchContent.append("</launchConfiguration>\n"); + } + + private String getArgString(String key) throws InvalidCommandLineException { + String v = args.get(key); + if (v == null) throw new InvalidCommandLineException("mandatory argument '" + key + "' missing"); + return v; + } + + private boolean getArgBoolean(String key) throws InvalidCommandLineException { + String v = args.get(key); + if (v == null) return false; + if (v.equalsIgnoreCase("false") || v.equalsIgnoreCase("f")) return false; + return true; + } + + private static void printCommandLineHelp() { + System.err.println("CreateEclipseDebugTarget\n" + + " name=Lombok-test BaseJavac 11 # Sets the name of the debug target to make\n" + + " testType=lombok.RunJavacAndBaseTests # The test class file that this debug target should run\n" + + " conf.test=foo:bar:baz # Where 'test' is an ivy conf name, and 'foo' is a path to a jar, relativized vs. current directory.\n" + + " favorite # Should the debug target be marked as favourite?\n" + + ""); + } + + private static Map<String, String> parseArgs(String[] args) throws IllegalArgumentException { + Map<String, String> map = new LinkedHashMap<String, String>(); + + for (String arg : args) { + int idx = arg.indexOf('='); + String key = (idx == -1 ? arg : arg.substring(0, idx)).trim(); + String value = (idx == -1 ? "" : arg.substring(idx + 1)).trim(); + String existing = map.get(key); + if (existing != null) { + if (key.startsWith("conf.")) { + value = existing + File.pathSeparator + value; + } else { + throw new IllegalArgumentException("Duplicate argument not allowed: " + key); + } + } + map.put(key, value); + } + return map; + } +}
\ No newline at end of file diff --git a/src/website/lombok/website/CompileChangelog.java b/src/support/lombok/website/CompileChangelog.java index 8912434e..8912434e 100644 --- a/src/website/lombok/website/CompileChangelog.java +++ b/src/support/lombok/website/CompileChangelog.java diff --git a/src/support/lombok/website/Domain.java b/src/support/lombok/website/Domain.java new file mode 100644 index 00000000..103c7377 --- /dev/null +++ b/src/support/lombok/website/Domain.java @@ -0,0 +1,26 @@ +package lombok.website; + +import java.net.MalformedURLException; +import java.net.URL; + +public class Domain { + private static final String DEFAULT = "https://projectlombok.org/"; + private final String prefix; + + public Domain(String arg) { + if (arg == null || arg.isEmpty()) this.prefix = DEFAULT; + else { + if (!arg.contains("://")) arg = "https://" + arg; + if (!arg.endsWith("/")) arg += "/"; + this.prefix = arg; + } + } + + public String getPrefix() { + return prefix; + } + + public URL url(String path) throws MalformedURLException { + return new URL(prefix + path); + } +} diff --git a/src/website/lombok/website/FetchCurrentVersion.java b/src/support/lombok/website/FetchCurrentVersion.java index d32c45dd..ec8d833a 100644 --- a/src/website/lombok/website/FetchCurrentVersion.java +++ b/src/support/lombok/website/FetchCurrentVersion.java @@ -4,7 +4,6 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.net.URL; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -14,11 +13,11 @@ public class FetchCurrentVersion { private static final Pattern VERSION_PATTERN = Pattern.compile("^.*<\\s*span\\s+id\\s*=\\s*[\"'](currentVersion|currentVersionFull)[\"'](?:\\s+style\\s*=\\s*[\"']display\\s*:\\s*none;?[\"'])?\\s*>\\s*([^\t<]+)\\s*<\\s*/\\s*span\\s*>.*$"); public static void main(String[] args) throws IOException { - System.out.print(fetchVersionFromSite(args.length == 0 || args[0].equals("full"))); + System.out.print(fetchVersionFromSite(args.length < 2 || args[1].equals("full"), new Domain(args.length < 1 ? "" : args[0]))); } - public static String fetchVersionFromSite(boolean fetchFull) throws IOException { - InputStream in = new URL("https://projectlombok.org/download").openStream(); + public static String fetchVersionFromSite(boolean fetchFull, Domain domain) throws IOException { + InputStream in = domain.url("download").openStream(); try { BufferedReader br = new BufferedReader(new InputStreamReader(in, "UTF-8")); try { diff --git a/src/website/lombok/website/WebsiteMaker.java b/src/support/lombok/website/WebsiteMaker.java index 87d6dcc6..d786e605 100644 --- a/src/website/lombok/website/WebsiteMaker.java +++ b/src/support/lombok/website/WebsiteMaker.java @@ -11,7 +11,6 @@ import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.Writer; import java.lang.reflect.Method; -import java.net.URL; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; @@ -70,7 +69,14 @@ public class WebsiteMaker { } } - private static void buildAll(String version, String fullVersion, String argIn, String argOut) throws Exception { + private static void printAllVersions(Domain domain) throws Exception { + List<List<String>> versions = readAllVersions(domain); + for (List<String> v : versions) { + System.out.println(" <a href=\"" + v.get(0) + "\">" + v.get(1) + "</a>"); + } + } + + private static void buildAll(Domain domain, String version, String fullVersion, String argIn, String argOut, boolean newRelease) throws Exception { File in, out; if (argIn == null) { in = new File("."); @@ -89,7 +95,7 @@ public class WebsiteMaker { out = new File(argOut); } WebsiteMaker maker = new WebsiteMaker(version, fullVersion, in, out); - maker.buildWebsite(); + maker.buildWebsite(domain, newRelease); } private static void buildChangelog(String version, String fullVersion, String argIn, String argOut) throws Exception { @@ -160,25 +166,32 @@ public class WebsiteMaker { public static void main(String[] args) throws Exception { String version, fullVersion; + Domain domain = new Domain(args.length < 1 ? "" : args[0]); - if (args.length < 2) { + if (args.length < 3) { version = VersionFinder.getVersion(); fullVersion = VersionFinder.getFullVersion(); } else { - version = args[0]; - fullVersion = args[1]; + version = args[1]; + fullVersion = args[2]; } - if (args.length < 3 || args[2].equalsIgnoreCase("all")) { - buildAll(version, fullVersion, args.length < 4 ? null : args[3], args.length < 5 ? null : args[4]); - } else if (args[2].equalsIgnoreCase("changelog")) { - buildChangelog(version, fullVersion, args.length < 4 ? null : args[3], args.length < 5 ? null : args[4]); - } else if (args[2].equalsIgnoreCase("download-edge")) { - buildDownloadEdge(version, fullVersion, args.length < 4 ? null : args[3], args.length < 5 ? null : args[4]); - } else if (args[2].equalsIgnoreCase("changelog-latest")) { - buildChangelogLatest(version, fullVersion, args.length < 4 ? null : args[3], args.length < 5 ? null : args[4]); + String argIn = args.length < 5 ? null : args[4]; + String argOut = args.length < 6 ? null : args[5]; + if (args.length < 4 || args[3].equalsIgnoreCase("all")) { + buildAll(domain, version, fullVersion, argIn, argOut, false); + } else if (args.length < 4 || args[3].equalsIgnoreCase("all-newrelease")) { + buildAll(domain, version, fullVersion, argIn, argOut, true); + } else if (args[3].equalsIgnoreCase("changelog")) { + buildChangelog(version, fullVersion, argIn, argOut); + } else if (args[3].equalsIgnoreCase("download-edge")) { + buildDownloadEdge(version, fullVersion, argIn, argOut); + } else if (args[3].equalsIgnoreCase("changelog-latest")) { + buildChangelogLatest(version, fullVersion, argIn, argOut); + } else if (args[3].equalsIgnoreCase("print-allversions")) { + printAllVersions(domain); } else { - throw new IllegalArgumentException("3rd argument must be one of 'all', 'changelog', 'download-edge', 'changelog-latest'"); + throw new IllegalArgumentException("4th argument must be one of 'all', 'changelog', 'download-edge', 'changelog-latest'"); } } @@ -230,11 +243,11 @@ public class WebsiteMaker { convertHtAccess(freemarkerConfig, out); } - public void buildWebsite() throws Exception { + public void buildWebsite(Domain domain, boolean newRelease) throws Exception { Configuration freemarkerConfig = makeFreemarkerConfig(); outputDir.mkdirs(); - convertTemplates(freemarkerConfig); + convertTemplates(domain, freemarkerConfig, newRelease); buildHtAccess(new File(outputDir, ".htaccess")); } @@ -298,10 +311,10 @@ public class WebsiteMaker { } } - private void convertTemplates(Configuration freemarker) throws Exception { + private void convertTemplates(Domain domain, Configuration freemarker, boolean newRelease) throws Exception { File basePagesLoc = new File(baseDir, "templates"); Map<String, Object> dataModel = createBasicDataModel(); - dataModel.putAll(createExtendedDataModel()); + dataModel.putAll(createExtendedDataModel(domain, newRelease)); convertTemplates_(freemarker, "", basePagesLoc, outputDir, 0, dataModel); } @@ -342,25 +355,39 @@ public class WebsiteMaker { } private static final Pattern LOMBOK_LINK = Pattern.compile("^.*<a(?: (?:id|class|rel|rev|download|target|type)(?:=\"[^\"]*\")?)* href=\"(downloads/[^\"]+)\"(?: (?:id|class|rel|rev|download|target|type)(?:=\"[^\"]*\")?)*>([^<]+)</a>.*$"); - private Map<String, Object> createExtendedDataModel() throws IOException { + private Map<String, Object> createExtendedDataModel(Domain domain, boolean newRelease) throws IOException { Map<String, Object> data = new HashMap<String, Object>(); data.put("usages", new HtmlMaker(new File(baseDir, "usageExamples"))); - InputStream in = new URL("https://projectlombok.org/all-versions.html").openStream(); + List<List<String>> allVersions = readAllVersions(domain); + if (!newRelease && !allVersions.isEmpty()) allVersions.remove(0); // remove current version; it will be 're-added' as current version automatically. + data.put("linksToVersions", allVersions); + + return data; + } + + private static List<List<String>> readAllVersions(Domain domain) throws IOException { + InputStream in = domain.url("all-versions.html").openStream(); ArrayList<List<String>> links = new ArrayList<List<String>>(); try { BufferedReader br = new BufferedReader(new InputStreamReader(in, "UTF-8")); for (String line = br.readLine(); line != null; line = br.readLine()) { Matcher m = LOMBOK_LINK.matcher(line); - if (m.matches()) links.add(Arrays.asList(m.group(1), m.group(2))); + if (m.matches()) { + String url = m.group(1); + String name = m.group(2); + if (name.endsWith(" [Current Version]")) { + name = "lombok-" + name.substring(0, name.length() - " [Current Version]".length()) + ".jar"; + url = url.replace("lombok.jar", name); + } + links.add(Arrays.asList(name, url)); + } } } finally { in.close(); } - data.put("linksToVersions", links); - - return data; + return links; } public static class HtmlMaker { diff --git a/src/testAP/org/projectlombok/testAp/ExampleAnnotation.java b/src/testAP/org/projectlombok/testAp/ExampleAnnotation.java deleted file mode 100644 index b419326b..00000000 --- a/src/testAP/org/projectlombok/testAp/ExampleAnnotation.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.projectlombok.testAp; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Retention(RetentionPolicy.CLASS) -@Target(ElementType.TYPE) -public @interface ExampleAnnotation {} diff --git a/src/testAP/org/projectlombok/testAp/TestAp.java b/src/testAP/org/projectlombok/testAp/TestAp.java deleted file mode 100644 index b5f20d21..00000000 --- a/src/testAP/org/projectlombok/testAp/TestAp.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2016 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. - */ -package org.projectlombok.testAp; - -import java.util.Set; - -import javax.annotation.processing.AbstractProcessor; -import javax.annotation.processing.ProcessingEnvironment; -import javax.annotation.processing.RoundEnvironment; -import javax.annotation.processing.SupportedAnnotationTypes; -import javax.lang.model.SourceVersion; -import javax.lang.model.element.Element; -import javax.lang.model.element.ElementKind; -import javax.lang.model.element.ExecutableElement; -import javax.lang.model.element.TypeElement; -import javax.lang.model.type.TypeMirror; - -@SupportedAnnotationTypes("org.projectlombok.testAp.ExampleAnnotation") -public final class TestAp extends AbstractProcessor { - private int roundCounter = 0; - private static final long START = System.currentTimeMillis(); - - private void log(String txt) { - System.out.printf("***[%3d]: %s\n", System.currentTimeMillis() - START, txt); - } - - @Override public void init(ProcessingEnvironment processingEnv) { - log("TestAP in init"); - super.init(processingEnv); - } - - @Override public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { - roundCounter++; - log("TestAP in round " + roundCounter); - boolean foundGetTest = false; - int annotatedElemCount = 0; - for (Element annotated : roundEnv.getElementsAnnotatedWith(ExampleAnnotation.class)) { - annotatedElemCount++; - for (Element child : annotated.getEnclosedElements()) { - if (child.getSimpleName().toString().equals("getTest") && child.getKind() == ElementKind.METHOD) foundGetTest = true; - if (child instanceof ExecutableElement) { - TypeMirror returnType = ((ExecutableElement) child).getReturnType(); - System.out.println("RETURN TYPE for " + child.getSimpleName() + ": " + returnType.getClass() + " -- " + returnType.toString()); - } - } - } - - if (foundGetTest) log("RESULT: POSITIVE -- found the getTest method"); - else if (annotatedElemCount > 0) log("RESULT: NEGATIVE -- found the example class but there's no getTest method in it according to the type mirror."); - else log("RESULT: AMBIVALENT -- The example class is not provided by 'getElementsAnnotatedWith' in this round. Not an issue, unless previously you got a NEGATIVE result."); - - return false; - } - - @Override public SourceVersion getSupportedSourceVersion() { - return SourceVersion.latestSupported(); - } -} diff --git a/src/useTestAP/UseTestAp.java b/src/useTestAP/UseTestAp.java deleted file mode 100644 index 2d7eab7b..00000000 --- a/src/useTestAP/UseTestAp.java +++ /dev/null @@ -1,13 +0,0 @@ -@org.projectlombok.testAp.ExampleAnnotation -//@lombok.experimental.Accessors(chain=true) -public class UseTestAp { - @lombok.Setter @lombok.Getter String test; - - public void confirmGetTestExists() { - System.out.println(getTest()); - } - - public UseTestAp returningSelf() { - return this; - } -} diff --git a/src/utils/lombok/core/JavaIdentifiers.java b/src/utils/lombok/core/JavaIdentifiers.java index cbe90eed..906ae0e1 100644 --- a/src/utils/lombok/core/JavaIdentifiers.java +++ b/src/utils/lombok/core/JavaIdentifiers.java @@ -21,6 +21,8 @@ */ package lombok.core; +import java.util.regex.Pattern; + /** * Utility functions for validating potential java verifiers. */ @@ -54,4 +56,13 @@ public class JavaIdentifiers { public static boolean isKeyword(String keyword) { return KEYWORDS.contains(keyword); } + + /** Matches any of the 8 primitive names, such as {@code boolean}. */ + private static final Pattern PRIMITIVE_TYPE_NAME_PATTERN = Pattern.compile("^(?:boolean|byte|short|int|long|float|double|char)$"); + + public static boolean isPrimitive(String typeName) { + return PRIMITIVE_TYPE_NAME_PATTERN.matcher(typeName).matches(); + } + + } diff --git a/src/utils/lombok/core/SpiLoadUtil.java b/src/utils/lombok/core/SpiLoadUtil.java index e685acd6..0feb7f12 100644 --- a/src/utils/lombok/core/SpiLoadUtil.java +++ b/src/utils/lombok/core/SpiLoadUtil.java @@ -129,9 +129,10 @@ public class SpiLoadUtil { private static void readServicesFromUrl(Collection<String> list, URL url) throws IOException { InputStream in = url.openStream(); + BufferedReader r = null; try { if (in == null) return; - BufferedReader r = new BufferedReader(new InputStreamReader(in, "UTF-8")); + r = new BufferedReader(new InputStreamReader(in, "UTF-8")); while (true) { String line = r.readLine(); if (line == null) break; @@ -143,6 +144,7 @@ public class SpiLoadUtil { } } finally { try { + if (r != null) r.close(); if (in != null) in.close(); } catch (Throwable ignore) {} } diff --git a/src/utils/lombok/eclipse/Eclipse.java b/src/utils/lombok/eclipse/Eclipse.java index 9ec63c79..31979955 100644 --- a/src/utils/lombok/eclipse/Eclipse.java +++ b/src/utils/lombok/eclipse/Eclipse.java @@ -29,7 +29,7 @@ import java.util.regex.Pattern; import lombok.core.ClassLiteral; import lombok.core.FieldSelect; -import lombok.core.handlers.HandlerUtil; +import lombok.core.JavaIdentifiers; import lombok.permit.Permit; import org.eclipse.jdt.internal.compiler.ast.ASTNode; @@ -164,7 +164,7 @@ public class Eclipse { */ public static boolean isPrimitive(TypeReference ref) { if (ref.dimensions() > 0) return false; - return HandlerUtil.isPrimitive(toQualifiedName(ref.getTypeName())); + return JavaIdentifiers.isPrimitive(toQualifiedName(ref.getTypeName())); } /** diff --git a/src/utils/lombok/javac/Javac.java b/src/utils/lombok/javac/Javac.java index 234c7f73..cec43705 100644 --- a/src/utils/lombok/javac/Javac.java +++ b/src/utils/lombok/javac/Javac.java @@ -57,7 +57,7 @@ import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition; import lombok.core.ClassLiteral; import lombok.core.FieldSelect; -import lombok.core.handlers.HandlerUtil; +import lombok.core.JavaIdentifiers; import lombok.javac.JavacTreeMaker.TreeTag; import lombok.javac.JavacTreeMaker.TypeTag; import lombok.permit.Permit; @@ -133,7 +133,7 @@ public class Javac { * expression) represents a primitive type. */ public static boolean isPrimitive(JCExpression ref) { - return HandlerUtil.isPrimitive(ref.toString()); + return JavaIdentifiers.isPrimitive(ref.toString()); } /** diff --git a/ssh.knownHosts b/ssh.knownHosts index 873e852f..6cce7f01 100644 --- a/ssh.knownHosts +++ b/ssh.knownHosts @@ -1,2 +1,2 @@ projectlombok.org:22:ECDSA:X.509:MIIBMzCB7AYHKoZIzj0CATCB4AIBATAsBgcqhkjOPQEBAiEA/////wAAAAEAAAAAAAAAAAAAAAD///////////////8wRAQg/////wAAAAEAAAAAAAAAAAAAAAD///////////////wEIFrGNdiqOpPns+u9VXaYhrxlHQawzFOw9jvOPD4n0mBLBEEEaxfR8uEsQkf4vOblY6RA8ncDfYEt6zOg9KE5RdiYwpZP40Li/hp/m47n60p8D54WK84zV2sxXs7LtkBoN79R9QIhAP////8AAAAA//////////+85vqtpxeehPO5ysL8YyVRAgEBA0IABKwMbAFQuRwz9+PnuBOlc1OqPAYVhg0VBTGQ1G5V6JVfb0CU5GH4NEFp+jEAoGCZNrghB0XLB3d3egfF06ihDgE= - +projectlombok.org:22:EdDSA:X.509:MCowBQYDK2VwAyEA450nCMycc70u7i0qetTrh9yl6+cOS6v4y8clPCnSIHs= diff --git a/test/core/src/lombok/DirectoryRunner.java b/test/core/src/lombok/DirectoryRunner.java index b8b1da43..e4792ca9 100644 --- a/test/core/src/lombok/DirectoryRunner.java +++ b/test/core/src/lombok/DirectoryRunner.java @@ -82,8 +82,16 @@ public class DirectoryRunner extends Runner { private static final FileFilter JAVA_FILE_FILTER = new FileFilter() { @Override public boolean accept(File file) { - return file.isFile() && file.getName().endsWith(".java") && - (DEBUG_FOCUS_ON_FILE.isEmpty() || DEBUG_FOCUS_ON_FILE.contains(file.getName())); + if (!file.isFile() || !file.getName().endsWith(".java")) return false; + boolean positiveFilter = false; + for (String dfof : DEBUG_FOCUS_ON_FILE) { + if (!dfof.endsWith(".java")) dfof = dfof + ".java"; + boolean invert = dfof.startsWith("!"); + if (invert) dfof = dfof.substring(1); + positiveFilter = positiveFilter || !invert; + if (file.getName().equals(dfof)) return !invert; + } + return !positiveFilter; } }; diff --git a/test/core/src/lombok/RunTestsViaDelombok.java b/test/core/src/lombok/RunTestsViaDelombok.java index 0887de32..b766e7a4 100644 --- a/test/core/src/lombok/RunTestsViaDelombok.java +++ b/test/core/src/lombok/RunTestsViaDelombok.java @@ -29,16 +29,20 @@ import java.io.UnsupportedEncodingException; import java.util.Collection; import java.util.Locale; import java.util.Map; +import java.util.concurrent.atomic.AtomicBoolean; import lombok.delombok.Delombok; import lombok.javac.CapturingDiagnosticListener; +import lombok.javac.Javac; import lombok.javac.CapturingDiagnosticListener.CompilerMessage; public class RunTestsViaDelombok extends AbstractRunTests { private Delombok delombok = new Delombok(); + private static AtomicBoolean compilerVersionReported = new AtomicBoolean(); @Override public boolean transformCode(Collection<CompilerMessage> messages, StringWriter result, final File file, String encoding, Map<String, String> formatPreferences) throws Throwable { + if (!compilerVersionReported.getAndSet(true)) System.out.println("Javac version: " + Javac.getJavaCompilerVersion()); delombok.setVerbose(true); ChangedChecker cc = new ChangedChecker(); delombok.setFeedback(cc.feedback); diff --git a/test/core/src/lombok/RunTestsViaEcj.java b/test/core/src/lombok/RunTestsViaEcj.java index 3efe38f5..77d1b75e 100644 --- a/test/core/src/lombok/RunTestsViaEcj.java +++ b/test/core/src/lombok/RunTestsViaEcj.java @@ -69,7 +69,8 @@ public class RunTestsViaEcj extends AbstractRunTests { warnings.put(CompilerOptions.OPTION_ReportUnusedLabel, "ignore"); warnings.put(CompilerOptions.OPTION_ReportUnusedImport, "ignore"); warnings.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, "ignore"); - warnings.put(CompilerOptions.OPTION_Source, "1." + Eclipse.getEcjCompilerVersion()); + int ecjVersion = Eclipse.getEcjCompilerVersion(); + warnings.put(CompilerOptions.OPTION_Source, (ecjVersion < 9 ? "1." : "") + ecjVersion); options.set(warnings); return options; } @@ -137,16 +138,13 @@ public class RunTestsViaEcj extends AbstractRunTests { } if (new File("bin").exists()) classpath.add("bin"); classpath.add("dist/lombok.jar"); - classpath.add("lib/oracleJDK8Environment/rt.jar"); - classpath.add("lib/test/commons-logging-commons-logging.jar"); - classpath.add("lib/test/org.slf4j-slf4j-api.jar"); - classpath.add("lib/test/org.slf4j-slf4j-ext.jar"); - classpath.add("lib/test/log4j-log4j.jar"); - classpath.add("lib/test/org.apache.logging.log4j-log4j-api.jar"); - classpath.add("lib/test/org.jboss.logging-jboss-logging.jar"); - classpath.add("lib/test/com.google.guava-guava.jar"); - classpath.add("lib/test/com.google.code.findbugs-findbugs.jar"); - classpath.add("lib/test/com.google.flogger-flogger.jar"); + classpath.add("lib/openjdk6_rt.jar"); + for (File f : new File("lib/test").listFiles()) { + String fn = f.getName(); + if (fn.length() < 4) continue; + if (!fn.substring(fn.length() - 4).toLowerCase().equals(".jar")) continue; + classpath.add("lib/test/" + fn); + } return new FileSystem(classpath.toArray(new String[0]), new String[] {file.getAbsolutePath()}, "UTF-8"); } } diff --git a/test/transform/src/lombok/transform/RunTransformTests.java b/test/core/src/lombok/TestBase.java index 0afbc5d6..4b0c02f3 100644 --- a/test/transform/src/lombok/transform/RunTransformTests.java +++ b/test/core/src/lombok/TestBase.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2012 The Project Lombok Authors. + * Copyright (C) 2011-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 @@ -19,13 +19,13 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package lombok.transform; +package lombok; import org.junit.runner.RunWith; import org.junit.runners.Suite; import org.junit.runners.Suite.SuiteClasses; @RunWith(Suite.class) -@SuiteClasses({TestLombokFilesIdempotent.class, TestSourceFiles.class, TestWithDelombok.class, TestWithEcj.class}) -public class RunTransformTests { +@SuiteClasses({lombok.core.configuration.RunConfigurationTests.class, lombok.core.RunCoreTests.class}) +public class TestBase { } diff --git a/test/core/src/lombok/RunAllTests.java b/test/core/src/lombok/TestEclipse.java index 1ca76af5..9fe798bc 100644 --- a/test/core/src/lombok/RunAllTests.java +++ b/test/core/src/lombok/TestEclipse.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2015 The Project Lombok Authors. + * Copyright (C) 2011-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 @@ -26,6 +26,6 @@ import org.junit.runners.Suite; import org.junit.runners.Suite.SuiteClasses; @RunWith(Suite.class) -@SuiteClasses({lombok.transform.RunTransformTests.class, lombok.bytecode.RunBytecodeTests.class, lombok.core.configuration.RunConfigurationTests.class, lombok.core.RunCoreTests.class}) -public class RunAllTests { +@SuiteClasses({lombok.transform.TestWithEcj.class}) +public class TestEclipse { } diff --git a/test/core/src/lombok/TestJavac.java b/test/core/src/lombok/TestJavac.java new file mode 100644 index 00000000..340abb35 --- /dev/null +++ b/test/core/src/lombok/TestJavac.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2011-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. + */ +package lombok; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; +import org.junit.runners.Suite.SuiteClasses; + +@RunWith(Suite.class) +//@SuiteClasses({lombok.bytecode.RunBytecodeTests.class, lombok.transform.TestLombokFilesIdempotent.class, lombok.transform.TestSourceFiles.class, lombok.transform.TestWithDelombok.class}) +@SuiteClasses({lombok.transform.TestLombokFilesIdempotent.class}) +public class TestJavac { +} diff --git a/website/templates/all-versions.html b/website/templates/all-versions.html index 0207b351..db48f664 100644 --- a/website/templates/all-versions.html +++ b/website/templates/all-versions.html @@ -6,9 +6,7 @@ <h1 class="text-center"> <div class="row"> <icon class="fa fa-download"></icon> - <a class="currentVersion" href="downloads/lombok.jar"> - ${version} [Current Version] - </a> + <a class="currentVersion" href="downloads/lombok.jar">${version} [Current Version]</a> </div> </h1> </div> |