Skip to content

Commit

Permalink
Prebuild ui files
Browse files Browse the repository at this point in the history
  • Loading branch information
SubhadeepJasu committed Feb 6, 2025
1 parent 86d96cb commit c58bf79
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 21 deletions.
47 changes: 27 additions & 20 deletions data/meson.build
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
sassc = find_program('sassc')

sassc_opts = [ '-a', '-M', '-t', 'compact' ]

stylesheet_deps = custom_target(
'style.scss',
input: 'style.scss',
output: 'style.css',
command: [
sassc,
sassc_opts,
'@INPUT@',
'@OUTPUT@',
],
install: true,
install_dir: get_option('datadir') / meson.project_name()
)

blueprint_files = [
'ui/main_window.blp',
'ui/preferences_dialog.blp',
Expand All @@ -27,15 +9,40 @@ blueprint_files = [
'ui/scientific_view.blp'
]

blueprint_compiler = find_program('blueprint-compiler')

blueprints_ui = []
bfs = []
foreach b : blueprint_files
blueprints_ui += b.replace('.blp', '.ui')
bfs += meson.current_source_dir() / b
endforeach

r = run_command('blueprint-compiler', 'batch-compile', meson.project_build_root() / 'data/ui', meson.current_source_dir() / 'ui', bfs, check: true)
r.returncode()

blueprints = custom_target('blueprints',
input: files(blueprint_files),
output: '.',
command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'],
command: [blueprint_compiler, 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'],
)

sassc = find_program('sassc')

sassc_opts = [ '-a', '-M', '-t', 'compact' ]

stylesheet_deps = custom_target(
'style.scss',
input: 'style.scss',
output: 'style.css',
command: [
sassc,
sassc_opts,
'@INPUT@',
'@OUTPUT@',
],
install: true,
install_dir: get_option('datadir') / meson.project_name()
)

gresource_bundle = gnome.compile_resources(
Expand All @@ -46,8 +53,8 @@ gresource_bundle = gnome.compile_resources(
meson.current_source_dir(),
],
dependencies: [
stylesheet_deps,
blueprints,
stylesheet_deps
],
gresource_bundle: true,
install: true,
Expand Down
1 change: 0 additions & 1 deletion data/ui/scientific_view.blp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: 2024 Subhadeep Jasu <[email protected]>
using Gtk 4.0;
using Gdk 4.0;
using Adw 1;

template $PebblesScientificView: Gtk.Grid {
Expand Down

0 comments on commit c58bf79

Please sign in to comment.