[vala/staging] girwriter: Mention that this file is generated and not meant to be modified
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] girwriter: Mention that this file is generated and not meant to be modified
- Date: Sat, 27 Apr 2019 10:25:05 +0000 (UTC)
commit fd3fedf3e7fd56162e5721d9e7487784b009c75b
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/valagirwriter.vala | 5 +++++
tests/girwriter/GirTest-1.0.gir-expected | 1 +
2 files changed, 6 insertions(+)
---
diff --git a/codegen/valagirwriter.vala b/codegen/valagirwriter.vala
index 4373ec8bb..c5bec0fce 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 (), Vala.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\"");
diff --git a/tests/girwriter/GirTest-1.0.gir-expected b/tests/girwriter/GirTest-1.0.gir-expected
index 052868bb6..1bad12723 100644
--- a/tests/girwriter/GirTest-1.0.gir-expected
+++ b/tests/girwriter/GirTest-1.0.gir-expected
@@ -1,4 +1,5 @@
<?xml version="1.0"?>
+<!-- GirTest-1.0.gir generated by valac, do not modify. -->
<repository version="1.2" xmlns="http://www.gtk.org/introspection/core/1.0"
xmlns:c="http://www.gtk.org/introspection/c/1.0" xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
<include name="GObject" version="2.0"/>
<include name="GLib" version="2.0"/>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]