@@ -21,17 +21,20 @@ public class NgClosureRunner extends CommandLineRunner {
21
21
22
22
private boolean minerrPass ;
23
23
private String minerrErrors , minerrUrl , minerrSeparator ;
24
+ private String minerrJsResourcePath ;
24
25
private Compiler cachedCompiler ;
25
26
26
- protected NgClosureRunner (String [] args ,
27
- boolean minerrPass ,
28
- String minerrErrors ,
27
+ protected NgClosureRunner (String [] args ,
28
+ boolean minerrPass ,
29
+ String minerrErrors ,
29
30
String minerrUrl ,
30
- String minerrSeparator ) {
31
+ String minerrSeparator ,
32
+ String minerrJsResourcePath ) {
31
33
super (args );
32
34
this .minerrPass = minerrPass ;
33
35
this .minerrSeparator = minerrSeparator ;
34
-
36
+ this .minerrJsResourcePath = minerrJsResourcePath ;
37
+
35
38
if (minerrErrors != null ) {
36
39
this .minerrErrors = minerrErrors ;
37
40
} else {
@@ -60,12 +63,12 @@ private String loadTextResource(String asset) throws IOException {
60
63
private CompilerPass createMinerrPass () throws IOException {
61
64
AbstractCompiler compiler = createCompiler ();
62
65
PrintStream output = new PrintStream (minerrErrors );
63
- String code = loadTextResource ("minErr.js" );
66
+ String code = loadTextResource (minerrJsResourcePath );
64
67
65
68
if (minerrUrl != null ) {
66
- return new MinerrPass (compiler ,
67
- output ,
68
- MinerrPass .substituteInCode (code , minerrUrl , minerrSeparator ));
69
+ return new MinerrPass (
70
+ compiler , output ,
71
+ MinerrPass .substituteInCode (code , minerrUrl , minerrSeparator ));
69
72
}
70
73
return new MinerrPass (compiler , output );
71
74
}
@@ -101,7 +104,10 @@ protected Compiler createCompiler() {
101
104
102
105
public static void main (String [] args ) {
103
106
boolean minerrPass = false ;
104
- String minerrErrors = "errors.json" , minerrUrl = null , minerrSeparator = "/" ;
107
+ String minerrErrors = "errors.json" ;
108
+ String minerrUrl = null ;
109
+ String minerrSeparator = "/" ;
110
+ String minerrJsResourcePath = "minErr.js" ;
105
111
List <String > passthruArgs = new ArrayList <String >();
106
112
107
113
for (int i = 0 ; i < args .length ; i ++) {
@@ -114,18 +120,22 @@ public static void main(String[] args) {
114
120
minerrUrl = args [++i ];
115
121
} else if (arg .equals ("--minerr_separate_with_colon" )) {
116
122
minerrSeparator = ":" ;
123
+ } else if (arg .equals ("--minerr_js_resource_path" )) {
124
+ minerrJsResourcePath = args [++i ];
117
125
} else {
118
126
passthruArgs .add (arg );
119
127
}
120
128
}
121
129
122
- NgClosureRunner runner = new NgClosureRunner (passthruArgs .toArray (new String []{}),
123
- minerrPass , minerrErrors , minerrUrl , minerrSeparator );
130
+ NgClosureRunner runner = new NgClosureRunner (
131
+ passthruArgs .toArray (new String []{}),
132
+ minerrPass , minerrErrors , minerrUrl , minerrSeparator ,
133
+ minerrJsResourcePath );
124
134
125
135
if (runner .shouldRunCompiler ()) {
126
136
runner .run ();
127
137
} else {
128
138
System .exit (-1 );
129
139
}
130
140
}
131
- }
141
+ }
0 commit comments