jps: added method to get languageLevel for module

This commit is contained in:
nik
2011-10-14 17:07:58 +04:00
parent 40bc6d8881
commit 43e2c83073
4 changed files with 10 additions and 6 deletions
@@ -24,6 +24,8 @@ class Module extends LazyInitializeableObject implements ClasspathItem {//}, Com
Map<String, String> sourceRootPrefixes = [:]
Map<String, Library> libraries = [:]
String languageLevel
/*int compareTo(Object o) {
if (o instanceof Module) {
((Module) o).name.compareTo(name);
@@ -69,6 +69,10 @@ class ModuleChunk extends DagNode<Module> {
return representativeModule().project
}
def String getLanguageLevel() {
return representativeModule().languageLevel
}
public Module representativeModule() {
return elements.iterator().next()
}
@@ -197,7 +197,7 @@ public class IdeaProjectLoader {
configuration.javacOptions.putAll(loadOptions(getComponent(root, "JavacSettings")))
def annotationProcessingTag = componentTag.annotationProcessing
def annotationProcessingTag = componentTag?.annotationProcessing
if (annotationProcessingTag != null) {
configuration.annotationProcessing.enabled = parseBoolean(annotationProcessingTag."@enabled", false)
configuration.annotationProcessing.obtainProcessorsFromClasspath = parseBoolean(annotationProcessingTag."@useClasspath", true)
@@ -471,9 +471,7 @@ public class IdeaProjectLoader {
languageLevel = projectLanguageLevel
}
if (languageLevel != null) {
def ll = convertLanguageLevel(languageLevel)
currentModule["sourceLevel"] = ll
currentModule["targetLevel"] = ll
currentModule.languageLevel = convertLanguageLevel(languageLevel)
}
if (srcFolderExists) {
@@ -27,8 +27,8 @@ class JavacBuilder implements ModuleBuilder, ModuleCycleBuilder {
def doBuildModule(ModuleChunk module, ModuleBuildState state, ProjectBuilder projectBuilder) {
if (state.sourceRoots.isEmpty()) return;
String sourceLevel = module["sourceLevel"]
String targetLevel = module["targetLevel"]
String sourceLevel = module.languageLevel
String targetLevel = module.languageLevel
String customArgs = module["javac_args"]; // it seems javac_args property is not set, can we drop it?
if (projectBuilder.useInProcessJavac) {
String version = System.getProperty("java.version")