public Gee.HashMap<string,Gee.ArrayList<string>> child_list_cache; // what child can on on what node
public Gee.HashMap<string,Gee.ArrayList<string>> child_list_cache_props; // what child can go on what node (with properties included)
- public string compile_flags = ""; // generic to all.
+ public string compile_flags = ""; // generic to all.
+ public bool generate_meson = false;
+
public Gee.ArrayList<string> packages; // list of vapi's that are used by this project.
//pblic Gee.ArrayList<string> hidden; // list of dirs to be hidden from display...
public GtkValaSettings? active_cg = null;
public Gee.HashMap<string,GtkValaSettings> compilegroups;
+ public Meson meson;
public Palete.Gtk gpalete {
this.packages = new Gee.ArrayList<string>();
//this.hidden = new Gee.ArrayList<string>();
this.compilegroups = new Gee.HashMap<string,GtkValaSettings>();
+ this.meson = new Meson(this);
}
if (obj.has_member("compiler_flags")) {
this.compile_flags = obj.get_string_member("compile_flags");
}
-
+ if (obj.has_member("version")) {
+ this.version = obj.get_string_member("version");
+ }
+ if (obj.has_member("licence")) {
+ this.licence = obj.get_string_member("licence");
+ }
+ if (obj.has_member("generate_meson")) {
+ this.generate_meson = obj.get_boolean_member("generate_meson");
+ }
if (!obj.has_member("compilegroups") || obj.get_member("compilegroups").get_node_type () != Json.NodeType.ARRAY) {
// make _default_ ?
return;
obj.set_array_member("compilegroups", ar);
obj.set_string_member("compile_flags", this.compile_flags);
+ obj.set_string_member("version", this.version);
+ obj.set_string_member("licence", this.licence);
+ obj.set_boolean_member("generate_meson",this.generate_meson);
var par = new Json.Array();
foreach(var p in this.packages) {
par.add_string_element(p);
this.gir_cache = null;
}
+ public override void onSave()
+ {
+ if (this.generate_meson) {
+ this.meson.save();
+ }
+ var vl = this.language_servers.get("vala");
+ if (vl != null) {
+ vl.initialize_server(); // hopefully better than exit?
+ }
+ }
/**
* perhaps we should select the default in the window somewhere...
{
return this.pathsMatching("vapi", false);
}
+
+
+
+ public override Palete.LanguageClient getLanguageServer(string lang)
+ {
+ if (this.language_servers.has_key(lang)) {
+ return this.language_servers.get(lang);
+ }
+ switch( lang ) {
+ case "vala":
+ var ls = new Palete.LanguageClientVala(this);
+ ls.log.connect((act, msg) => {
+ //GLib.debug("log %s: %s", act.to_string(), msg);
+ BuilderApplication.showSpinnerLspLog(act,msg);
+ });
+ this.language_servers.set(lang, ls);
+ break;
+ default :
+ return this.language_servers.get("dummy");
+
+ }
+ return this.language_servers.get(lang);
+
+ }
+
+
+
+
+
+ // ------------------ new project stufff
public override void initialize()
{
+ this.generate_meson = true; // default to true on new projects.
+
string[] dirs = {
"src",
"src/ui"
this.makeMain();
this.makeApplication();
this.makeWindow();
-
+ this.makeGitIgnore();
var cg = new GtkValaSettings(this, this.name);
this.compilegroups.set(this.name, cg);
}
""");
}
-
-
+ void makeGitIgnore()
+ {
+ this.writeFile(".gitignore", """
+build/
+""");
+ }
- public override void initDatabase()
- {
- // nOOP
- }
+ public override void initDatabase()
+ {
+ // nOOP
+ }
}