Updated the setup test environment tasks in the build script to produce eclipse launch targets IF the project has been treated as eclipse project ('.project' is present).

This commit is contained in:
Reinier Zwitserloot committed 2012-10-25 00:05:02 +02:00
1 parent 7d78e45128
commit 2d21611898
2 files changed
+23 -12

No files matched your search

+22 -11
View File
@@ -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">
+1 -1
View File
@@ -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>