2 //<Script type="text/javascript">
5 * takes a gtk project directory, and turns it into an application!
6 * by compling the files into JS files..
8 * Initially developed for runtime testing. (the vte runner)
10 * Might be the way to go for full runtime
14 * gtkrun.js /path/to/myproject
17 * a) load dependancies.. (eg. gi's..) - derived later?
20 * loop the files (find .bjs)
21 * - comple to js (if not exist // or force enabled..)
22 * b) load all the files
31 Pango = imports.gi.Pango;
32 GLib = imports.gi.GLib;
34 GObject = imports.gi.GObject;
35 GtkSource = imports.gi.GtkSource;
36 WebKit = imports.gi.WebKit;
39 File = imports.File.File;
43 // error checking todo..
44 var files = File.list(Seed.argv[2]);
47 var gtkbuilder = false;
48 files.forEach(function(f) {
49 var fp = Seed.argv[2] + '/' + f;
50 if (!fp.match(/\.bjs$/)) {
53 if (File.isFile(fp.replace(/\.bjs$/, '.js'))) {
56 olist.push(imports[fp.replace(/\.bjs$/, '.js')]);
59 var gtkbuilder = new imports.Builder.Provider.File.Gtk.Gtk({ path : fp });
60 gtkbuilder.loadItems(function() { });
61 var fn = gtkbuilder.saveJS();
62 if (fn === false) { // skip files that do not contain anythng!
65 olist.push(imports[fn]);