Loading descriptors from incremental cache instead of package classes.
This commit is contained in:
+15
@@ -18,6 +18,7 @@ package org.jetbrains.jet.cli.common.modules;
|
||||
|
||||
import com.intellij.util.SmartList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -41,6 +42,9 @@ public interface ModuleDescription {
|
||||
@NotNull
|
||||
List<String> getAnnotationsRoots();
|
||||
|
||||
@Nullable
|
||||
String getIncrementalCacheDir();
|
||||
|
||||
class Impl implements ModuleDescription {
|
||||
|
||||
private String name;
|
||||
@@ -48,6 +52,7 @@ public interface ModuleDescription {
|
||||
private final List<String> sources = new SmartList<String>();
|
||||
private final List<String> classpath = new SmartList<String>();
|
||||
private final List<String> annotations = new SmartList<String>();
|
||||
private String incrementalCacheDir;
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
@@ -69,6 +74,10 @@ public interface ModuleDescription {
|
||||
annotations.add(path);
|
||||
}
|
||||
|
||||
public void setIncrementalCacheDir(String incrementalCacheDir) {
|
||||
this.incrementalCacheDir = incrementalCacheDir;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getModuleName() {
|
||||
@@ -99,6 +108,12 @@ public interface ModuleDescription {
|
||||
return annotations;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getIncrementalCacheDir() {
|
||||
return incrementalCacheDir;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name +
|
||||
|
||||
+8
-2
@@ -40,6 +40,7 @@ public class ModuleXmlParser {
|
||||
public static final String MODULE = "module";
|
||||
public static final String NAME = "name";
|
||||
public static final String OUTPUT_DIR = "outputDir";
|
||||
public static final String INCREMENTAL_CACHE = "incrementalCache";
|
||||
public static final String SOURCES = "sources";
|
||||
public static final String PATH = "path";
|
||||
public static final String CLASSPATH = "classpath";
|
||||
@@ -117,7 +118,11 @@ public class ModuleXmlParser {
|
||||
throw createError(qName);
|
||||
}
|
||||
|
||||
setCurrentState(new InsideModule(getAttribute(attributes, NAME, qName), getAttribute(attributes, OUTPUT_DIR, qName)));
|
||||
setCurrentState(new InsideModule(
|
||||
getAttribute(attributes, NAME, qName),
|
||||
getAttribute(attributes, OUTPUT_DIR, qName),
|
||||
attributes.getValue(INCREMENTAL_CACHE)
|
||||
));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -131,10 +136,11 @@ public class ModuleXmlParser {
|
||||
private class InsideModule extends DefaultHandler {
|
||||
|
||||
private final ModuleDescription.Impl moduleDescription;
|
||||
private InsideModule(String name, String outputDir) {
|
||||
private InsideModule(String name, String outputDir, String incrementalCacheDir) {
|
||||
this.moduleDescription = new ModuleDescription.Impl();
|
||||
this.moduleDescription.setName(name);
|
||||
this.moduleDescription.setOutputDir(outputDir);
|
||||
this.moduleDescription.setIncrementalCacheDir(incrementalCacheDir);
|
||||
result.add(moduleDescription);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user