Skip to content

Commit

Permalink
remove debugging output
Browse files Browse the repository at this point in the history
reformat code spacing
  • Loading branch information
hkiel committed Jun 16, 2023
1 parent a2771f3 commit 072635a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 31 deletions.
6 changes: 3 additions & 3 deletions resources/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ source.repository=https://github.com/hkiel/JavaDoc.git
# This is used to compare different versions of the same Tool, and check if an
# update is available.

tool.version=5
tool.version=6


# The version as the user will see it.

tool.prettyVersion=1.0.4
tool.prettyVersion=1.0.5


# The min and max revision of Processing compatible with your Tool.
Expand All @@ -157,7 +157,7 @@ compatible.maxRevision=0
# against. This information is only used in the generated webpage.

tested.platform=osx,windows
tested.processingVersion=4.1.1
tested.processingVersion=4.2


# Additional information for the generated webpage.
Expand Down
55 changes: 27 additions & 28 deletions src/javadoc/tool/JavaDoc.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,21 @@ public void init(Base base) {
public static List<String> findFiles(Path path, String fileExtension) throws IOException {

if (!Files.isDirectory(path)) {
throw new IllegalArgumentException("Path must be a directory!");
throw new IllegalArgumentException("Path must be a directory!");
}

List<String> result;

try (Stream<Path> walk = Files.walk(path)) {
System.out.println("Walking "+path.toString());
result = walk
.filter(p -> !Files.isDirectory(p))
// this is a path, not string,
// convert path to string first
.map(p -> p.toAbsolutePath().toString())
// this only test if pathname ends with a certain extension
.filter(f -> f.toLowerCase().endsWith(fileExtension))
.collect(Collectors.toList());
//System.out.println("Walking "+path.toString());
result = walk
.filter(p -> !Files.isDirectory(p))
// this is a path, not string,
// convert path to string first
.map(p -> p.toAbsolutePath().toString())
// this only test if pathname ends with a certain extension
.filter(f -> f.toLowerCase().endsWith(fileExtension))
.collect(Collectors.toList());
}

return result;
Expand Down Expand Up @@ -122,12 +122,12 @@ public void run() {
File folder = sketch.getFolder();
String extraLibs = getJarsInDir(Paths.get(Preferences.getSketchbookPath()+(isWindows?'\\':'/')+"libraries"));
extraLibs += getJarsInDir(folder);
extraLibs += getJarsInDir(processing.app.Platform.getContentFile("modes/java/libraries"));
extraLibs += getJarsInDir(Platform.getContentFile("modes/java/libraries"));
SketchCode codes[] = sketch.getCode();
String mainTab = codes[0].getProgram();
if (!mainTab.contains("setup") && !mainTab.contains("draw")) {
System.err.println("Can only generate JavaDoc for sketches in dynamic mode.");
return;
System.err.println("Can only generate JavaDoc for sketches in dynamic mode.");
return;
}
try {
File ref = new File(folder, "reference");
Expand All @@ -144,23 +144,22 @@ public void run() {
boolean blockComment = false;
for (String line : code) {
if (blockComment) {
int lineComment = line.indexOf("//");
int stopComment = line.indexOf("*/");
if (stopComment>=0) {
int startComment = line.indexOf("/*");
if (startComment<stopComment) {
blockComment = false;
}
}
} else {
int lineComment = line.indexOf("//");
int stopComment = line.indexOf("*/");
if (stopComment >= 0) {
int startComment = line.indexOf("/*");
if (startComment>=0 && (lineComment<0 || lineComment>startComment)) {
int stopComment = line.indexOf("*/");
if (startComment>stopComment) {
blockComment = true;
}
if (startComment < stopComment) {
blockComment = false;
}
}
} else {
int lineComment = line.indexOf("//");
int startComment = line.indexOf("/*");
if (startComment >= 0 && (lineComment < 0 || lineComment > startComment)) {
int stopComment = line.indexOf("*/");
if (startComment > stopComment) {
blockComment = true;
}
}
}
if (!blockComment && line.trim().startsWith("import")) {
imports.append(line);
Expand Down

0 comments on commit 072635a

Please sign in to comment.