From 92d0049be5785ab552e40ffc6a07fa5568fc18b4 Mon Sep 17 00:00:00 2001 From: wisberg Date: Mon, 8 Mar 2004 19:13:03 +0000 Subject: [PATCH] -xlintfile option support --- .../testing/harness/bridge/CompilerRun.java | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/testing/src/org/aspectj/testing/harness/bridge/CompilerRun.java b/testing/src/org/aspectj/testing/harness/bridge/CompilerRun.java index 084c17c7a..9241d103e 100644 --- a/testing/src/org/aspectj/testing/harness/bridge/CompilerRun.java +++ b/testing/src/org/aspectj/testing/harness/bridge/CompilerRun.java @@ -229,13 +229,17 @@ public class CompilerRun implements IAjcRun { FileUtil.getBaseDirFiles(testBaseSrcDir, spec.extdirs); final File[] classFiles = FileUtil.getBaseDirFiles(testBaseSrcDir, spec.classpath); + final File[] xlintFiles = (null == spec.xlintfile ? new File[0] + : FileUtil.getBaseDirFiles(testBaseSrcDir, new String[] {spec.xlintfile})); + // hmm - duplicates validation above, verifying getBaseDirFiles? if (!spec.badInput) { if (!validator.canRead(argFiles, "argFiles") || !validator.canRead(injarFiles, "injarFiles") || !validator.canRead(inpathFiles, "inpathFiles") || !validator.canRead(aspectFiles, "aspectFiles") - || !validator.canRead(classFiles, "classFiles")) { + || !validator.canRead(classFiles, "classFiles") + || !validator.canRead(xlintFiles, "xlintFiles")) { return false; } } @@ -277,12 +281,12 @@ public class CompilerRun implements IAjcRun { spec.sourceroots, sandbox.stagingDir); // delete incremental files in sourceroot after copying // XXX inefficient + // an incremental file has an extra "." in name + // most .java files don't, because they are named after + // the principle type they contain, and simple type names + // have no dots. FileFilter pickIncFiles = new FileFilter() { - // an incremental file has an extra "." in name - // most .java files don't, because they are named after - // the principle type they contain, and simple type names - // have no dots. - public boolean accept(File file) { + public boolean accept(File file) { if (file.isDirectory()) { // continue recursion return true; @@ -327,6 +331,11 @@ public class CompilerRun implements IAjcRun { } arguments.clear(); + if (!LangUtil.isEmpty(xlintFiles)) { + arguments.add("-Xlintfile"); + String sr = FileUtil.flatten(xlintFiles, null); + arguments.add(sr); + } if (!LangUtil.isEmpty(extdirFiles)) { arguments.add("-extdirs"); String sr = FileUtil.flatten(extdirFiles, null); @@ -718,6 +727,7 @@ public class CompilerRun implements IAjcRun { /** src path = {suiteParentDir}/{testBaseDirOffset}/{testSrcDirOffset}/{path} */ protected String testSrcDirOffset; + protected String xlintfile; public Spec() { super(XMLNAME); @@ -816,6 +826,9 @@ public class CompilerRun implements IAjcRun { sourceroots = XMLWriter.unflattenList(dirs); } } + public void setXlintfile(String path) { + xlintfile = path; + } /** * Set extension dirs, deleting any old ones -- 2.39.5