lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] git commit: refs/heads/cfc-pod - Delay creation of autogen dirs
Date Sat, 20 Jul 2013 16:41:45 GMT
Updated Branches:
  refs/heads/cfc-pod 5d8677be6 -> ff19b984c


Delay creation of autogen dirs


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/ff19b984
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/ff19b984
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/ff19b984

Branch: refs/heads/cfc-pod
Commit: ff19b984c3410c60c8f6dcd2d860124b9c09be8b
Parents: 5d8677b
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Sat Jul 20 18:39:36 2013 +0200
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Sat Jul 20 18:39:36 2013 +0200

----------------------------------------------------------------------
 clownfish/compiler/src/CFCBindCore.c  | 19 ++++++++++++++++++-
 clownfish/compiler/src/CFCHierarchy.c | 15 ---------------
 2 files changed, 18 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/ff19b984/clownfish/compiler/src/CFCBindCore.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCBindCore.c b/clownfish/compiler/src/CFCBindCore.c
index 5a7c94a..dd79a64 100644
--- a/clownfish/compiler/src/CFCBindCore.c
+++ b/clownfish/compiler/src/CFCBindCore.c
@@ -60,6 +60,9 @@ S_charmony_stdbool_defines();
 char*
 S_charmony_stdint_defines();
 
+static void
+S_do_make_path(const char *path);
+
 static const CFCMeta CFCBINDCORE_META = {
     "Clownfish::CFC::Binding::Core",
     sizeof(CFCBindCore),
@@ -98,13 +101,17 @@ CFCBindCore_write_all_modified(CFCBindCore *self, int modified) {
     CFCHierarchy *hierarchy = self->hierarchy;
     const char   *header    = self->header;
     const char   *footer    = self->footer;
+    const char   *inc_dest  = CFCHierarchy_get_include_dest(hierarchy);
+    const char   *src_dest  = CFCHierarchy_get_source_dest(hierarchy);
+
+    S_do_make_path(inc_dest);
+    S_do_make_path(src_dest);
 
     // Discover whether files need to be regenerated.
     modified = CFCHierarchy_propagate_modified(hierarchy, modified);
 
     // Iterate over all File objects, writing out those which don't have
     // up-to-date auto-generated files.
-    const char *inc_dest = CFCHierarchy_get_include_dest(hierarchy);
     CFCFile **files = CFCHierarchy_files(hierarchy);
     for (int i = 0; files[i] != NULL; i++) {
         if (CFCFile_get_modified(files[i])) {
@@ -616,4 +623,14 @@ S_charmony_stdint_defines() {
 #endif
 }
 
+static void
+S_do_make_path(const char *path) {
+    if (!CFCUtil_is_dir(path)) {
+        CFCUtil_make_path(path);
+        if (!CFCUtil_is_dir(path)) {
+            CFCUtil_die("Can't make path %s", path);
+        }
+    }
+}
+
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/ff19b984/clownfish/compiler/src/CFCHierarchy.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCHierarchy.c b/clownfish/compiler/src/CFCHierarchy.c
index e059546..ebbe24f 100644
--- a/clownfish/compiler/src/CFCHierarchy.c
+++ b/clownfish/compiler/src/CFCHierarchy.c
@@ -67,9 +67,6 @@ static void
 S_parse_parcel_files(const char *path, void *context);
 
 static void
-S_do_make_path(const char *path);
-
-static void
 S_parse_cf_files(CFCHierarchy *self, const char *source_dir, int is_included);
 
 static void
@@ -122,8 +119,6 @@ CFCHierarchy_init(CFCHierarchy *self, const char *dest) {
 
     self->inc_dest = CFCUtil_sprintf("%s" CHY_DIR_SEP "include", self->dest);
     self->src_dest = CFCUtil_sprintf("%s" CHY_DIR_SEP "source", self->dest);
-    S_do_make_path(self->inc_dest);
-    S_do_make_path(self->src_dest);
 
     return self;
 }
@@ -157,16 +152,6 @@ CFCHierarchy_destroy(CFCHierarchy *self) {
     CFCBase_destroy((CFCBase*)self);
 }
 
-static void
-S_do_make_path(const char *path) {
-    if (!CFCUtil_is_dir(path)) {
-        CFCUtil_make_path(path);
-        if (!CFCUtil_is_dir(path)) {
-            CFCUtil_die("Can't make path %s", path);
-        }
-    }
-}
-
 void
 CFCHierarchy_add_source_dir(CFCHierarchy *self, const char *source_dir) {
     size_t n = self->num_sources;


Mime
View raw message