diff options
author | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2020-07-23 23:40:33 +0200 |
---|---|---|
committer | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2020-07-23 23:40:33 +0200 |
commit | 2f397d7c95424469b8d1049442765031baf7f878 (patch) | |
tree | 644b98d5ba096b625ca7611d5758a640ac862c8c | |
parent | c00317220523c42ae0cc459fa3526c641e37f2af (diff) | |
download | lombok-2f397d7c95424469b8d1049442765031baf7f878.tar.gz lombok-2f397d7c95424469b8d1049442765031baf7f878.tar.bz2 lombok-2f397d7c95424469b8d1049442765031baf7f878.zip |
[tests] only add agent VM args for ECJ/Eclipse tests
-rw-r--r-- | buildScripts/create-eclipse-project.ant.xml | 3 | ||||
-rw-r--r-- | src/support/lombok/eclipseCreate/CreateEclipseDebugTarget.java | 13 |
2 files changed, 11 insertions, 5 deletions
diff --git a/buildScripts/create-eclipse-project.ant.xml b/buildScripts/create-eclipse-project.ant.xml index 67eff3bc..513ffe8f 100644 --- a/buildScripts/create-eclipse-project.ant.xml +++ b/buildScripts/create-eclipse-project.ant.xml @@ -82,6 +82,7 @@ This buildfile is part of projectlombok.org. It creates the infrastructure neede </classpath> <arg value="name=Lombok-test Eclipse-202006" /> <arg value="testType=lombok.TestEclipse" /> + <arg value="shadowLoaderBased" /> <arg value="jvmTarget=1.8" /> <arg value="bootpath=${jdk8-rt.loc}" /> <arg value="conf.test=${cp.test}" /> @@ -163,6 +164,7 @@ This buildfile is part of projectlombok.org. It creates the infrastructure neede </classpath> <arg value="name=Lombok-test Eclipse-${inputs.eclipsetarget}" /> <arg value="testType=lombok.TestEclipse" /> + <arg value="shadowLoaderBased" /> <arg value="jvmTarget=${inputs.jvmtarget}" /> <arg value="bootpath=${inputs.bootpath}" /> <arg value="conf.test=${cp.test}" /> @@ -198,6 +200,7 @@ This buildfile is part of projectlombok.org. It creates the infrastructure neede </classpath> <arg value="name=Lombok-test ECJ${inputs.ecjtarget}" /> <arg value="testType=lombok.TestEclipse" /> + <arg value="shadowLoaderBased" /> <arg value="jvmTarget=${inputs.jvmtarget}" /> <arg value="bootpath=${inputs.bootpath}" /> <arg value="conf.test=${cp.test}" /> diff --git a/src/support/lombok/eclipseCreate/CreateEclipseDebugTarget.java b/src/support/lombok/eclipseCreate/CreateEclipseDebugTarget.java index f004f521..e5e48c49 100644 --- a/src/support/lombok/eclipseCreate/CreateEclipseDebugTarget.java +++ b/src/support/lombok/eclipseCreate/CreateEclipseDebugTarget.java @@ -127,12 +127,14 @@ public class CreateEclipseDebugTarget { 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()); + if (getArgBoolean("shadowLoaderBased")) { + 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()); + } + if (bootpath != null) launchContent.append(" -Ddelombok.bootclasspath=" + bootpath); } - if (bootpath != null) launchContent.append(" -Ddelombok.bootclasspath=" + bootpath); launchContent.append("\"/>\n</launchConfiguration>\n"); } @@ -164,6 +166,7 @@ public class CreateEclipseDebugTarget { 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" + + " shadowLoaderBased # Add the VM options to use lombok as an agent and pass the classpath to the shadow loader. Needed for ECJ/Eclipse.\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" + ""); |