[fractal] build: Don't use globbing to find sources
- From: Daniel Garcia Moreno <danigm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [fractal] build: Don't use globbing to find sources
- Date: Sat, 27 Apr 2019 16:40:46 +0000 (UTC)
commit c76a8b17f38a8f460c6d45750e6a23811ab1dd9d
Author: Christopher Davis <brainblasted disroot org>
Date: Mon Apr 22 12:42:07 2019 -0400
build: Don't use globbing to find sources
Previously we were using a script to grab our sources
automatically. However, this was error-prone and meson
didn't actually understand the output.
Now we declare our sources manually. This helps meson
know when to trigger a build based on what files have
changed.
fractal-gtk/src/meson.build | 86 ++++++++++++++++++++++++++++++++++++--
fractal-matrix-api/src/meson.build | 30 +++++++++++++
meson.build | 9 +++-
scripts/grabber.sh | 5 ---
4 files changed, 121 insertions(+), 9 deletions(-)
---
diff --git a/fractal-gtk/src/meson.build b/fractal-gtk/src/meson.build
index d529fb9e..a5a23ebd 100644
--- a/fractal-gtk/src/meson.build
+++ b/fractal-gtk/src/meson.build
@@ -32,12 +32,92 @@ run_command(
check: true
)
-c = run_command(grabber)
-sources = c.stdout().strip().split('\n')
+# Keep in alphabetical order
+app_sources = files(
+ 'actions/account_settings.rs',
+ 'actions/global.rs',
+ 'actions/login.rs',
+ 'actions/mod.rs',
+ 'actions/room_history.rs',
+ 'actions/room_settings.rs',
+ 'app/connect/account.rs',
+ 'app/connect/autocomplete.rs',
+ 'app/connect/direct.rs',
+ 'app/connect/directory.rs',
+ 'app/connect/headerbar.rs',
+ 'app/connect/invite.rs',
+ 'app/connect/join_room.rs',
+ 'app/connect/leave_room.rs',
+ 'app/connect/markdown.rs',
+ 'app/connect/mod.rs',
+ 'app/connect/new_room.rs',
+ 'app/connect/roomlist_search.rs',
+ 'app/connect/send.rs',
+ 'app/backend_loop.rs',
+ 'app/mod.rs',
+ 'app/windowstate.rs',
+ 'appop/about.rs',
+ 'appop/account.rs',
+ 'appop/attach.rs',
+ 'appop/directory.rs',
+ 'appop/invite.rs',
+ 'appop/login.rs',
+ 'appop/media_viewer.rs',
+ 'appop/member.rs',
+ 'appop/message.rs',
+ 'appop/mod.rs',
+ 'appop/notifications.rs',
+ 'appop/notify.rs',
+ 'appop/room.rs',
+ 'appop/room_settings.rs',
+ 'appop/start_chat.rs',
+ 'appop/state.rs',
+ 'appop/sync.rs',
+ 'appop/user.rs',
+ 'cache/mod.rs',
+ 'cache/state.rs',
+ 'widgets/address.rs',
+ 'widgets/autocomplete.rs',
+ 'widgets/avatar.rs',
+ 'widgets/divider.rs',
+ 'widgets/error_dialog.rs',
+ 'widgets/file_dialog.rs',
+ 'widgets/image.rs',
+ 'widgets/inline_player.rs',
+ 'widgets/login.rs',
+ 'widgets/media_viewer.rs',
+ 'widgets/member.rs',
+ 'widgets/members_list.rs',
+ 'widgets/message.rs',
+ 'widgets/message_menu.rs',
+ 'widgets/mod.rs',
+ 'widgets/room.rs',
+ 'widgets/room_history.rs',
+ 'widgets/roomlist.rs',
+ 'widgets/roomrow.rs',
+ 'widgets/room_history.rs',
+ 'widgets/roomlist.rs',
+ 'widgets/roomrow.rs',
+ 'widgets/room_settings.rs',
+ 'widgets/scroll_widget.rs',
+ 'widgets/source_dialog.rs',
+ 'widgets/sourceview_entry.rs',
+ 'globals.rs',
+ 'i18n.rs',
+ 'main.rs',
+ 'passwd.rs',
+ 'uibuilder.rs',
+ 'uitypes.rs',
+ 'util.rs'
+)
cargo_release = custom_target('cargo-build',
build_by_default: true,
- input: sources,
+ input: [
+ cargo_manifests,
+ api_sources,
+ app_sources,
+ ],
depends: fractal_resources,
output: ['fractal'],
install: true,
diff --git a/fractal-matrix-api/src/meson.build b/fractal-matrix-api/src/meson.build
new file mode 100644
index 00000000..8e6eea47
--- /dev/null
+++ b/fractal-matrix-api/src/meson.build
@@ -0,0 +1,30 @@
+api_sources = files(
+ 'backend/directory.rs',
+ 'backend/media.rs',
+ 'backend/mod.rs',
+ 'backend/register.rs',
+ 'backend/room.rs',
+ 'backend/stickers.rs',
+ 'backend/sync.rs',
+ 'backend/types.rs',
+ 'backend/user.rs',
+ 'model/event.rs',
+ 'model/fileinfo.rs',
+ 'model/filter.rs',
+ 'model/member.rs',
+ 'model/message.rs',
+ 'model/mod.rs',
+ 'model/protocol.rs',
+ 'model/register.rs',
+ 'model/room.rs',
+ 'model/stickers.rs',
+ 'model/sync.rs',
+ 'model/user.rs',
+ 'cache.rs',
+ 'client.rs',
+ 'error.rs',
+ 'globals.rs',
+ 'lib.rs',
+ 'types.rs',
+ 'util.rs'
+)
diff --git a/meson.build b/meson.build
index 41bed42a..0630527c 100644
--- a/meson.build
+++ b/meson.build
@@ -72,8 +72,15 @@ gresource = find_program('glib-compile-resources', required: false)
cargo_vendor = find_program('cargo-vendor', required: false)
cargo_script = find_program('scripts/cargo.sh')
test_script = find_program('scripts/test.sh')
-grabber = find_program('scripts/grabber.sh')
+cargo_manifests = files(
+ 'Cargo.toml',
+ 'Cargo.lock',
+ 'fractal-gtk/Cargo.toml',
+ 'fractal-matrix-api/Cargo.toml'
+)
+
+subdir('fractal-matrix-api/src')
subdir('fractal-gtk/src')
meson.add_dist_script(
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]