aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buildScripts/create-eclipse-project.ant.xml92
-rw-r--r--buildScripts/setup.ant.xml25
-rw-r--r--src/support/lombok/eclipseCreate/CreateEclipseDebugTarget.java6
3 files changed, 81 insertions, 42 deletions
diff --git a/buildScripts/create-eclipse-project.ant.xml b/buildScripts/create-eclipse-project.ant.xml
index 89e2f91f..67eff3bc 100644
--- a/buildScripts/create-eclipse-project.ant.xml
+++ b/buildScripts/create-eclipse-project.ant.xml
@@ -59,7 +59,6 @@ This buildfile is part of projectlombok.org. It creates the infrastructure neede
<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>
@@ -75,6 +74,7 @@ This buildfile is part of projectlombok.org. It creates the infrastructure neede
<arg value="favorite" />
</java>
+ <fetchdep.eclipse version="202006" />
<java classname="lombok.eclipseCreate.CreateEclipseDebugTarget" failonerror="true">
<classpath>
<path refid="cp.buildtools" />
@@ -86,7 +86,7 @@ This buildfile is part of projectlombok.org. It creates the infrastructure neede
<arg value="bootpath=${jdk8-rt.loc}" />
<arg value="conf.test=${cp.test}" />
<arg value="conf.stripe=${cp.stripe}" />
- <arg value="conf.eclipse-oxygen=${cp.eclipse-202006}" />
+ <arg value="conf.eclipse-202006=${cp.eclipse-202006}" />
<arg value="favorite" />
</java>
@@ -104,79 +104,105 @@ This buildfile is part of projectlombok.org. It creates the infrastructure neede
</java>
</target>
+ <macrodef name="eclipse.testtarget.conf.jvmtarget">
+ <attribute name="question" default="Which JDK do you want to target? Enter a version, such as '11'. Suggested (default): 8" />
+ <attribute name="validargs" default="6,8,11,14" />
+ <sequential>
+ <property name="cp.test" refid="cp.test" />
+ <property name="cp.stripe" refid="cp.stripe" />
+
+ <input message="@{question}" validargs="@{validargs}" defaultvalue="8" addproperty="inputs.jvmtarget.raw" />
+
+ <condition property="inputs.jvmtarget" value="1.6"><equals arg1="${inputs.jvmtarget.raw}" arg2="6" /></condition>
+ <condition property="inputs.jvmtarget" value="1.8"><equals arg1="${inputs.jvmtarget.raw}" arg2="8" /></condition>
+ <property name="inputs" value="${inputs.jvmtarget.raw}" />
+
+ <condition property="inputs.bootpath" value="${jdk6-rt.loc}"><equals arg1="${inputs.jvmtarget.raw}" arg2="6" /></condition>
+ <condition property="inputs.bootpath" value="${jdk8-rt.loc}"><equals arg1="${inputs.jvmtarget.raw}" arg2="8" /></condition>
+ <property name="inputs.bootpath" value="0" />
+ </sequential>
+ </macrodef>
+
<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}" />
+ <eclipse.testtarget.conf.jvmtarget question="Which javac do you want to target? Enter a version, such as '11'." validargs="8,11,13,14,15" />
<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="name=Lombok-test Javac ${inputs.jvmtarget.raw}" />
<arg value="testType=lombok.TestJavac" />
- <arg value="jvmTarget=${testtarget.jvmTarget}" />
+ <arg value="jvmTarget=${inputs.jvmtarget}" />
+ <arg value="bootpath=${inputs.bootpath}" />
<arg value="conf.test=${cp.test}" />
<arg value="conf.stripe=${cp.stripe}" />
- <arg value="conf.${testtarget.confname}=${testtarget.confcp}" />
+ <arg value="conf.${inputs.confname}=${inputs.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" />
+ <eclipse.testtarget.conf.jvmtarget />
- <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" />
+ <local name="inputs.eclipsetarget" />
+ <input message="Which eclipse do you want to target? Enter a version, such as 'oxygen'." validargs="oxygen" addproperty="inputs.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}" />
+ <local name="inputs.confname" />
+ <property name="inputs.confname" value="eclipse-${inputs.eclipsetarget}" />
+
+ <local name="inputs.confcp" />
+ <property name="inputs.confcp" refid="cp.eclipse-${inputs.eclipsetarget}" />
+
+ <fetchdep.eclipse version="${inputs.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="name=Lombok-test Eclipse-${inputs.eclipsetarget}" />
<arg value="testType=lombok.TestEclipse" />
- <arg value="jvmTarget=${testtarget.jvmTarget}" />
+ <arg value="jvmTarget=${inputs.jvmtarget}" />
+ <arg value="bootpath=${inputs.bootpath}" />
<arg value="conf.test=${cp.test}" />
<arg value="conf.stripe=${cp.stripe}" />
- <arg value="conf.${testtarget.confname}=${testtarget.confcp}" />
+ <arg value="conf.${inputs.confname}=${inputs.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" />
+ <eclipse.testtarget.conf.jvmtarget />
+
+ <local name="inputs.ecjtarget" />
+ <input message="Which ecj do you want to target? Enter a version, such as '8'." validargs="8,11,14" addproperty="inputs.ecjtarget" />
+
+ <local name="inputs.confname" />
+ <property name="inputs.confname" value="ecj${inputs.ecjtarget}" />
+
+ <local name="inputs.confcp" />
+ <property name="inputs.confcp" refid="cp.ecj${inputs.ecjtarget}" />
- <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" />
+ <local name="inputs.bootpath" />
+ <condition property="inputs.bootpath" value="${jdk6-rt.loc}"><equals arg1="${inputs.jvmtarget.raw}" arg2="6" /></condition>
+ <condition property="inputs.bootpath" value="${jdk8-rt.loc}"><equals arg1="${inputs.jvmtarget.raw}" arg2="8" /></condition>
+ <property name="inputs.bootpath" value="0" />
- <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}" />
+ <fetchdep.ecj version="${inputs.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="name=Lombok-test ECJ${inputs.ecjtarget}" />
<arg value="testType=lombok.TestEclipse" />
- <arg value="jvmTarget=${testtarget.jvmTarget}" />
+ <arg value="jvmTarget=${inputs.jvmtarget}" />
+ <arg value="bootpath=${inputs.bootpath}" />
<arg value="conf.test=${cp.test}" />
<arg value="conf.stripe=${cp.stripe}" />
- <arg value="conf.${testtarget.confname}=${testtarget.confcp}" />
+ <arg value="conf.${inputs.confname}=${inputs.confcp}" />
<arg value="favorite" />
</java>
</target>
diff --git a/buildScripts/setup.ant.xml b/buildScripts/setup.ant.xml
index 6ab23897..9b96240d 100644
--- a/buildScripts/setup.ant.xml
+++ b/buildScripts/setup.ant.xml
@@ -141,11 +141,25 @@ This buildfile is part of projectlombok.org. It sets up the build itself.
<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>
+ <macrodef name="fetchdep.ecj">
+ <attribute name="version" />
+ <sequential>
+ <ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="ecj@{version}" />
+ <ivy:retrieve symlink="true" />
+ <ivy:cachepath pathid="cp.ecj@{version}" conf="ecj@{version}" />
+ <property name="cp.ecj@{version}" refid="cp.ecj@{version}" />
+ </sequential>
+ </macrodef>
+
+ <macrodef name="fetchdep.eclipse">
+ <attribute name="version" />
+ <sequential>
+ <ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="eclipse-@{version}" />
+ <ivy:retrieve symlink="true" />
+ <ivy:cachepath pathid="cp.eclipse-@{version}" conf="eclipse-@{version}" />
+ <property name="cp.eclipse-@{version}" refid="cp.eclipse-@{version}" />
+ </sequential>
+ </macrodef>
<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" />
@@ -155,7 +169,6 @@ This buildfile is part of projectlombok.org. It sets up the build itself.
<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" />
diff --git a/src/support/lombok/eclipseCreate/CreateEclipseDebugTarget.java b/src/support/lombok/eclipseCreate/CreateEclipseDebugTarget.java
index d00524f7..f004f521 100644
--- a/src/support/lombok/eclipseCreate/CreateEclipseDebugTarget.java
+++ b/src/support/lombok/eclipseCreate/CreateEclipseDebugTarget.java
@@ -132,13 +132,13 @@ public class CreateEclipseDebugTarget {
if (!entry.getKey().startsWith("conf.")) continue;
launchContent.append(File.pathSeparator).append(entry.getValue());
}
- if (bootpath != null) launchContent.append(" -Ddelombok.bootclasspath=" + bootpath + "\"/>\n");
- launchContent.append("</launchConfiguration>\n");
+ if (bootpath != null) launchContent.append(" -Ddelombok.bootclasspath=" + bootpath);
+ launchContent.append("\"/>\n</launchConfiguration>\n");
}
private String getBootPath() {
String bp = args.get("bootpath");
- if (bp == null) return null;
+ if (bp == null || bp.isEmpty() || bp.equals("0")) return null;
File f = new File(bp);
if (!f.isAbsolute()) return bp;
String r = new File(".").getAbsolutePath();