Upgrade Eclipse project settings for Java 8

- Set the eclipse.jdt source and target compatibility to 1.8 in
   ide.gradle.

 - Updated the instructions in import-into-eclipse.sh to reflect minimum
   requirements for building Spring Framework 4.1 against Java 8 with
   Eclipse and STS

Issue: SPR-11831
This commit is contained in:
Sam Brannen 2014-05-29 17:26:25 +02:00
parent 12a9df8a1c
commit d46b29e71f
2 changed files with 30 additions and 27 deletions

View File

@ -5,13 +5,13 @@ import org.gradle.plugins.ide.eclipse.model.SourceFolder
apply plugin: "propdeps-eclipse"
apply plugin: "propdeps-idea"
// Until eclipse fully supports Java 8 use 1.7 source level
eclipse.jdt {
sourceCompatibility = 1.7
targetCompatibility = 1.7
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
// Replace classpath entries with project dependencies (GRADLE-1116)
// http://issues.gradle.org/browse/GRADLE-1116
eclipse.classpath.file.whenMerged { classpath ->
def regexp = /.*?\/([^\/]+)\/build\/[^\/]+\/(?:main|test)/ // only match those that end in main or test (avoids removing necessary entries like build/classes/jaxb)
def projectOutputDependencies = classpath.entries.findAll { entry -> entry.path =~ regexp }

View File

@ -1,22 +1,25 @@
STS_TEST_VERSION='2.9.2.RELEASE'
cd `dirname $0`
clear
cat <<EOM
-----------------------------------------------------------------------
------------------------------------------------------------------------
Spring Framework Eclipse/STS project import guide
This script will guide you through the process of importing the
Spring Framework sources into Eclipse/STS. It is recommended that you
have a recent version of the SpringSource Tool Suite (this script has
been tested against STS $STS_TEST_VERSION), but at the minimum you will
need Eclipse + AJDT.
This script will guide you through the process of importing the Spring
Framework projects into Eclipse or the Spring Tool Suite (STS). It is
recommended that you have a recent version of Eclipse or STS with full
support for Java 8 (this script has been tested against Eclipse Luna
4.4 integration build I20140520-2000), but as a bare minimum you will
need Eclipse with Java 8 support, AJDT, and the Groovy Compiler.
If you need to download and install STS, please do that now by
visiting http://spring.io/tools/sts/all
If you need to download and install Eclipse or STS, please do that now
by visiting one of the following sites:
Otherwise, press enter and we'll begin.
Eclipse downloads: http://download.eclipse.org/eclipse/downloads/
STS downloads: http://spring.io/tools/sts/all
STS nightly builds: http://dist.springsource.com/snapshot/STS/nightly-distributions.html
Otherwise, press enter, and we'll begin.
EOM
read
@ -31,14 +34,14 @@ COMMAND="./gradlew cleanEclipse :spring-oxm:compileTestJava eclipse -x :eclipse"
cat <<EOM
-----------------------------------------------------------------------
------------------------------------------------------------------------
STEP 1: Generate subproject Eclipse metadata
The first step will be to generate Eclipse project metadata for each
of the spring-* subprojects. This happens via the built-in
"Gradle wrapper" script (./gradlew in this directory). If this is your
first time using the Gradle wrapper, this step may take a few minutes
while a Gradle distribution is downloaded for you.
The first step will be to generate Eclipse project metadata for each of
the spring-* subprojects. This happens via the built-in "Gradle
wrapper" script (./gradlew in this directory). If this is your first
time using the Gradle wrapper, this step may take a few minutes while a
Gradle distribution is downloaded for you.
The command run will be:
@ -53,7 +56,7 @@ $COMMAND || exit
cat <<EOM
-----------------------------------------------------------------------
------------------------------------------------------------------------
STEP 2: Import subprojects into Eclipse/STS
Within Eclipse/STS, do the following:
@ -73,13 +76,13 @@ COMMAND="./gradlew :eclipse"
cat <<EOM
-----------------------------------------------------------------------
------------------------------------------------------------------------
STEP 3: generate root project Eclipse metadata
Unfortunately, Eclipse does not allow for importing project
hierarchies, so we had to skip root project metadata generation in the
during step 1. In this step we simply generate root project metadata
so you can import it in the next step.
hierarchies, so we had to skip root project metadata generation during
step 1. In this step we simply generate root project metadata so you
can import it in the next step.
The command run will be:
@ -93,7 +96,7 @@ read
$COMMAND || exit
cat <<EOM
-----------------------------------------------------------------------
------------------------------------------------------------------------
STEP 4: Import root project into Eclipse/STS
Follow the project import steps listed in step 2 above to import the
@ -105,7 +108,7 @@ EOM
read
cat <<EOM
-----------------------------------------------------------------------
------------------------------------------------------------------------
STEP 5: Enable Git support for all projects
- In the Eclipse/STS Package Explorer, select all spring* projects.