Each module carries its output directory

This commit is contained in:
Andrey Breslav
2013-10-09 18:26:54 +04:00
parent 4d482f2f14
commit d4a89d04d7
26 changed files with 72 additions and 26 deletions
@@ -29,6 +29,9 @@ public interface ModuleDescription {
@NotNull
String getModuleName();
@NotNull
String getOutputDir();
@NotNull
List<String> getSourceFiles();
@@ -41,6 +44,7 @@ public interface ModuleDescription {
class Impl implements ModuleDescription {
private String name;
private String outputDir;
private final List<String> sources = new SmartList<String>();
private final List<String> classpath = new SmartList<String>();
private final List<String> annotations = new SmartList<String>();
@@ -49,6 +53,10 @@ public interface ModuleDescription {
this.name = name;
}
public void setOutputDir(String outputDir) {
this.outputDir = outputDir;
}
public void addSourcePath(String path) {
sources.add(path);
}
@@ -67,6 +75,12 @@ public interface ModuleDescription {
return name;
}
@NotNull
@Override
public String getOutputDir() {
return outputDir;
}
@NotNull
@Override
public List<String> getSourceFiles() {
@@ -87,7 +101,11 @@ public interface ModuleDescription {
@Override
public String toString() {
return name + "\n\tsources=" + sources + "\n\tclasspath=" + classpath + "\n\tannotations=" + annotations;
return name +
"\n\toutputDir=" + outputDir +
"\n\tsources=" + sources +
"\n\tclasspath=" + classpath +
"\n\tannotations=" + annotations;
}
}
}
@@ -39,6 +39,7 @@ public class ModuleXmlParser {
public static final String MODULES = "modules";
public static final String MODULE = "module";
public static final String NAME = "name";
public static final String OUTPUT_DIR = "outputDir";
public static final String SOURCES = "sources";
public static final String PATH = "path";
public static final String CLASSPATH = "classpath";
@@ -116,7 +117,7 @@ public class ModuleXmlParser {
throw createError(qName);
}
setCurrentState(new InsideModule(getAttribute(attributes, NAME, qName)));
setCurrentState(new InsideModule(getAttribute(attributes, NAME, qName), getAttribute(attributes, OUTPUT_DIR, qName)));
}
@Override
@@ -130,9 +131,10 @@ public class ModuleXmlParser {
private class InsideModule extends DefaultHandler {
private final ModuleDescription.Impl moduleDescription;
private InsideModule(String name) {
private InsideModule(String name, String outputDir) {
this.moduleDescription = new ModuleDescription.Impl();
this.moduleDescription.setName(name);
this.moduleDescription.setOutputDir(outputDir);
result.add(moduleDescription);
}