boolean incrementalMode = buildConfig.isIncrementalMode() || buildConfig.isIncrementalFileMode();
+ List xmlfileList = new ArrayList();
+ xmlfileList.addAll(parser.getXmlFiles());
+
List fileList = new ArrayList();
List files = parser.getFiles();
if (!LangUtil.isEmpty(files)) {
}
}
+ buildConfig.setXmlFiles(xmlfileList);
+
buildConfig.setFiles(fileList);
if (destinationPath != null) { // XXX ?? unparsed but set?
buildConfig.setOutputDir(new File(destinationPath));
import java.io.FileFilter;
import java.io.FileReader;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
Location location;
protected File relativeDirectory = null;
protected List files = new LinkedList();
+ protected List xmlfiles = new ArrayList();
private boolean fileParsed = false;
protected static String CONFIG_MSG = "build config error: ";
return files;
}
+ public List getXmlFiles() {
+ return xmlfiles;
+ }
+
public void parseCommandLine(String[] argsArray) throws ParseException {
location = new CommandLineLocation();
LinkedList args = new LinkedList();
s = stripSingleLineComment(s, "#");
s = s.trim();
if (s.startsWith("\"") && s.endsWith("\"")) {
- if (s.length()==1) {
+ if (s.length() == 1) {
return "";
} else {
s = s.substring(1, s.length() - 1);
if (!sourceFile.isFile()) {
showError("source file does not exist: " + sourceFile.getPath());
}
-
files.add(sourceFile);
}
+ protected void addXmlFile(File xmlFile) {
+ if (!xmlFile.isFile()) {
+ showError("XML file does not exist: " + xmlFile.getPath());
+ }
+ xmlfiles.add(xmlFile);
+ }
+
void addFileOrPattern(File sourceFile) {
if (sourceFile.getName().charAt(0) == '*') {
if (sourceFile.getName().equals("*.java")) {
return arg.getValue();
}
+ /**
+ * aop.xml configuration files can be passed on the command line.
+ */
+ boolean isXml(String s) {
+ return s.endsWith(".xml");
+ }
+
boolean isSourceFileName(String s) {
if (s.endsWith(".java"))
return true;
parseConfigFileHelper(makeFile(removeArg(args).getValue()));
} else if (isSourceFileName(v)) {
addFileOrPattern(makeFile(v));
+ } else if (isXml(v)) {
+ addXmlFile(makeFile(v));
} else {
parseOption(arg.getValue(), args);
}