rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=a1aa0c6549a1b34fd05a078f2c9232d78ff4bf9e

commit a1aa0c6549a1b34fd05a078f2c9232d78ff4bf9e
Author: Vyacheslav Reutskiy <v.reuts...@samsung.com>
Date:   Tue Jan 5 13:43:46 2016 +0200

    project_manager: add build script generation for exported project or group
    
    Change-Id: Icd8070ce83310e703522d23efe8ebc243eaa054b
---
 src/bin/project_manager/project_manager.c | 34 +++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/src/bin/project_manager/project_manager.c 
b/src/bin/project_manager/project_manager.c
index 6b7e9e0..c8c27ed 100644
--- a/src/bin/project_manager/project_manager.c
+++ b/src/bin/project_manager/project_manager.c
@@ -219,6 +219,32 @@ _end_send(void *data __UNUSED__)
    func(udata, result);
 }
 
+static Eina_Bool
+_build_script_write(const char *path)
+{
+   FILE *f;
+   Eina_Bool res = true;
+   Eina_Strbuf *buf;
+
+   f = fopen(path, "w");
+   if (!f)
+     {
+        ERR("Could't open file '%s'", path);
+        res = false;
+        goto exit;
+     }
+
+   buf = eina_strbuf_new();
+   eina_strbuf_append_printf(buf, "#!/bin/sh\n");
+   eina_strbuf_append_printf(buf, "edje_cc -v generated.edc -id images/ -sd 
sounds/ -fd fonts/");
+   fputs(eina_strbuf_string_get(buf), f);
+   eina_strbuf_free(buf);
+
+exit:
+   fclose(f);
+   return res;
+}
+
 #define MKDIR(NAME) \
    tmp = eina_stringshare_printf("%s/"#NAME, pro->develop_path); \
    ecore_file_mkdir(tmp); \
@@ -1496,6 +1522,10 @@ _group_source_code_export(void *data, Eina_Thread 
*thread __UNUSED__)
         eina_stringshare_del(resource);
      }
 
+   eina_strbuf_reset(buf);
+   eina_strbuf_append_printf(buf, "%s/%s/build.sh", worker.path, name);
+   _build_script_write(eina_strbuf_string_get(buf));
+
    END_SEND(PM_PROJECT_SUCCESS);
 exit:
    eina_strbuf_free(buf);
@@ -1584,6 +1614,10 @@ _source_code_export(void *data __UNUSED__, Eina_Thread 
*thread __UNUSED__)
         eina_strbuf_reset(buf);
      }
 
+   eina_strbuf_reset(buf);
+   eina_strbuf_append_printf(buf, "%s/%s/build.sh", worker.path, 
worker.project->name);
+   _build_script_write(eina_strbuf_string_get(buf));
+
    END_SEND(PM_PROJECT_SUCCESS);
 exit:
    eina_strbuf_free(buf);

-- 


Reply via email to