@@ -18,7 +18,6 @@ public class FileWriter {
1818 private boolean writeMultipleFiles ;
1919 private PrintStream ps ;
2020 private File outDir ;
21- private boolean isFirstRun = true ;
2221
2322 public FileWriter (File outDir , boolean writeMultipleFiles ) {
2423 this .writeMultipleFiles = writeMultipleFiles ;
@@ -37,12 +36,6 @@ public void write(String content, String fileName) {
3736 String outFile = this .outDir .getAbsolutePath () + File .separator + this .defaultDtsFileName + ".d.ts" ;
3837 this .ps = new PrintStream (new FileOutputStream (outFile , /*append*/ true ));
3938
40- // add helpers reference to the top of the file
41- if (this .isFirstRun ) {
42- ps .println ("/// <reference path=\" ./_helpers.d.ts\" />" );
43- this .isFirstRun = false ;
44- }
45-
4639 this .ps .print (content );
4740 this .ps .println ();
4841 }
@@ -58,11 +51,12 @@ public void write(String content, String fileName) {
5851
5952 public void writeHelperTypings (String content , boolean append ) {
6053 try {
61- String outFile = this .outDir .getAbsolutePath () + File .separator + "_helpers.d.ts" ;
62- this .ps = new PrintStream (new FileOutputStream (outFile , append ));
54+ String outFile = this .outDir .getAbsolutePath () + File .separator +
55+ (this .writeMultipleFiles ? "_helpers.d.ts" : (this .defaultDtsFileName + ".d.ts" ));
56+ this .ps = new PrintStream (new FileOutputStream (outFile , append ));
6357
64- this .ps .print (content );
65- this .ps .println ();
58+ this .ps .print (content );
59+ this .ps .println ();
6660 } catch (FileNotFoundException e ) {
6761 e .printStackTrace ();
6862 }
0 commit comments