<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="src" path="/asm"/>
- <classpathentry kind="src" path="/org.aspectj.ajdt.core"/>
- <classpathentry kind="src" path="/bridge"/>
- <classpathentry kind="src" path="/util"/>
- <classpathentry kind="lib" path="C:/Apps/j2sdk1.4.2/lib/tools.jar"/>
- <classpathentry kind="src" path="testsrc"/>
- <classpathentry kind="lib" path="/lib/junit/junit.jar" sourcepath="/lib/junit/junit-src.jar"/>
- <classpathentry kind="output" path="bin"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="src" path="/asm"/>
+ <classpathentry kind="src" path="/org.aspectj.ajdt.core"/>
+ <classpathentry kind="src" path="/bridge"/>
+ <classpathentry kind="src" path="/util"/>
+ <classpathentry sourcepath="C:/Apps/j2sdk1.4.2/src.zip" kind="lib" path="C:/Apps/j2sdk1.4.2/lib/tools.jar"/>
+ <classpathentry kind="src" path="testsrc"/>
+ <classpathentry sourcepath="/lib/junit/junit-src.jar" kind="lib" path="/lib/junit/junit.jar"/>
+ <classpathentry kind="output" path="bin"/>
</classpath>
}
for (int i = 0; i < filenames.size(); i++) {
- inputFiles[i] = findFile((String)filenames.elementAt(i));
+ inputFiles[i] = new File((String)filenames.elementAt(i));
//signatureFiles[i] = createSignatureFile(inputFiles[i]);
}
javadocargs[k] = (String)options.elementAt(k);
}
for (int k = 0; k < signatureFiles.length; k++) {
- javadocargs[options.size() + k] = signatureFiles[k].getCanonicalPath();
+ javadocargs[options.size() + k] = StructureUtil.translateAjPathName(signatureFiles[k].getCanonicalPath());
}
}
}
}
- /**
- * If the file doesn't exist on the specified path look for it in all the other
- * paths specified by the "sourcepath" option.
- */
- static File findFile( String filename ) throws IOException {
-
- return new File( filename );
- /*
- File file = new File(filename);
- if (file.exists()) {
- return file;
- }
- else {
- for ( int i = 0; i < sourcePath.size(); i++ ) {
- File currPath = new File((String)sourcePath.elementAt(i));
- File currFile = new File(currPath + "/" + filename); // !!!
- if ( file.exists()) {
- return file;
- }
- }
- }
- throw new IOException("couldn't find source file: " + filename);
- */
- }
-
static Vector getSourcePath() {
Vector sourcePath = new Vector();
boolean found = false;
System.err.println("> could not read arg file: " + argFile);
ioe.printStackTrace();
}
-
-
}
List vargs = new LinkedList(Arrays.asList(args));
displayHelpAndExit( null );
}
for (int i = 0; i < vargs.size() ; i++) {
- String arg = (String)vargs.get(i);
+ String arg = (String)vargs.get(i);
ignoreArg = false;
if ( addNextToAJCOptions ) {
ajcOptions.addElement( arg );
// check if this is a file or a package
// System.err.println(">>>>>>>> " + );
String entryName = arg.substring(arg.lastIndexOf(File.separator)+1);
- if ((arg.endsWith(".java") && entryName.indexOf('.') == entryName.length()-5) ||
- arg.endsWith(".lst") &&
- arg != null ) {
+ if ((arg.endsWith(".java") && entryName.indexOf('.') == entryName.length()-5)
+ || (arg.endsWith(".aj") && entryName.indexOf('.') == entryName.length()-3)
+ || arg.endsWith(".lst")
+ && arg != null ) {
File f = new File(arg);
if (f.isAbsolute()) {
filenames.addElement(arg);
int index1 = name.lastIndexOf( "." );
int index2 = name.length();
if ( (index1 >= 0 && index2 >= 0 ) &&
- (name.substring(index1, index2).equals( ".java" ) ) ) {
+ (name.substring(index1, index2).equals( ".java" )
+ || name.substring(index1, index2).equals( ".aj" ))) {
return true;
}
else {
!options.contains( "-protected" ) &&
!options.contains( "-public" ) ) {
options.addElement( "-package" );
- }
-
+ }
}
static void expandAtSignFile(String filename, File currentWorkingDir) {
// return false;
// }
}
+
+ /**
+ * @return same path, but ending in ".java" instead of ".aj"
+ */
+ public static String translateAjPathName(String path) {
+ if (path.endsWith(".aj")) {
+ path = path.substring(0, path.lastIndexOf(".aj")) + ".java";
+ }
+ return path;
+ }
}
static void processFile(SymbolManager symbolManager, File inputFile, File signatureFile) {
try {
- PrintWriter writer = new PrintWriter(new BufferedWriter(new FileWriter(signatureFile.getCanonicalPath())));
-
+ String path = StructureUtil.translateAjPathName(signatureFile.getCanonicalPath());
+ PrintWriter writer = new PrintWriter(new BufferedWriter(new FileWriter(path)));
+
String packageName = StructureUtil.getPackageDeclarationFromFile(inputFile);
if (packageName != null ) {
--- /dev/null
+\r
+package foo;\r
+\r
+import fluffy.*;\r
+import fluffy.bunny.*;\r
+import fluffy.bunny.rocks.*;\r
+\r
+public aspect UseThisAspectForLinkCheck {\r
+ \r
+ int foo;\r
+ \r
+ pointcut allExecutions(): execution(* *..*(..));\r
+ \r
+ before(): allExecutions() {\r
+ System.err.println("yo");\r
+ }\r
+ \r
+ after(): allExecutions() {\r
+ System.err.println("go");\r
+ }\r
+}
\ No newline at end of file
+++ /dev/null
-
-package foo;
-
-import fluffy.*;
-import fluffy.bunny.*;
-import fluffy.bunny.rocks.*;
-
-public aspect UseThisAspectForLinkCheck {
-
- int foo;
-
- pointcut allExecutions(): execution(* *..*(..));
-
- before(): allExecutions() {
- System.err.println("yo");
- }
-
- after(): allExecutions() {
- System.err.println("go");
- }
-}
\ No newline at end of file
// System.err.println(new File("testdata/figures-demo").exists());
File file1 = new File("testdata/coverage/foo/ClassA.java");
- File aspect1 = new File("testdata/coverage/foo/UseThisAspectForLinkCheck.java");
+ File aspect1 = new File("testdata/coverage/foo/UseThisAspectForLinkCheck.aj");
File file2 = new File("testdata/coverage/foo/InterfaceI.java");
File file3 = new File("testdata/coverage/foo/PlainJava.java");
File file4 = new File("testdata/coverage/foo/ModelCoverage.java");
File file7 = new File("testdata/coverage/fluffy/bunny/rocks/Rocks.java");
File file8 = new File("testdata/coverage/fluffy/bunny/rocks/UseThisAspectForLinkCheckToo.java");
File outdir = new File("testdata/coverage/doc");
-
+
String[] args = {
// "-XajdocDebug",
"-source",
"-private",
"-d",
outdir.getAbsolutePath(),
- aspect1.getAbsolutePath(),
+ aspect1.getAbsolutePath(),
file1.getAbsolutePath(),
file2.getAbsolutePath(),
file3.getAbsolutePath(),