[vala/0.40] girwriter: Mention that this file is generated and not meant to be modified



commit 25a71cc17f4f230a1a23c7a37e69a6f488c69dd8
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sat Apr 27 10:25:32 2019 +0200

    girwriter: Mention that this file is generated and not meant to be modified
    
    Same as already done for generated vapi files.

 codegen/Makefile.am        | 1 +
 codegen/valagirwriter.vala | 5 +++++
 2 files changed, 6 insertions(+)
---
diff --git a/codegen/Makefile.am b/codegen/Makefile.am
index 036652ef3..7dc2d3e6c 100644
--- a/codegen/Makefile.am
+++ b/codegen/Makefile.am
@@ -68,6 +68,7 @@ codegen.vapi codegen.vala.stamp: $(libvalaccodegen_la_VALASOURCES)
                --vapidir $(top_srcdir)/gee --pkg gee \
                --vapidir $(top_srcdir)/ccode --pkg ccode \
                --vapidir $(top_srcdir)/vala --pkg vala \
+               --pkg config \
                --use-header \
                -H valacodegen.h \
                --library codegen \
diff --git a/codegen/valagirwriter.vala b/codegen/valagirwriter.vala
index e9b7718c7..f5d8eb8cd 100644
--- a/codegen/valagirwriter.vala
+++ b/codegen/valagirwriter.vala
@@ -171,6 +171,11 @@ public class Vala.GIRWriter : CodeVisitor {
 
                stream.printf ("<?xml version=\"1.0\"?>\n");
 
+               var header = context.version_header ?
+                       "<!-- %s generated by %s %s, do not modify. -->".printf (Path.get_basename 
(filename), Environment.get_prgname (), Config.BUILD_VERSION) :
+                       "<!-- %s generated by %s, do not modify. -->".printf (Path.get_basename (filename), 
Environment.get_prgname ());
+               stream.printf ("%s\n", header);
+
                stream.printf ("<repository version=\"1.2\"");
                stream.printf (" xmlns=\"http://www.gtk.org/introspection/core/1.0\"";);
                stream.printf (" xmlns:c=\"http://www.gtk.org/introspection/c/1.0\"";);


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