| 1 |
package jgi; |
| 2 |
|
| 3 |
import java.io.File; |
| 4 |
import java.util.ArrayList; |
| 5 |
|
| 6 |
import shared.Tools; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
public class AssemblyStatsWrapper { |
| 14 |
|
| 15 |
public static void main(String[] args){ |
| 16 |
ArrayList<String> alist=new ArrayList<String>(); |
| 17 |
ArrayList<String> ilist=new ArrayList<String>(); |
| 18 |
|
| 19 |
alist.add(""); |
| 20 |
alist.add("header=t"); |
| 21 |
alist.add("showspeed=f"); |
| 22 |
alist.add("addname=t"); |
| 23 |
alist.add("k=0"); |
| 24 |
|
| 25 |
for(String arg : args){ |
| 26 |
if(!arg.contains("=") && Tools.canRead(arg)){ |
| 27 |
ilist.add("in="+arg); |
| 28 |
}else{ |
| 29 |
String[] split=arg.split("="); |
| 30 |
if(split[0].equalsIgnoreCase("in") || split[0].equalsIgnoreCase("ref")){ |
| 31 |
if(split.length>1){ |
| 32 |
if(new File(split[1]).exists()){ |
| 33 |
ilist.add(arg); |
| 34 |
}else{ |
| 35 |
String[] split2=split[1].split(","); |
| 36 |
for(String s : split2){ |
| 37 |
ilist.add("in="+s); |
| 38 |
} |
| 39 |
} |
| 40 |
} |
| 41 |
}else{ |
| 42 |
alist.add(arg); |
| 43 |
} |
| 44 |
} |
| 45 |
} |
| 46 |
|
| 47 |
String[] args2=alist.toArray(new String[alist.size()]); |
| 48 |
for(int i=0; i<ilist.size(); i++){ |
| 49 |
String s=ilist.get(i); |
| 50 |
|
| 51 |
args2[0]=s; |
| 52 |
if(i>0){ |
| 53 |
args2[1]="header=f"; |
| 54 |
|
| 55 |
System.gc(); |
| 56 |
synchronized(AssemblyStatsWrapper.class){ |
| 57 |
try { |
| 58 |
AssemblyStatsWrapper.class.wait(100); |
| 59 |
} catch (InterruptedException e) {} |
| 60 |
} |
| 61 |
Thread.yield(); |
| 62 |
} |
| 63 |
AssemblyStats2 as2=new AssemblyStats2(args2); |
| 64 |
if(i>0){ |
| 65 |
AssemblyStats2.overwrite=false; |
| 66 |
AssemblyStats2.append=true; |
| 67 |
} |
| 68 |
as2.process(); |
| 69 |
} |
| 70 |
|
| 71 |
} |
| 72 |
|
| 73 |
} |