2 * Test the writer code...
7 int main (string[] args) {
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);
53 if (BuilderApplication.opt_list_files) {
54 if (cur_project == null) {
55 GLib.error("missing project, use --project to select which project");
57 print("Files for %s\n %s\n", cur_project.name, cur_project.listAllFilesToString());
58 GLib.Process.exit(Posix.EXIT_SUCCESS);
61 if (BuilderApplication.opt_bjs_compile != null) {
62 if (cur_project == null) {
63 GLib.error("missing project, use --project to select which project");
65 var file = cur_project.getByName(BuilderApplication.opt_bjs_compile);
67 GLib.error("missing file %s in project %s", BuilderApplication.opt_bjs_compile, cur_project.name);
69 //BuilderApplication.compileBjs();
70 print(file.toSourceCode());
72 GLib.Process.exit(Posix.EXIT_SUCCESS);
76 if (BuilderApplication.opt_compile_target != null) {
78 Palete.ValaSourceCompiler.buildApplication();
80 GLib.Process.exit(Posix.EXIT_SUCCESS);
85 GLib.debug("project = %s\n", BuilderApplication.opt_compile_project);
89 GtkClutter.init (ref args);
90 new JsRender.Lang_Class();
91 GLib.Log.set_always_fatal(LogLevelFlags.LEVEL_ERROR | LogLevelFlags.LEVEL_CRITICAL);
95 // respond to other arguments
97 /*var proj = Project.Project.getProject("Pman.Core");
99 print("could not load test project Pman.Core");
105 var w = Xcls_MainWindow.singleton();
110 // it looks like showall after children causes segfault on ubuntu 14.4
112 w.windowstate.switchState(WindowState.State.FILES);