@@ -54,7 +54,7 @@ public class TaskCreateExc extends DefaultTask {
5454
5555 private File srg ;
5656 private File statics ;
57- private File constructors ;
57+ private File extraParams ;
5858 private File mappings ;
5959 private File output = getProject ().file ("build/" + getName () + "/output.exc" );
6060
@@ -100,8 +100,11 @@ public void run() throws IOException {
100100 }
101101 }
102102
103- Files .readLines (getConstructors (), StandardCharsets .UTF_8 ).stream ().map (l -> l .split (" " )).forEach (pts -> {
104- out .add (pts [1 ] + ".<init>" + pts [2 ] + "=|" + String .join ("," , buildArgs (pts [0 ], pts [2 ], false )));
103+ Files .readLines (getExtraParameters (), StandardCharsets .UTF_8 ).stream ().map (l -> l .split (" " )).forEach (pts -> {
104+ if (pts .length == 3 ) //legacy constructors.txt format
105+ out .add (pts [1 ] + ".<init>" + pts [2 ] + "=|" + String .join ("," , buildArgs ("i" + pts [0 ], pts [2 ], false )));
106+ else if (pts .length == 4 ) //extraParams.txt format
107+ out .add (pts [1 ] + "." + pts [2 ] + pts [3 ] + "=|" + String .join ("," , buildArgs (pts [0 ], pts [3 ], pts [0 ].charAt (0 ) == 's' )));
105108 });
106109
107110 try (FileOutputStream fos = new FileOutputStream (getOutput ())) {
@@ -110,7 +113,7 @@ public void run() throws IOException {
110113 }
111114
112115 private List <String > buildArgs (String name , String desc , boolean isStatic ) {
113- String prefix = "p_i " + name + "_" ;
116+ String prefix = "p_ " + name + "_" ;
114117 if (name .startsWith ("func_" )) {
115118 prefix = "p_" + name .split ("_" )[1 ] + "_" ;
116119 }
@@ -198,11 +201,11 @@ public void setStatics(File value) {
198201 this .statics = value ;
199202 }
200203 @ InputFile
201- public File getConstructors () {
202- return this .constructors ;
204+ public File getExtraParameters () {
205+ return this .extraParams ;
203206 }
204- public void setConstructors (File value ) {
205- this .constructors = value ;
207+ public void setExtraParameters (File value ) {
208+ this .extraParams = value ;
206209 }
207210 @ InputFile
208211 public File getMappings () {
0 commit comments