aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim O'Brien2011-08-03 15:09:24 (EDT)
committerIgor Fedorenko2011-08-03 21:46:45 (EDT)
commit691af24c2b882426c1c544d213d481e2c0276d69 (patch)
tree578a85364b3a642e710887a2b03a4f7bbf3ba6c1
parent2a4d50d406dfbdfb18a02680276cbe8d87b47b92 (diff)
downloadm2e-core-691af24c2b882426c1c544d213d481e2c0276d69.zip
m2e-core-691af24c2b882426c1c544d213d481e2c0276d69.tar.gz
m2e-core-691af24c2b882426c1c544d213d481e2c0276d69.tar.bz2
Adding logic to AbstractJavaProjectConfigurator to address compiler flag synonyms for source and target
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java29
1 files changed, 27 insertions, 2 deletions
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java
index e5076f9..d3d4a81 100644
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java
+++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java
@@ -73,9 +73,9 @@ public abstract class AbstractJavaProjectConfigurator extends AbstractProjectCon
public static final String COMPILER_PLUGIN_GROUP_ID = "org.apache.maven.plugins";
- protected static final List<String> SOURCES = Arrays.asList("1.1,1.2,1.3,1.4,1.5,1.6,1.7".split(",")); //$NON-NLS-1$ //$NON-NLS-2$
+ protected static final List<String> SOURCES = Arrays.asList("1.1,1.2,1.3,1.4,1.5,5,1.6,6,1.7,7".split(",")); //$NON-NLS-1$ //$NON-NLS-2$
- protected static final List<String> TARGETS = Arrays.asList("1.1,1.2,1.3,1.4,jsr14,1.5,1.6,1.7".split(",")); //$NON-NLS-1$ //$NON-NLS-2$
+ protected static final List<String> TARGETS = Arrays.asList("1.1,1.2,1.3,1.4,jsr14,1.5,5,1.6,6,1.7,7".split(",")); //$NON-NLS-1$ //$NON-NLS-2$
private static final String GOAL_RESOURCES = "resources";
@@ -437,6 +437,31 @@ public abstract class AbstractJavaProjectConfigurator extends AbstractProjectCon
log.warn("Could not determine target level, using default " + target);
}
+ // While "5" and "6" are valid synonyms for Java 5 and Java 6 source,
+ // Eclipse expects the values 1.5 and 1.6.
+ if( source.equals("5") ) {
+ source = "1.5";
+ }
+ if( source.equals("6") ) {
+ source = "1.6";
+ }
+ if( source.equals("7") ) {
+ source = "1.7";
+ }
+
+
+ // While "5" and "6" are valid synonyms for Java 5 and Java 6 target,
+ // Eclipse expects the values 1.5 and 1.6.
+ if( target.equals("5") ) {
+ target = "1.5";
+ }
+ if( target.equals("6") ) {
+ target = "1.6";
+ }
+ if( target.equals("7") ) {
+ target = "1.7";
+ }
+
options.put(JavaCore.COMPILER_SOURCE, source);
options.put(JavaCore.COMPILER_COMPLIANCE, source);
options.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, target);