diff options
author | aclement <aclement> | 2009-01-31 01:11:55 +0000 |
---|---|---|
committer | aclement <aclement> | 2009-01-31 01:11:55 +0000 |
commit | e2b4f22f7be28b18443280fb05966aba44d3c384 (patch) | |
tree | 643374bb1e5b0447b843794f5d527107af57b7aa /org.aspectj.ajdt.core | |
parent | 690015d703ba9bb16993c0d5b827d1bbf9333bcd (diff) | |
download | aspectj-e2b4f22f7be28b18443280fb05966aba44d3c384.tar.gz aspectj-e2b4f22f7be28b18443280fb05966aba44d3c384.zip |
124460: allows .xml files mixed in with source files on command line
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r-- | org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java | 5 | ||||
-rw-r--r-- | org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/ConfigParser.java | 25 |
2 files changed, 28 insertions, 2 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java index fb270f5b5..3b7a77905 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/BuildArgParser.java @@ -144,6 +144,9 @@ public class BuildArgParser extends Main { 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)) { @@ -179,6 +182,8 @@ public class BuildArgParser extends Main { } } + buildConfig.setXmlFiles(xmlfileList); + buildConfig.setFiles(fileList); if (destinationPath != null) { // XXX ?? unparsed but set? buildConfig.setOutputDir(new File(destinationPath)); diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/ConfigParser.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/ConfigParser.java index f6d33b14a..8ab62e231 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/ConfigParser.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/ConfigParser.java @@ -18,6 +18,7 @@ import java.io.File; import java.io.FileFilter; import java.io.FileReader; import java.io.IOException; +import java.util.ArrayList; import java.util.LinkedList; import java.util.List; @@ -25,6 +26,7 @@ public class ConfigParser { 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: "; @@ -32,6 +34,10 @@ public class ConfigParser { return files; } + public List getXmlFiles() { + return xmlfiles; + } + public void parseCommandLine(String[] argsArray) throws ParseException { location = new CommandLineLocation(); LinkedList args = new LinkedList(); @@ -100,7 +106,7 @@ public class ConfigParser { 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); @@ -116,10 +122,16 @@ public class ConfigParser { 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")) { @@ -197,6 +209,13 @@ public class ConfigParser { 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; @@ -219,6 +238,8 @@ public class ConfigParser { parseConfigFileHelper(makeFile(removeArg(args).getValue())); } else if (isSourceFileName(v)) { addFileOrPattern(makeFile(v)); + } else if (isXml(v)) { + addXmlFile(makeFile(v)); } else { parseOption(arg.getValue(), args); } |