2 * Test the writer code...
7 int main (string[] args) {
12 new JsRender.Lang_Class();
14 var app = BuilderApplication.singleton( args);
16 if (BuilderApplication.opt_debug || BuilderApplication.opt_compile_project == null) {
17 GLib.Log.set_handler(null,
18 GLib.LogLevelFlags.LEVEL_DEBUG | GLib.LogLevelFlags.LEVEL_WARNING,
20 print("%s: %s\n", dom, msg);
25 if (BuilderApplication.opt_list_projects) {
27 //BuilderApplication.compileBjs();
28 Project.Project.loadAll();
29 print("Projects\n %s\n", Project.Project.listAllToString());
30 GLib.Process.exit(Posix.EXIT_SUCCESS);
32 Project.Project.loadAll();
34 if (BuilderApplication.opt_list_projects) {
36 //BuilderApplication.compileBjs();
38 print("Projects\n %s\n", Project.Project.listAllToString());
39 GLib.Process.exit(Posix.EXIT_SUCCESS);
41 Project.Project cur_project = null;
42 if (BuilderApplication.opt_compile_project != null) {
45 cur_project = Project.Project.getProjectByHash( BuilderApplication.opt_compile_project);
47 if (cur_project == null) {
48 GLib.error("invalid project %s, use --list-projects to show project ids",BuilderApplication.opt_compile_project);
50 cur_project.scanDirs();
55 if (BuilderApplication.opt_list_files) {
56 if (cur_project == null) {
57 GLib.error("missing project, use --project to select which project");
59 print("Files for %s\n %s\n", cur_project.name, cur_project.listAllFilesToString());
60 GLib.Process.exit(Posix.EXIT_SUCCESS);
63 if (BuilderApplication.opt_bjs_compile != null) {
64 if (cur_project == null) {
65 GLib.error("missing project, use --project to select which project");
67 var file = cur_project.getByName(BuilderApplication.opt_bjs_compile);
69 GLib.error("missing file %s in project %s", BuilderApplication.opt_bjs_compile, cur_project.name);
71 //BuilderApplication.compileBjs();
73 var str = file.toSourceCode();
76 if (!BuilderApplication.opt_debug) {
78 GLib.Process.exit(Posix.EXIT_SUCCESS);
82 file.tree.dumpProps();
85 var str_ar = str.split("\n");
86 for(var i =0;i<str_ar.length;i++) {
87 var node = file.tree.lineToNode(i+1);
88 var prop = node == null ? null : node.lineToProp(i+1);
89 print("%d: %s : %s\n",
91 node == null ? "......" : (prop == null ? "????????" : prop),
96 GLib.Process.exit(Posix.EXIT_SUCCESS);
100 if (BuilderApplication.opt_compile_target != null) {
102 Palete.ValaSourceCompiler.buildApplication();
104 GLib.Process.exit(Posix.EXIT_SUCCESS);
109 GLib.debug("project = %s\n", BuilderApplication.opt_compile_project);
113 GtkClutter.init (ref args);
115 GLib.Log.set_always_fatal(LogLevelFlags.LEVEL_ERROR | LogLevelFlags.LEVEL_CRITICAL);
119 // respond to other arguments
121 /*var proj = Project.Project.getProject("Pman.Core");
123 print("could not load test project Pman.Core");
129 var w = Xcls_MainWindow.singleton();
134 // it looks like showall after children causes segfault on ubuntu 14.4
136 w.windowstate.switchState(WindowState.State.FILES);