diff options
author | acolyer <acolyer> | 2003-11-11 13:09:14 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2003-11-11 13:09:14 +0000 |
commit | 1c6db5d4f24f6ddaee4c48661503a8b7ea516744 (patch) | |
tree | 776e942fa9f0bd7ed54a717e7227f8e9a3716480 /org.aspectj.ajdt.core | |
parent | 8c70c5a515a383e0691eeb3a9bc1caa66a0398b5 (diff) | |
download | aspectj-1c6db5d4f24f6ddaee4c48661503a8b7ea516744.tar.gz aspectj-1c6db5d4f24f6ddaee4c48661503a8b7ea516744.zip |
Andy Clement's patch for enh 46347: "-inpath"
Diffstat (limited to 'org.aspectj.ajdt.core')
5 files changed, 52 insertions, 5 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 0fae2686a..7f08a1f9d 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 @@ -297,6 +297,29 @@ public class BuildArgParser extends Main { // trim arg? if (LangUtil.isEmpty(arg)) { showWarning("empty arg found"); + } else if (arg.equals("-inpath")) {; + if (args.size() > nextArgIndex) { + buildConfig.getAjOptions().put(AjCompilerOptions.OPTION_Inpath, CompilerOptions.PRESERVE); + + StringTokenizer st = new StringTokenizer( + ((ConfigParser.Arg)args.get(nextArgIndex)).getValue(), + File.pathSeparator); + while (st.hasMoreTokens()) { + String filename = st.nextToken(); + File file = makeFile(filename); + if (file.exists() && FileUtil.hasZipSuffix(filename)) { + buildConfig.getInpath().add(file); + } else { + if (file.isDirectory()) { + buildConfig.getInpath().add(file); + } else + + showError("bad inpath component: " + filename); + } + } + + args.remove(args.get(nextArgIndex)); + } } else if (arg.equals("-injars")) {; if (args.size() > nextArgIndex) { buildConfig.getAjOptions().put(AjCompilerOptions.OPTION_InJARs, CompilerOptions.PRESERVE); @@ -310,6 +333,11 @@ public class BuildArgParser extends Main { if (jarFile.exists() && FileUtil.hasZipSuffix(filename)) { buildConfig.getInJars().add(jarFile); } else { + File dirFile = makeFile(filename); + if (dirFile.isDirectory()) { + buildConfig.getInJars().add(dirFile); + } else + showError("bad injar: " + filename); } } diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/messages.properties b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/messages.properties index dcaad7781..cb6f71434 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/messages.properties +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/messages.properties @@ -15,6 +15,8 @@ misc.usage = AspectJ Compiler 1.1\n\ AspectJ-specific options:\n\ \t-injars <jarList> use classes in <jarList> zip files as source\n\ \t (<jarList> uses classpath delimiter)\n\ +\t-inpath <list> use classes in <list> as source\n\ +\t (<list> uses platform-specific path delimiter)\n\ \t-aspectpath <list> weave aspects from <list> zip files into sources\n\ \t (<list> uses classpath delimiter)\n\ \t-outjar <file> put output classes in zip file <file>\n\ diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java index 7eedd3e1c..029e7fd43 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java @@ -41,6 +41,7 @@ public class AjBuildConfig { // XXX needs bootclasspath? private List/*File*/ sourceRoots = new ArrayList(); private List/*File*/ files = new ArrayList(); private List/*File*/ inJars = new ArrayList(); + private List/*File*/ inPath = new ArrayList(); private Map/*String->File*/ sourcePathResources = new HashMap(); private List/*File*/ aspectpath = new ArrayList(); private List/*String*/ classpath = new ArrayList(); @@ -189,6 +190,11 @@ public class AjBuildConfig { // XXX needs bootclasspath? public File getOutputJar() { return outputJar; } + + public List/*File*/ getInpath() { + // Elements of the list are either archives (jars/zips) or directories + return inPath; + } public List/*File*/ getInJars() { return inJars; @@ -255,15 +261,18 @@ public class AjBuildConfig { // XXX needs bootclasspath? } /** - * @return List (String) classpath of injars, aspectpath entries, - * specified classpath (bootclasspath, extdirs, and classpath), - * and output dir or jar + * @return List (String) classpath of injars, inpath, aspectpath + * entries, specified classpath (bootclasspath, extdirs, and + * classpath), and output dir or jar */ public List getFullClasspath() { List full = new ArrayList(); for (Iterator i = inJars.iterator(); i.hasNext(); ) { full.add(((File)i.next()).getAbsolutePath()); } + for (Iterator i = inPath.iterator();i.hasNext();) { + full.add(((File)i.next()).getAbsolutePath()); + } for (Iterator i = aspectpath.iterator(); i.hasNext(); ) { full.add(((File)i.next()).getAbsolutePath()); } @@ -324,12 +333,13 @@ public class AjBuildConfig { // XXX needs bootclasspath? XnoInline = xnoInline; } - /** @return true if any config file, sourceroots, sourcefiles, or injars */ + /** @return true if any config file, sourceroots, sourcefiles, injars or inpath */ public boolean hasSources() { return ((null != configFile) || (0 < sourceRoots.size()) || (0 < files.size()) || (0 < inJars.size()) + || (0 < inPath.size()) ); } @@ -377,6 +387,7 @@ public class AjBuildConfig { // XXX needs bootclasspath? incrementalMode = true; } join(inJars, global.inJars); + join(inPath, global.inPath); join(javaOptions, global.javaOptions); if ((null == lintMode) || (AJLINT_DEFAULT.equals(lintMode))) { diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java index bada76650..fb763ff6b 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java @@ -209,7 +209,12 @@ public class AjBuildManager { //??? incremental issues for (Iterator i = buildConfig.getInJars().iterator(); i.hasNext(); ) { File inJar = (File)i.next(); - bcelWeaver.addJarFile(inJar, buildConfig.getOutputDir()); + bcelWeaver.addJarFile(inJar, buildConfig.getOutputDir(),false); + } + + for (Iterator i = buildConfig.getInpath().iterator(); i.hasNext(); ) { + File inPathElement = (File)i.next(); + bcelWeaver.addJarFile(inPathElement,buildConfig.getOutputDir(),true); } if (buildConfig.getSourcePathResources() != null) { diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjCompilerOptions.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjCompilerOptions.java index 65769fe10..dcc1b7e8c 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjCompilerOptions.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjCompilerOptions.java @@ -22,6 +22,7 @@ public class AjCompilerOptions { public static final String OPTION_Xlint = "org.aspectj.ajdt.core.compiler.Xlint"; public static final String OPTION_InJARs = "org.aspectj.ajdt.core.compiler.injars"; public static final String OPTION_OutJAR = "org.aspectj.ajdt.core.compiler.outjar"; + public static final String OPTION_Inpath = "org.aspectj.ajdt.core.compiler.inpath"; } |