[gnome-builder/wip/gtk4-port] plugins/make-template: install COPYING into project template



commit 15880d7bcfcc662f3634e5817de5673dc78a0cf7
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jun 8 14:22:23 2022 -0700

    plugins/make-template: install COPYING into project template

 src/plugins/make-templates/gbp-make-template.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/src/plugins/make-templates/gbp-make-template.c b/src/plugins/make-templates/gbp-make-template.c
index 58b487a69..fc765becb 100644
--- a/src/plugins/make-templates/gbp-make-template.c
+++ b/src/plugins/make-templates/gbp-make-template.c
@@ -79,6 +79,7 @@ gbp_make_template_expand_async (IdeProjectTemplate  *template,
   g_autoptr(IdeTask) task = NULL;
   g_autoptr(GFile) destdir = NULL;
   g_autofree char *exec_name = NULL;
+  g_autofree char *license_path = NULL;
   const char *language;
   const char *name;
   GFile *directory;
@@ -108,6 +109,13 @@ gbp_make_template_expand_async (IdeProjectTemplate  *template,
   exec_name = g_strdelimit (g_strstrip (g_strdup (name)), " \t\n", '-');
   tmpl_scope_set_string (scope, "exec_name", exec_name);
 
+  if ((license_path = ide_template_input_get_license_path (input)))
+    {
+      g_autoptr(GFile) copying = g_file_get_child (destdir, "COPYING");
+      ide_template_base_add_resource (IDE_TEMPLATE_BASE (self),
+                                      license_path, copying, scope, 0);
+    }
+
   for (guint i = 0; i < G_N_ELEMENTS (mappings); i++)
     {
       g_autoptr(GFile) child = NULL;


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