Test.GtkWriter.vala
[app.Builder.js] / Test.GtkWriter.vala
1 /**
2  * Test the writer code...
3
4
5 */
6
7 public static int main () {
8    new JsRender.Lang_Class();
9         GLib.Log.set_always_fatal(LogLevelFlags.LEVEL_ERROR | LogLevelFlags.LEVEL_CRITICAL); 
10         var proj = new Project.Gtk( "/home/alan/gitlive/app.Builder.js/Builder4");
11         proj.scanDirs();
12         print(proj.toJSON(true));
13         print("\ndone\n");
14         var tf = proj.files.get("/home/alan/gitlive/app.Builder.js/Builder4/Editor.bjs");
15         tf.loadItems();
16
17         /*
18         string[] spawn_args;
19         print(tf.toSource());
20         return 0;
21         */
22         var test_out =tf.toJsonString();
23         print(test_out);
24         FileUtils.set_contents("/tmp/out.bjs",test_out);
25         //string[] spawn_args = {"diff", "-u", "/home/alan/gitlive/app.Builder.js/Builder4/Editor.bjs", "/tmp/out.bjs" };
26         
27         
28         string[] spawn_env = Environ.get ();
29         int ls_status;
30         Process.spawn_sync ("/",
31                                                         spawn_args,
32                                                         spawn_env,
33                                                         SpawnFlags.SEARCH_PATH,
34                                                         null,
35                                                         null,
36                                                         null,
37                                                         out ls_status);
38         //var tf = proj.files['/home/alan/gitlive/app.Builder/Builder4/Editor.bjs'];
39         //tf.loadItems(function() {
40         //      print(JSON.stringify(tf,null,4));
41         //      
42                 
43         //}, true); 
44
45         return 0;
46 }