From dc22f95ba822351ff76d5246b8d6099bc6b20f90 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 26 May 2015 13:39:23 +0800 Subject: [PATCH] src/Project/Gtk.vala --- src/Project/Gtk.vala | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/Project/Gtk.vala b/src/Project/Gtk.vala index 3d56d0aea..98d02d0c6 100644 --- a/src/Project/Gtk.vala +++ b/src/Project/Gtk.vala @@ -210,8 +210,35 @@ namespace Project { public Gee.ArrayList filesForCompile(string in_path) { + var allfile = this.fileAll(); + var ret = new Gee.ArrayList(); + for (var i = 0; i < cfiles.size; i ++) { + var fn = cfiles.get(i); + if (Regex.match_simple("\\.vala$", fn)) { + ret.add( fn); + continue; + } + + // got a file that is not + + vv = fn; + try { + vv = (new Regex("\\.c$")).replace( fn, fn, 0, ".vala"); + } catch (Error e) { + continue; + } + if (Regex.match_simple("\\.vala\\.c$", fn)) { + continue; + } + + if (ret.index_of( vv) > -1) { + continue; + } + ret.add(fn); + } + } @@ -270,8 +297,7 @@ namespace Project { } catch(Error e) { GLib.warning("oops - something went wrong scanning the projects\n"); } - - if + // add the cfiles to ret - if they do not have a vala... for (var i = 0; i < cfiles.size; i ++) { -- 2.39.2