aboutsummaryrefslogtreecommitdiffstats
path: root/ajdoc/src
diff options
context:
space:
mode:
authormkersten <mkersten>2004-06-24 22:11:53 +0000
committermkersten <mkersten>2004-06-24 22:11:53 +0000
commit3707411c2b5fdd0294c2ab5305c32766644241f1 (patch)
tree773bb0184274fe5bb1d0e00005794222dba57068 /ajdoc/src
parent2489444ba5813cb1f3409eab9d04aa73f1bb3939 (diff)
downloadaspectj-3707411c2b5fdd0294c2ab5305c32766644241f1.tar.gz
aspectj-3707411c2b5fdd0294c2ab5305c32766644241f1.zip
Fixed: 68494 ajdoc does not support .aj files
Diffstat (limited to 'ajdoc/src')
-rw-r--r--ajdoc/src/org/aspectj/tools/ajdoc/Main.java46
-rw-r--r--ajdoc/src/org/aspectj/tools/ajdoc/StructureUtil.java10
-rw-r--r--ajdoc/src/org/aspectj/tools/ajdoc/StubFileGenerator.java5
3 files changed, 23 insertions, 38 deletions
diff --git a/ajdoc/src/org/aspectj/tools/ajdoc/Main.java b/ajdoc/src/org/aspectj/tools/ajdoc/Main.java
index 140394abb..53514a29d 100644
--- a/ajdoc/src/org/aspectj/tools/ajdoc/Main.java
+++ b/ajdoc/src/org/aspectj/tools/ajdoc/Main.java
@@ -109,7 +109,7 @@ public class Main implements Config {
}
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]);
}
@@ -191,7 +191,7 @@ public class Main implements Config {
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());
}
}
@@ -271,31 +271,6 @@ public class Main implements Config {
}
}
- /**
- * 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;
@@ -425,8 +400,6 @@ public class Main implements Config {
System.err.println("> could not read arg file: " + argFile);
ioe.printStackTrace();
}
-
-
}
List vargs = new LinkedList(Arrays.asList(args));
@@ -469,7 +442,7 @@ public class Main implements Config {
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 );
@@ -581,9 +554,10 @@ public class Main implements Config {
// 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);
@@ -611,7 +585,8 @@ public class Main implements Config {
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 {
@@ -642,8 +617,7 @@ public class Main implements Config {
!options.contains( "-protected" ) &&
!options.contains( "-public" ) ) {
options.addElement( "-package" );
- }
-
+ }
}
static void expandAtSignFile(String filename, File currentWorkingDir) {
diff --git a/ajdoc/src/org/aspectj/tools/ajdoc/StructureUtil.java b/ajdoc/src/org/aspectj/tools/ajdoc/StructureUtil.java
index 21788134f..25f2d4223 100644
--- a/ajdoc/src/org/aspectj/tools/ajdoc/StructureUtil.java
+++ b/ajdoc/src/org/aspectj/tools/ajdoc/StructureUtil.java
@@ -109,4 +109,14 @@ public class StructureUtil {
// 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;
+ }
}
diff --git a/ajdoc/src/org/aspectj/tools/ajdoc/StubFileGenerator.java b/ajdoc/src/org/aspectj/tools/ajdoc/StubFileGenerator.java
index e9a72a385..330029099 100644
--- a/ajdoc/src/org/aspectj/tools/ajdoc/StubFileGenerator.java
+++ b/ajdoc/src/org/aspectj/tools/ajdoc/StubFileGenerator.java
@@ -41,8 +41,9 @@ class StubFileGenerator {
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 ) {