[gnome-builder] meson-templates: add source file for library



commit 7acea6edc2160c1ead641e59026d4314bb0fa550
Author: Christian Hergert <chergert redhat com>
Date:   Tue Feb 12 21:41:43 2019 -0800

    meson-templates: add source file for library
    
    This gives us some files to key off of for initial symbols, which is a
    better first experience for the user.

 src/plugins/meson-templates/meson-templates.gresource.xml  | 1 +
 src/plugins/meson-templates/meson_templates.py             | 1 +
 src/plugins/meson-templates/resources/src/hello.c          | 4 ++++
 src/plugins/meson-templates/resources/src/meson-clib.build | 2 +-
 4 files changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/meson-templates/meson-templates.gresource.xml 
b/src/plugins/meson-templates/meson-templates.gresource.xml
index fbe778768..0a9bc5085 100644
--- a/src/plugins/meson-templates/meson-templates.gresource.xml
+++ b/src/plugins/meson-templates/meson-templates.gresource.xml
@@ -10,6 +10,7 @@
     <file compressed="true">resources/src/hello-version.h.in</file>
     <file compressed="true">resources/src/meson-clib.build</file>
     <file compressed="true">resources/src/meson-js.build</file>
+    <file compressed="true">resources/src/hello.c</file>
     <file compressed="true">resources/src/hello.h</file>
     <file compressed="true">resources/src/__init__.py</file>
     <file compressed="true">resources/src/meson-c-vala.build</file>
diff --git a/src/plugins/meson-templates/meson_templates.py b/src/plugins/meson-templates/meson_templates.py
index e9541e1cc..d2c013562 100644
--- a/src/plugins/meson-templates/meson_templates.py
+++ b/src/plugins/meson-templates/meson_templates.py
@@ -324,6 +324,7 @@ class LibraryProjectTemplate(MesonTemplate):
     def prepare_files(self, files):
         if self.language == 'c':
             files['resources/src/meson-clib.build'] = 'src/meson.build'
+            files['resources/src/hello.c'] = 'src/%(name)s.c'
             files['resources/src/hello.h'] = 'src/%(name)s.h'
             files['resources/src/hello-version.h.in'] = 'src/%(prefix)s-version.h.in'
 
diff --git a/src/plugins/meson-templates/resources/src/hello.c 
b/src/plugins/meson-templates/resources/src/hello.c
new file mode 100644
index 000000000..570e24305
--- /dev/null
+++ b/src/plugins/meson-templates/resources/src/hello.c
@@ -0,0 +1,4 @@
+{{include "license.c"}}
+
+#include "{{prefix}}.h"
+
diff --git a/src/plugins/meson-templates/resources/src/meson-clib.build 
b/src/plugins/meson-templates/resources/src/meson-clib.build
index c9d5cd5fc..af5b27723 100644
--- a/src/plugins/meson-templates/resources/src/meson-clib.build
+++ b/src/plugins/meson-templates/resources/src/meson-clib.build
@@ -1,7 +1,7 @@
 api_version = '0.1'
 
 {{name_}}_sources = [
-
+  '{{name}}.c',
 ]
 
 {{name_}}_headers = [


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]