Skip to content

Commit 059547a

Browse files
hansonrhansonr
authored andcommitted
Java2ScriptCompiler j2s.config.altfileproperty
1 parent 711ddfd commit 059547a

File tree

7 files changed

+37
-8
lines changed

7 files changed

+37
-8
lines changed
636 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20201222082136
1+
20201222130056
636 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20201222082136
1+
20201222130056

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,8 @@ boolean initializeProject(IJavaProject project, boolean isCompilationParticipant
365365
}
366366

367367
/**
368-
* Iteratively look for a .j2s file to use for configuration information.
369-
* Up to five iterations are allowed.
368+
* Iteratively look for a .j2s file to use for configuration information. Up to
369+
* five iterations are allowed.
370370
*
371371
* @param j2sFile
372372
* @param level
@@ -381,10 +381,14 @@ private void initializeUsing(File j2sFile, int level) {
381381
newProps.load(os);
382382
os.close();
383383
String j2sAltFileProperty = newProps.getProperty(J2S_OPTIONS_ALTFILEPROPERTY);
384-
String j2sAltFileName = (j2sAltFileProperty == null ? null : System.getProperty(j2sAltFileProperty));
385-
if (j2sAltFileName != null && j2sAltFileName.length() > 0) {
386-
initializeUsing(new File(projectFolder, j2sAltFileName), level);
387-
return;
384+
if (j2sAltFileProperty != null) {
385+
System.out.println(J2S_OPTIONS_ALTFILEPROPERTY + " = " + j2sAltFileProperty);
386+
String j2sAltFileName = System.getProperty(j2sAltFileProperty);
387+
System.out.println("J2S System.getProperty(\"" + j2sAltFileProperty + "\") = " + j2sAltFileName);
388+
if (j2sAltFileName != null && j2sAltFileName.length() > 0) {
389+
initializeUsing(new File(projectFolder, j2sAltFileName), level);
390+
return;
391+
}
388392
}
389393
props = newProps;
390394
} catch (Exception e) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#j2s.config.altfileproperty=j2s.alt.file
12
j2s.compiler.status=enable
23

34
# read.annotations to false to not record annotations

sources/net.sf.j2s.java.core/.j2s1

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
j2s.compiler.status=enable
2+
3+
# read.annotations to false to not record annotations
4+
j2s.compiler.read.annotations=true
5+
6+
# customizable list for what annotations to skip
7+
j2s.compiler.ignored.annotations=CallerSensitive;ConstructorProperties;Deprecated;Override;SaveVarargs;SuppressWarnings;
8+
9+
#j2s.compiler.nonqualified.packages=org.w3c.dom
10+
11+
#output file name for logging methods declared - delete the file to regenerate a listing
12+
#j2s.log.methods.declared=methodsDeclared.csv
13+
14+
#output file name for logging methods called - delete the file to regenerate a listing
15+
#j2s.log.methods.called=methodsCalled.csv
16+
17+
#if set, every instance of methods called will be logged
18+
#otherwise, only the first call to a method will be logged
19+
#output will be comma-separated: called method,caller class
20+
#j2s.log.all.calls=true
21+
22+
#a semicolon-separated list of package-level file paths to be excluded
23+
#j2s.excluded.paths=test;testng
24+

0 commit comments

Comments
 (0)