1313import org .sugarj .common .Environment ;
1414import org .sugarj .common .FileCommands ;
1515import org .sugarj .common .Log ;
16+ import org .sugarj .common .cleardep .CompilationUnit ;
1617import org .sugarj .common .errors .SourceCodeException ;
1718import org .sugarj .common .path .Path ;
1819
@@ -43,6 +44,7 @@ public Set<Path> compile(
4344 Path outFile ,
4445 String source ,
4546 Path bin ,
47+ CompilationUnit mod ,
4648 List <Path > path ,
4749 Set <Path > deferredSourceFilesForSourceFile
4850 ) throws IOException , ClassNotFoundException , SourceCodeException {
@@ -54,7 +56,8 @@ public Set<Path> compile(
5456 outSourceFiles .addAll (deferredSourceFilesForSourceFile );
5557
5658 if (!source .isEmpty ()) {
57- writeToFile (generatedFiles , outFile , source );
59+ FileCommands .writeToFile (outFile , source );
60+ mod .addGeneratedFile (outFile );
5861 outSourceFiles .add (outFile );
5962 }
6063
@@ -68,14 +71,9 @@ public Set<Path> compile(
6871 return generatedFiles ;
6972 }
7073
71- private void writeToFile (Set <Path > generatedFiles , Path file , String content ) throws IOException {
72- FileCommands .writeToFile (file , content );
73- generatedFiles .add (file );
74- }
75-
7674 public String getImportLocalName (IStrategoTerm decl ) { return null ; }
7775 public String getModulePath (IStrategoTerm decl ) { return null ; }
78- public IStrategoTerm reconstructImport (String modulePath , IStrategoTerm original ) { throw new UnsupportedOperationException (); }
76+ public IStrategoTerm reconstructImport (String modulePath ) { throw new UnsupportedOperationException (); }
7977 public IStrategoTerm getImportForExport (IStrategoTerm export ) { throw new UnsupportedOperationException (); }
8078
8179 /**
0 commit comments