[gnome-builder/wip/gtk4-port] plugins/meson-templates: more style cleanup



commit 5c7545857a3ae998e1ef0b916eb832e84a437f58
Author: Christian Hergert <chergert redhat com>
Date:   Tue Jun 7 20:47:38 2022 -0700

    plugins/meson-templates: more style cleanup
    
    The generated project is now starting to look semi-decent.

 .../resources/data/hello.desktop.in                |  3 --
 .../meson-templates/resources/data/meson.build     | 32 ++++++++++------------
 src/plugins/meson-templates/resources/po/POTFILES  | 11 ++------
 .../resources/src/hello.gresource.xml              |  4 +--
 .../resources/src/meson-c-vala.build               |  4 +--
 5 files changed, 21 insertions(+), 33 deletions(-)
---
diff --git a/src/plugins/meson-templates/resources/data/hello.desktop.in 
b/src/plugins/meson-templates/resources/data/hello.desktop.in
index 108d8099b..36d0711b3 100644
--- a/src/plugins/meson-templates/resources/data/hello.desktop.in
+++ b/src/plugins/meson-templates/resources/data/hello.desktop.in
@@ -1,10 +1,7 @@
 [Desktop Entry]
 Name={{name}}
-
 Exec={{exec_name}}
-
 Icon={{appid}}
-
 Terminal=false
 Type=Application
 Categories=GTK;
diff --git a/src/plugins/meson-templates/resources/data/meson.build 
b/src/plugins/meson-templates/resources/data/meson.build
index e37dec014..1be2d69fb 100644
--- a/src/plugins/meson-templates/resources/data/meson.build
+++ b/src/plugins/meson-templates/resources/data/meson.build
@@ -1,32 +1,28 @@
 desktop_file = i18n.merge_file(
-  input: '{{appid}}.desktop.in',
-  output: '{{appid}}.desktop',
-  type: 'desktop',
-  po_dir: '../po',
-  install: true,
+        input: '{{appid}}.desktop.in',
+       output: '{{appid}}.desktop',
+         type: 'desktop',
+       po_dir: '../po',
+      install: true,
   install_dir: join_paths(get_option('datadir'), 'applications')
 )
 
 desktop_utils = find_program('desktop-file-validate', required: false)
 if desktop_utils.found()
-  test('Validate desktop file', desktop_utils,
-    args: [desktop_file]
-  )
+  test('Validate desktop file', desktop_utils, args: [desktop_file])
 endif
 
 appstream_file = i18n.merge_file(
-  input: '{{appid}}.appdata.xml.in',
-  output: '{{appid}}.appdata.xml',
-  po_dir: '../po',
-  install: true,
+        input: '{{appid}}.appdata.xml.in',
+       output: '{{appid}}.appdata.xml',
+       po_dir: '../po',
+      install: true,
   install_dir: join_paths(get_option('datadir'), 'appdata')
 )
 
 appstream_util = find_program('appstream-util', required: false)
 if appstream_util.found()
-  test('Validate appstream file', appstream_util,
-    args: ['validate', appstream_file]
-  )
+  test('Validate appstream file', appstream_util, args: ['validate', appstream_file])
 endif
 
 install_data('{{appid}}.gschema.xml',
@@ -35,9 +31,9 @@ install_data('{{appid}}.gschema.xml',
 
 compile_schemas = find_program('glib-compile-schemas', required: false)
 if compile_schemas.found()
-  test('Validate schema file', compile_schemas,
-    args: ['--strict', '--dry-run', meson.current_source_dir()]
-  )
+  test('Validate schema file',
+       compile_schemas,
+       args: ['--strict', '--dry-run', meson.current_source_dir()])
 endif
 
 subdir('icons')
diff --git a/src/plugins/meson-templates/resources/po/POTFILES 
b/src/plugins/meson-templates/resources/po/POTFILES
index e9b7255fb..38e497942 100644
--- a/src/plugins/meson-templates/resources/po/POTFILES
+++ b/src/plugins/meson-templates/resources/po/POTFILES
@@ -1,27 +1,22 @@
 data/{{appid}}.desktop.in
 data/{{appid}}.appdata.xml.in
 data/{{appid}}.gschema.xml
-{{if ui_file}}
-src/{{ui_file}}
-
-{{end}}
 {{if language == "c"}}
 src/main.c
 src/{{prefix}}-window.c
-
 {{end}}
 {{if language == "vala"}}
 src/main.vala
 src/window.vala
-
 {{end}}
 {{if language == "javascript"}}
 src/main.js
 src/window.js
-
 {{end}}
 {{if language == "python"}}
 src/main.py
 src/window.py
-
+{{end}}
+{{if ui_file}}
+src/{{ui_file}}
 {{end}}
diff --git a/src/plugins/meson-templates/resources/src/hello.gresource.xml 
b/src/plugins/meson-templates/resources/src/hello.gresource.xml
index 198ae49fc..41902a2d5 100644
--- a/src/plugins/meson-templates/resources/src/hello.gresource.xml
+++ b/src/plugins/meson-templates/resources/src/hello.gresource.xml
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <gresources>
   <gresource prefix="{{appid_path}}">
-    <file>{{ui_file}}</file>
+    <file preprocess="xml-stripblanks">{{ui_file}}</file>
 {{if (template == "gnome-app-gtk4") || (template == "gnome-app-adwaita")}}
-    <file>gtk/help-overlay.ui</file>
+    <file preprocess="xml-stripblanks">gtk/help-overlay.ui</file>
 {{end}}
   </gresource>
 </gresources>
diff --git a/src/plugins/meson-templates/resources/src/meson-c-vala.build 
b/src/plugins/meson-templates/resources/src/meson-c-vala.build
index 63d9d3543..e1484fe4b 100644
--- a/src/plugins/meson-templates/resources/src/meson-c-vala.build
+++ b/src/plugins/meson-templates/resources/src/meson-c-vala.build
@@ -1,19 +1,19 @@
 {{name_}}_sources = [
 {{if language == "c"}}
   'main.c',
-  '{{prefix}}-window.c',
 {{if is_gtk4}}
   '{{prefix}}-application.c',
 {{end}}
+  '{{prefix}}-window.c',
 {{else if language == "c++"}}
   'main.cpp',
   '{{prefix}}-window.cpp',
 {{else if language == "vala"}}
   'main.vala',
-  'window.vala',
 {{if is_gtk4}}
   'application.vala',
 {{end}}
+  'window.vala',
 {{end}}
 ]
 


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