Skip to content

Commit 9705464

Browse files
hansonrhansonr
authored andcommitted
java2script compiler adds debugging message for write file locations
1 parent 4b6c0ae commit 9705464

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

sources/net.sf.j2s.core/src/net/sf/j2s/core/Java2ScriptCompiler.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ class Java2ScriptCompiler {
7979

8080
private IJavaProject project;
8181

82+
private boolean isDebugging;
83+
8284
static boolean isActive(IJavaProject project) {
8385
try {
8486
return new File(project.getProject().getLocation().toOSString(), J2S_OPTIONS_FILE_NAME).exists();
@@ -152,6 +154,8 @@ boolean initializeProject(IJavaProject project, boolean isCompilationParticipant
152154
siteFolder = projectFolder + "/" + siteFolder;
153155
j2sPath = siteFolder + "/swingjs/j2s";
154156

157+
if (isDebugging)
158+
System.out.println("Java2ScriptCompiler writing to " + j2sPath);
155159
// method declarations and invocations are only logged
156160
// when the designated files are deleted prior to building
157161

@@ -199,7 +203,7 @@ boolean initializeProject(IJavaProject project, boolean isCompilationParticipant
199203
if (nonqualifiedPackages.length() == 0)
200204
nonqualifiedPackages = null;
201205
// includes @j2sDebug blocks
202-
boolean isDebugging = "debug".equals(getProperty("j2s.compiler.mode"));
206+
isDebugging = "debug".equals(getProperty("j2s.compiler.mode"));
203207

204208
String classReplacements = getProperty("j2s.class.replacements");
205209

@@ -375,7 +379,10 @@ private void createJSFile(String j2sPath, String packageName, String elementName
375379
}
376380
}
377381
}
378-
writeToFile(new File(j2sPath, elementName + ".js"), js);
382+
File f = new File(j2sPath, elementName + ".js");
383+
if (isDebugging)
384+
System.out.println("Java2ScriptCompiler creating " + f);
385+
writeToFile(f, js);
379386
}
380387

381388
private String getFileContents(File file) {

0 commit comments

Comments
 (0)