diff options
-rw-r--r-- | build.xml | 33 | ||||
-rw-r--r-- | buildScripts/eclipse-run-tests.template | 2 |
2 files changed, 23 insertions, 12 deletions
@@ -278,8 +278,6 @@ the common tasks and can be called on to run the main aspects of all the sub-scr <os family="mac" /> </condition> - <property name="putJavacOnBootclasspath" value="-Xbootclasspath/p:lib/javac6/javac6.jar" /> - <copy file="buildScripts/eclipse-debug-target.template" tofile="LombokizedEclipse.launch" @@ -289,15 +287,6 @@ the common tasks and can be called on to run the main aspects of all the sub-scr <filter token="START_ON_FIRST_THREAD" value="${startOnFirstThread}" /> </filterset> </copy> - <copy - file="buildScripts/eclipse-run-tests.template" - tofile="RunLombokTests.launch" - preservelastmodified="true" - overwrite="true"> - <filterset> - <filter token="JAVAC_ON_BOOTCLASSPATH" value="${putJavacOnBootclasspath}" /> - </filterset> - </copy> </target> <target name="-test-compile" depends="ensureTestDeps, compile" unless="skipTests"> @@ -329,6 +318,24 @@ the common tasks and can be called on to run the main aspects of all the sub-scr <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="RT_LOCATION" value="${test.location.bootclasspath}" /> + </filterset> + </copy> </target> <target name="setupJava6TestEnvironment" description="Sets up the test so that 'ant test' will test against OpenJDK6."> @@ -338,8 +345,10 @@ the common tasks and can be called on to run the main aspects of all the sub-scr <propertyfile file="testenvironment.properties"> <entry key="test.location.javac" value="lib/openJDK6Environment/javac6.jar" /> <entry key="test.location.bootclasspath" value="lib/openJDK6Environment/rt-openjdk6.jar" /> + <entry key="test.location.name" value="OpenJDK6" /> </propertyfile> <echo>Tests will now run against OpenJDK6</echo> + <antcall target="-createEclipseLaunchForTestEnvironmentIfEclipseProject" /> </target> <target name="setupJava7TestEnvironment" description="Sets up the test so that 'ant test' will test against OpenJDK7."> @@ -349,8 +358,10 @@ the common tasks and can be called on to run the main aspects of all the sub-scr <propertyfile file="testenvironment.properties"> <entry key="test.location.javac" value="lib/openJDK7Environment/javac7.jar" /> <entry key="test.location.bootclasspath" value="lib/openJDK7Environment/rt-openjdk7.jar" /> + <entry key="test.location.name" value="OpenJDK7" /> </propertyfile> <echo>Tests will now run against OpenJDK7</echo> + <antcall target="-createEclipseLaunchForTestEnvironmentIfEclipseProject" /> </target> <target name="-failIfNoTestEnvironmentProperties" unless="test.location.javac"> diff --git a/buildScripts/eclipse-run-tests.template b/buildScripts/eclipse-run-tests.template index 4296d372..1e23baa0 100644 --- a/buildScripts/eclipse-run-tests.template +++ b/buildScripts/eclipse-run-tests.template @@ -15,5 +15,5 @@ <stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/> <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 @JAVAC_ON_BOOTCLASSPATH@"/> +<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-javaagent:dist/lombok.jar -Xbootclasspath/p:@JAVAC_LOCATION@ -Ddelombok.bootclasspath=@RT_LOCATION@"/> </launchConfiguration> |