Skip to content

Commit

Permalink
Merge pull request #5 from p2panda/workspace
Browse files Browse the repository at this point in the history
Restructure project into workspace for better codebase separation
  • Loading branch information
adzialocha authored Dec 14, 2024
2 parents 059e876 + 43c72e1 commit 058c9ca
Show file tree
Hide file tree
Showing 32 changed files with 100 additions and 89 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ jobs:
- name: Compile GResource
run: |
mkdir -p target/${{ matrix.target }}/release/
glib-compile-resources --sourcedir src --target target/${{ matrix.target }}/release/aardvark.gresource src/aardvark.gresource.xml
glib-compile-resources --sourcedir aardvark-app/src --target target/${{ matrix.target }}/release/aardvark.gresource aardvark-app/src/aardvark.gresource.xml
- name: Create App Bundle
run: |
Expand Down
96 changes: 48 additions & 48 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 3 additions & 27 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
[package]
name = "aardvark"
version = "0.1.0"
edition = "2021"

[dependencies]
anyhow = "1.0.94"
async-trait = "0.1.83"
automerge = "0.5.12"
ciborium = "0.2.2"
gettext-rs = { version = "0.7", features = ["gettext-system"] }
gtk = { version = "0.9", package = "gtk4", features = ["gnome_47"] }
p2panda-core = "0.1.0"
p2panda-discovery = { version = "0.1.0", features = ["mdns"] }
p2panda-net = "0.1.0"
p2panda-store = "0.1.0"
p2panda-stream = "0.1.0"
p2panda-sync = { version = "0.1.0", features = ["log-sync"] }
serde = { version = "1.0.215", features = ["derive"] }
serde_json = "1.0.128"
tokio = { version = "1.42.0", features = ["full"] }
tokio-stream = "0.1.17"

[dependencies.adw]
package = "libadwaita"
version = "0.7"
features = ["v1_6"]
[workspace]
resolver = "2"
members = ["aardvark-app", "aardvark-node"]
19 changes: 19 additions & 0 deletions aardvark-app/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "aardvark"
version = "0.1.0"
edition = "2021"

[dependencies]
aardvark-node = { path = "../aardvark-node" }
anyhow = "1.0.94"
automerge = "0.5.12"
gettext-rs = { version = "0.7", features = ["gettext-system"] }
gtk = { version = "0.9", package = "gtk4", features = ["gnome_47"] }
serde = { version = "1.0.215", features = ["derive"] }
serde_json = "1.0.128"
tokio = { version = "1.42.0", features = ["full"] }

[dependencies.adw]
package = "libadwaita"
version = "0.7"
features = ["v1_6"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/application.rs → aardvark-app/src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

use std::cell::{OnceCell, RefCell};

use aardvark_node::network;
use adw::prelude::*;
use adw::subclass::prelude::*;
use gettextrs::gettext;
Expand All @@ -29,7 +30,6 @@ use tokio::sync::{mpsc, oneshot};
use crate::config::VERSION;
use crate::document::Document;
use crate::glib::closure_local;
use crate::network;
use crate::{AardvarkTextBuffer, AardvarkWindow};

mod imp {
Expand Down
1 change: 1 addition & 0 deletions src/config.rs → aardvark-app/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pub static VERSION: &str = "0.1.0";
pub static GETTEXT_PACKAGE: &str = "aardvark";
pub static LOCALEDIR: &str = "/app/share/locale";
pub static PKGDATADIR: &str = "/app/share/aardvark";
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions src/main.rs → aardvark-app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
mod application;
mod config;
mod document;
mod network;
mod operation;
mod textbuffer;
mod window;

Expand Down
8 changes: 4 additions & 4 deletions src/meson.build → aardvark-app/src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ configure_file(
# Copy the config.rs output to the source directory.
run_command(
'cp',
meson.project_build_root() / 'src' / 'config.rs',
meson.project_source_root() / 'src' / 'config.rs',
meson.project_build_root() / 'aardvark-app/src' / 'config.rs',
meson.project_source_root() / 'aardvark-app/src' / 'config.rs',
check: true
)

cargo_bin = find_program('cargo')
cargo_opt = [ '--manifest-path', meson.project_source_root() / 'Cargo.toml' ]
cargo_opt += [ '--target-dir', meson.project_build_root() / 'src' ]
cargo_opt += [ '--target-dir', meson.project_build_root() / 'aardvark-app/src' ]
cargo_env = [ 'CARGO_HOME=' + meson.project_build_root() / 'cargo-home' ]

if get_option('buildtype') == 'release'
Expand All @@ -51,6 +51,6 @@ cargo_build = custom_target(
command: [
'env', cargo_env,
cargo_bin, 'build',
cargo_opt, '&&', 'cp', 'src' / rust_target / meson.project_name(), '@OUTPUT@',
cargo_opt, '&&', 'cp', 'aardvark-app/src' / rust_target / meson.project_name(), '@OUTPUT@',
]
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 058c9ca

Please sign in to comment.