JSDOC/Packer.vala
[gnome.introspection-doc-generator] / JSDOC / Packer.vala
index 72ce85f..82089b3 100644 (file)
@@ -64,11 +64,14 @@ namespace JSDOC
                * @cfg {String} target to write files to - must be full path.
                */
                string target;
+               FileOutputStream targetStream = null;
                /**
                 * @cfg {String} debugTarget target to write files debug version to (uncompacted)- must be full path.
                 */
                string targetDebug;
-       
+               
+
+               FileOutputStream targetDebugStream  = null;
                /**
                 * @cfg {String} tmpDir  (optional) where to put the temporary files. 
                 *      if you set this, then files will not be cleaned up
@@ -117,8 +120,7 @@ namespace JSDOC
                                this.files.add(f); //?? easier way?
                        }
                }
-               FileOutputStream targetStream = null;
-               FileOutputStream targetDebugStream  = null;
+       
                
                public void pack()
                {
@@ -207,10 +209,10 @@ namespace JSDOC
                                string file_contents;
                        // debug Target
                        
-                       if (this.debugTargetStream !=null) {
+                       if (this.targetDebugStream !=null) {
                                
                                FileUtils.get_contents(file,out file_contents);
-                           this.debugTarget.write(file_contents);
+                           this.targetDebugStream.write(file_contents);
                            loaded_string = false;
                        }
                        // it's a good idea to check with 0 compression to see if the code can parse!!
@@ -262,12 +264,12 @@ namespace JSDOC
                    
                    // if we are translating, write the translations strings at the top
                    // of the file..
-                   
+                   /*
                    if (this.translateJSON) {
                        
                           
                        print("MERGING LANGUAGE");
-                       var out = "if (typeof(_T) == 'undefined') { _T={};}\n"
+                       var out = "if (typeof(_T) == 'undefined') { _T={};}\n";
                        if (this.target) {
                            File.write(this.target, out);
                        } else {
@@ -306,12 +308,12 @@ namespace JSDOC
                           
                        }
                    }
-                   
+                   */
                    print("MERGING SOURCE");
                    
                    for(var i=0; i < this.files.length; i++)  {
                        var file = this.files[i];
-                       var minfile = this.tmpDir + '/' + file.replace(/\//g, '.');
+                       var minfile = this.tmpDir + '/' + file.replace('/', '.');
                        
                        
                        if (!File.exists(minfile)) {
@@ -321,6 +323,8 @@ namespace JSDOC
                        print("using MIN FILE  "+ minfile);
                        if (str.length) {
                            if (this.target) {
+                                       this.debugTarget.write(file_contents); 
+                           
                                File.append(this.target, '//' + file + "\n");   
                                File.append(this.target, str + "\n");   
                            } else {