From 65ba3986cc91a65191914463f12ef3770d044dff Mon Sep 17 00:00:00 2001 From: Andreas Schaeffer Date: Sun, 27 Apr 2025 14:32:38 +0200 Subject: [PATCH 1/3] Cleanup unused dependencies --- Cargo.lock | 10 ------ Cargo.toml | 33 ------------------- plugins/graphql-client/Cargo.toml | 5 --- .../graphql-schema-visualization/Cargo.toml | 5 --- 4 files changed, 53 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ded3fd8..022c080 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1195,17 +1195,12 @@ name = "reactive-graph-tooling-graphql-client" version = "0.10.0" dependencies = [ "async-trait", - "dashmap", "http", "log", "log4rs", "mime_guess", - "reactive-graph-config-model", - "reactive-graph-graph", "reactive-graph-plugin-api", "rust-embed", - "serde", - "serde_json", "springtime-di", "static-files", "uuid", @@ -1216,17 +1211,12 @@ name = "reactive-graph-tooling-graphql-schema-visualization" version = "0.10.0" dependencies = [ "async-trait", - "dashmap", "http", "log", "log4rs", "mime_guess", - "reactive-graph-config-model", - "reactive-graph-graph", "reactive-graph-plugin-api", "rust-embed", - "serde", - "serde_json", "springtime-di", "static-files", "uuid", diff --git a/Cargo.toml b/Cargo.toml index ae4a1d7..d02f711 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,50 +18,17 @@ keywords = ["graph", "reactive", "control-flow", "inexor"] rust-version = "1.85.0" [workspace.dependencies] -#angular-units = "0.2.4" -#async-std = "1.12" async-trait = "0.1" -#base64 = "0.22" -#chrono = "0.4" -#crossbeam = "0.8" -dashmap = { version = "6.0", features = ["serde"] } -#data-url = "0.3" -#default-test = "0.1" -#git2 = "0.20" http = "0.2" -#humantime = "2.1" -#infer = "0.19" -#json5 = "0.4" -#lazy_static = "1.4" -#license = "3.0" log = { version = "0.4", features = ["std", "serde"] } log4rs = { version = "1.2", features = ["console_appender", "file_appender", "toml_format"] } -#matchit = "0.8" mime_guess = "2.0" -#notify = { version = "8.0", features = ["serde", "crossbeam-channel"] } -#num-traits = "0.2" -#paste = "1.0" -#prisma = "0.1.1" -#rand = "0.9" -#rand_chacha = "0.9" -#random-string = "1.0" rust-embed = { version = "8.0", features = ["debug-embed", "compression"] } -#rustc_version = "0.4" -#semver = "1.0" serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" springtime = "1.0" springtime-di = { version = "1.0", default-features = false, features = ["threadsafe", "derive"] } -#shellexpand = "3.0" -#strum = { version = "0.27", features = ["derive"] } -#strum_macros = "0.27" -#tera = "1" -#thiserror = "2.0" toml = "0.8" -#ureq = { version = "2.4", features = ["json"] } -#url = "2.3" uuid = { version = "1.2", features = ["serde", "v4", "v5"] } -#voca_rs = "1" ### Prefer git to crates.io for development diff --git a/plugins/graphql-client/Cargo.toml b/plugins/graphql-client/Cargo.toml index 784a987..462bb4f 100644 --- a/plugins/graphql-client/Cargo.toml +++ b/plugins/graphql-client/Cargo.toml @@ -20,19 +20,14 @@ assets = [ [dependencies] async-trait = { workspace = true } -dashmap = { workspace = true } http = { workspace = true } log = { workspace = true, features = ["std", "serde"] } log4rs = { workspace = true, features = ["console_appender", "file_appender", "toml_format"] } mime_guess = { workspace = true } rust-embed = { workspace = true, features = ["debug-embed", "compression"] } -serde = { workspace = true, features = ["derive"] } -serde_json = { workspace = true } springtime-di = { workspace = true, default-features = false, features = ["threadsafe", "derive"] } uuid = { workspace = true, features = ["serde", "v4"] } -reactive-graph-config-model = { workspace = true } -reactive-graph-graph = { workspace = true } reactive-graph-plugin-api = { workspace = true } [build-dependencies] diff --git a/plugins/graphql-schema-visualization/Cargo.toml b/plugins/graphql-schema-visualization/Cargo.toml index 2df2763..1c7d473 100644 --- a/plugins/graphql-schema-visualization/Cargo.toml +++ b/plugins/graphql-schema-visualization/Cargo.toml @@ -20,19 +20,14 @@ assets = [ [dependencies] async-trait = { workspace = true } -dashmap = { workspace = true } http = { workspace = true } log = { workspace = true, features = ["std", "serde"] } log4rs = { workspace = true, features = ["console_appender", "file_appender", "toml_format"] } mime_guess = { workspace = true } rust-embed = { workspace = true, features = ["debug-embed", "compression"] } -serde = { workspace = true, features = ["derive"] } -serde_json = { workspace = true } springtime-di = { workspace = true, default-features = false, features = ["threadsafe", "derive"] } uuid = { workspace = true } -reactive-graph-config-model = { workspace = true } -reactive-graph-graph = { workspace = true } reactive-graph-plugin-api = { workspace = true } [build-dependencies] From cd7e0241618759c85c12e44dc42402df55a01577 Mon Sep 17 00:00:00 2001 From: Andreas Schaeffer Date: Sun, 27 Apr 2025 14:33:51 +0200 Subject: [PATCH 2/3] Cleanup unused dependencies --- Cargo.toml | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d02f711..b10545a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,40 +32,11 @@ uuid = { version = "1.2", features = ["serde", "v4", "v5"] } ### Prefer git to crates.io for development -reactive-graph-behaviour-model-api = { version = "0.10.0", git = "https://github.com/reactive-graph/reactive-graph.git" } -reactive-graph-behaviour-model-impl = { version = "0.10.0", git = "https://github.com/reactive-graph/reactive-graph.git" } -reactive-graph-behaviour-service-api = { version = "0.10.0", git = "https://github.com/reactive-graph/reactive-graph.git" } -reactive-graph-config-model = { version = "0.10.0", git = "https://github.com/reactive-graph/reactive-graph.git" } -reactive-graph-graph = { version = "0.10.0", git = "https://github.com/reactive-graph/reactive-graph.git" } -reactive-graph-runtime-model = { version = "0.10.0", git = "https://github.com/reactive-graph/reactive-graph.git" } reactive-graph-plugin-api = { version = "0.10.0", git = "https://github.com/reactive-graph/reactive-graph.git" } -reactive-graph-plugin-derive = { version = "0.10.0", git = "https://github.com/reactive-graph/reactive-graph.git" } -reactive-graph-reactive-model-api = { version = "0.10.0", git = "https://github.com/reactive-graph/reactive-graph.git" } -reactive-graph-reactive-model-impl = { version = "0.10.0", git = "https://github.com/reactive-graph/reactive-graph.git" } -reactive-graph-reactive-service-api = { version = "0.10.0", git = "https://github.com/reactive-graph/reactive-graph.git", features = ["derive"] } -reactive-graph-reactive-service-impl = { version = "0.10.0", git = "https://github.com/reactive-graph/reactive-graph.git" } -reactive-graph-type-system-api = { version = "0.10.0", git = "https://github.com/reactive-graph/reactive-graph.git", features = ["json5", "toml"] } -reactive-graph-lifecycle = { version = "0.10.0", git = "https://github.com/reactive-graph/reactive-graph.git" } -reactive-graph-test-utils = { version = "0.10.0", git = "https://github.com/reactive-graph/reactive-graph.git" } ### Prefer local to git for local development -#reactive-graph-behaviour-model-api = { version = "0.10.0", path = "../inexor-rgf/crates/behaviour/model/api" } -#reactive-graph-behaviour-model-impl = { version = "0.10.0", path = "../inexor-rgf/crates/behaviour/model/impl" } -#reactive-graph-behaviour-service-api = { version = "0.10.0", path = "../inexor-rgf/crates/behaviour/service/api" } -#reactive-graph-config-model = { version = "0.10.0", path = "../inexor-rgf/crates/config/model" } -#reactive-graph-graph = { version = "0.10.0", path = "../inexor-rgf/crates/graph" } #reactive-graph-plugin-api = { version = "0.10.0", path = "../inexor-rgf/crates/plugin/api" } -#reactive-graph-plugin-derive = { version = "0.10.0", path = "../inexor-rgf/crates/plugin/derive" } -#reactive-graph-reactive-model-api = { version = "0.10.0", path = "../inexor-rgf/crates/reactive/model/api" } -#reactive-graph-reactive-model-impl = { version = "0.10.0", path = "../inexor-rgf/crates/reactive/model/impl" } -#reactive-graph-reactive-service-api = { version = "0.10.0", path = "../inexor-rgf/crates/reactive/service/api", features = ["derive"] } -#reactive-graph-reactive-service-impl = { version = "0.10.0", path = "../inexor-rgf/crates/reactive/service/impl" } -#reactive-graph-runtime-api = { version = "0.10.0", path = "../inexor-rgf/crates/runtime/api" } -#reactive-graph-runtime-model = { version = "0.10.0", path = "../inexor-rgf/crates/runtime/model" } -#reactive-graph-type-system-api = { version = "0.10.0", path = "../inexor-rgf/crates/type-system/api", features = ["json5", "toml"] } -#reactive-graph-lifecycle = { version = "0.10.0", path = "../inexor-rgf/crates/lifecycle" } -#reactive-graph-test-utils = { version = "0.10.0", path = "../inexor-rgf/crates/test-utils" } [profile.dev] opt-level = 0 From 6600d5e19d9738b7931096aa39cd6d9888fed4f5 Mon Sep 17 00:00:00 2001 From: Andreas Schaeffer Date: Sun, 27 Apr 2025 17:59:00 +0200 Subject: [PATCH 3/3] Refactored plugin deployment --- .deployment.toml | 2 +- .github/workflows/release.yml | 39 ++++++++++++++--- CHANGELOG.md | 1 + Cargo.lock | 42 +++++++++--------- Cargo.toml | 1 + plugins/graphql-client/Cargo.toml | 4 +- plugins/graphql-client/post_build.rs | 43 ++----------------- .../graphql-schema-visualization/Cargo.toml | 4 +- .../post_build.rs | 43 ++----------------- 9 files changed, 64 insertions(+), 115 deletions(-) diff --git a/.deployment.toml b/.deployment.toml index 8a9691a..86fede1 100644 --- a/.deployment.toml +++ b/.deployment.toml @@ -1,3 +1,3 @@ target_dirs = [ - "../inexor-rgf/plugins/deploy" + "/home/aschaeffer/RustroverProjects/reactive-graph/plugins/deploy" ] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 99b4f7d..4806c5b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -73,59 +73,79 @@ jobs: strategy: fail-fast: false matrix: - build_tool: [ "" ] include: # Tier 1 # ARM64 Linux (kernel 4.1, glibc 2.17+) - target: aarch64-unknown-linux-gnu os: ubuntu-22.04-arm + build_tool: cargo + include-files: | + target/release/libreactive_graph_tooling_graphql_client.so, + target/release/libreactive_graph_tooling_graphql_schema_visualization.so # ARM64 macOS (11.0+, Big Sur+) - target: aarch64-apple-darwin os: macos-latest + build_tool: cargo # 32-bit Linux (kernel 3.2+, glibc 2.17+) 1 - target: i686-unknown-linux-gnu os: ubuntu-22.04 + build_tool: cross + include-files: | + target/release/libreactive_graph_tooling_graphql_client.so, + target/release/libreactive_graph_tooling_graphql_schema_visualization.so # 64-bit macOS (10.12+, Sierra+) - target: x86_64-apple-darwin os: macos-latest + build_tool: cross # 64-bit MinGW (Windows 10+, Windows Server 2016+) - target: x86_64-pc-windows-gnu os: ubuntu-22.04 + build_tool: cross # 64-bit MSVC (Windows 10+, Windows Server 2016+) - target: x86_64-pc-windows-msvc os: windows-latest + build_tool: cargo # 64-bit Linux (kernel 3.2+, glibc 2.17+) - target: x86_64-unknown-linux-gnu os: ubuntu-22.04 + build_tool: cargo # Universal macOS binary is supported as universal-apple-darwin. - target: universal-apple-darwin os: macos-latest + build_tool: cargo # Tier 2 # ARM64 Linux with musl 1.2.3 - target: aarch64-unknown-linux-musl os: ubuntu-24.04-arm - build_tool: cargo + build_tool: cross # Armv7-A Linux, hardfloat (kernel 3.2, glibc 2.17) - target: armv7-unknown-linux-gnueabihf os: ubuntu-24.04-arm + build_tool: cross # Armv7-A Linux with musl 1.2.3, hardfloat - target: armv7-unknown-linux-musleabihf os: ubuntu-24.04-arm + build_tool: cross # 64-bit Linux with musl 1.2.3 - target: x86_64-unknown-linux-musl os: ubuntu-22.04 + build_tool: cross # PowerPC Linux (kernel 3.2, glibc 2.17) - target: powerpc-unknown-linux-gnu os: ubuntu-22.04 + build_tool: cross # PPC64 Linux (kernel 3.2, glibc 2.17) - target: powerpc64-unknown-linux-gnu os: ubuntu-22.04 + build_tool: cross # PPC64LE Linux (kernel 3.10, glibc 2.17) - target: powerpc64le-unknown-linux-gnu os: ubuntu-24.04 + build_tool: cross # RISC-V Linux (kernel 4.20, glibc 2.29) - target: riscv64gc-unknown-linux-gnu os: ubuntu-22.04 + build_tool: cross runs-on: ${{ matrix.os }} steps: - name: VCS Checkout @@ -235,19 +255,24 @@ jobs: - name: Upload Nightly Binary uses: taiki-e/upload-rust-binary-action@v1 with: - bin: | - libreactive_graph_tooling_graphql_client, - libreactive_graph_tooling_graphql_schema_visualization + bin: error target: ${{ matrix.target }} build-tool: ${{ matrix.build_tool }} archive: 'reactive-graph-tooling-nightly-$target' - include: LICENSE.md,README.md,CHANGELOG.md,CODE_OF_CONDUCT.md,CONTRIBUTING.md,SECURITY.md + include: | + ${{ matrix.include-files }} + LICENSE.md, + README.md, + CHANGELOG.md, + CODE_OF_CONDUCT.md, + CONTRIBUTING.md, + SECURITY.md, tar: unix zip: windows leading_dir: true token: ${{ secrets.GITHUB_TOKEN }} ref: refs/tags/nightly - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' || github.ref == 'refs/tags/nightly' debian-package: name: Publish debian package strategy: diff --git a/CHANGELOG.md b/CHANGELOG.md index 419541f..41065d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,5 +22,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Infrastructure +- Build System: Refactored plugin deployment - CI: Synchronize labels from config file - CI: Publish binary packages and debian packages diff --git a/Cargo.lock b/Cargo.lock index 022c080..711578a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -991,7 +991,7 @@ dependencies = [ [[package]] name = "reactive-graph-behaviour-model-api" version = "0.10.0" -source = "git+https://github.com/reactive-graph/reactive-graph.git#84458193b243ce007c0be495abfcd684fd27dc09" +source = "git+https://github.com/reactive-graph/reactive-graph.git#66fd4c117753372d48681bf1081941a50b08d6c9" dependencies = [ "dashmap", "reactive-graph-graph", @@ -1006,7 +1006,7 @@ dependencies = [ [[package]] name = "reactive-graph-behaviour-service-api" version = "0.10.0" -source = "git+https://github.com/reactive-graph/reactive-graph.git#84458193b243ce007c0be495abfcd684fd27dc09" +source = "git+https://github.com/reactive-graph/reactive-graph.git#66fd4c117753372d48681bf1081941a50b08d6c9" dependencies = [ "async-trait", "reactive-graph-behaviour-model-api", @@ -1021,7 +1021,7 @@ dependencies = [ [[package]] name = "reactive-graph-command-model" version = "0.10.0" -source = "git+https://github.com/reactive-graph/reactive-graph.git#84458193b243ce007c0be495abfcd684fd27dc09" +source = "git+https://github.com/reactive-graph/reactive-graph.git#66fd4c117753372d48681bf1081941a50b08d6c9" dependencies = [ "clap", "lazy_static", @@ -1039,7 +1039,7 @@ dependencies = [ [[package]] name = "reactive-graph-config-model" version = "0.10.0" -source = "git+https://github.com/reactive-graph/reactive-graph.git#84458193b243ce007c0be495abfcd684fd27dc09" +source = "git+https://github.com/reactive-graph/reactive-graph.git#66fd4c117753372d48681bf1081941a50b08d6c9" dependencies = [ "num_cpus", "reactive-graph-remotes-model", @@ -1049,7 +1049,7 @@ dependencies = [ [[package]] name = "reactive-graph-graph" version = "0.10.0" -source = "git+https://github.com/reactive-graph/reactive-graph.git#84458193b243ce007c0be495abfcd684fd27dc09" +source = "git+https://github.com/reactive-graph/reactive-graph.git#66fd4c117753372d48681bf1081941a50b08d6c9" dependencies = [ "dashmap", "schemars", @@ -1064,7 +1064,7 @@ dependencies = [ [[package]] name = "reactive-graph-lifecycle" version = "0.10.0" -source = "git+https://github.com/reactive-graph/reactive-graph.git#84458193b243ce007c0be495abfcd684fd27dc09" +source = "git+https://github.com/reactive-graph/reactive-graph.git#66fd4c117753372d48681bf1081941a50b08d6c9" dependencies = [ "async-trait", ] @@ -1072,7 +1072,7 @@ dependencies = [ [[package]] name = "reactive-graph-plugin-api" version = "0.10.0" -source = "git+https://github.com/reactive-graph/reactive-graph.git#84458193b243ce007c0be495abfcd684fd27dc09" +source = "git+https://github.com/reactive-graph/reactive-graph.git#66fd4c117753372d48681bf1081941a50b08d6c9" dependencies = [ "async-trait", "http", @@ -1097,12 +1097,12 @@ dependencies = [ [[package]] name = "reactive-graph-plugin-derive" version = "0.10.0" -source = "git+https://github.com/reactive-graph/reactive-graph.git#84458193b243ce007c0be495abfcd684fd27dc09" +source = "git+https://github.com/reactive-graph/reactive-graph.git#66fd4c117753372d48681bf1081941a50b08d6c9" [[package]] name = "reactive-graph-reactive-derive" version = "0.10.0" -source = "git+https://github.com/reactive-graph/reactive-graph.git#84458193b243ce007c0be495abfcd684fd27dc09" +source = "git+https://github.com/reactive-graph/reactive-graph.git#66fd4c117753372d48681bf1081941a50b08d6c9" dependencies = [ "darling", "proc-macro2", @@ -1113,7 +1113,7 @@ dependencies = [ [[package]] name = "reactive-graph-reactive-model-api" version = "0.10.0" -source = "git+https://github.com/reactive-graph/reactive-graph.git#84458193b243ce007c0be495abfcd684fd27dc09" +source = "git+https://github.com/reactive-graph/reactive-graph.git#66fd4c117753372d48681bf1081941a50b08d6c9" dependencies = [ "reactive-graph-graph", "serde_json", @@ -1124,7 +1124,7 @@ dependencies = [ [[package]] name = "reactive-graph-reactive-model-impl" version = "0.10.0" -source = "git+https://github.com/reactive-graph/reactive-graph.git#84458193b243ce007c0be495abfcd684fd27dc09" +source = "git+https://github.com/reactive-graph/reactive-graph.git#66fd4c117753372d48681bf1081941a50b08d6c9" dependencies = [ "dashmap", "reactive-graph-behaviour-model-api", @@ -1139,7 +1139,7 @@ dependencies = [ [[package]] name = "reactive-graph-reactive-service-api" version = "0.10.0" -source = "git+https://github.com/reactive-graph/reactive-graph.git#84458193b243ce007c0be495abfcd684fd27dc09" +source = "git+https://github.com/reactive-graph/reactive-graph.git#66fd4c117753372d48681bf1081941a50b08d6c9" dependencies = [ "async-trait", "crossbeam", @@ -1163,7 +1163,7 @@ dependencies = [ [[package]] name = "reactive-graph-remotes-model" version = "0.10.0" -source = "git+https://github.com/reactive-graph/reactive-graph.git#84458193b243ce007c0be495abfcd684fd27dc09" +source = "git+https://github.com/reactive-graph/reactive-graph.git#66fd4c117753372d48681bf1081941a50b08d6c9" dependencies = [ "chrono", "serde", @@ -1173,7 +1173,7 @@ dependencies = [ [[package]] name = "reactive-graph-runtime-model" version = "0.10.0" -source = "git+https://github.com/reactive-graph/reactive-graph.git#84458193b243ce007c0be495abfcd684fd27dc09" +source = "git+https://github.com/reactive-graph/reactive-graph.git#66fd4c117753372d48681bf1081941a50b08d6c9" dependencies = [ "reactive-graph-graph", "serde", @@ -1184,7 +1184,7 @@ dependencies = [ [[package]] name = "reactive-graph-serde" version = "0.10.0" -source = "git+https://github.com/reactive-graph/reactive-graph.git#84458193b243ce007c0be495abfcd684fd27dc09" +source = "git+https://github.com/reactive-graph/reactive-graph.git#66fd4c117753372d48681bf1081941a50b08d6c9" dependencies = [ "serde_json", "thiserror 2.0.12", @@ -1225,7 +1225,7 @@ dependencies = [ [[package]] name = "reactive-graph-type-system-api" version = "0.10.0" -source = "git+https://github.com/reactive-graph/reactive-graph.git#84458193b243ce007c0be495abfcd684fd27dc09" +source = "git+https://github.com/reactive-graph/reactive-graph.git#66fd4c117753372d48681bf1081941a50b08d6c9" dependencies = [ "async-trait", "reactive-graph-graph", @@ -1243,7 +1243,7 @@ dependencies = [ [[package]] name = "reactive-graph-type-system-derive" version = "0.10.0" -source = "git+https://github.com/reactive-graph/reactive-graph.git#84458193b243ce007c0be495abfcd684fd27dc09" +source = "git+https://github.com/reactive-graph/reactive-graph.git#66fd4c117753372d48681bf1081941a50b08d6c9" dependencies = [ "darling", "proc-macro2", @@ -1722,18 +1722,18 @@ dependencies = [ [[package]] name = "typed-builder" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd9d30e3a08026c78f246b173243cf07b3696d274debd26680773b6773c2afc7" +checksum = "ce63bcaf7e9806c206f7d7b9c1f38e0dce8bb165a80af0898161058b19248534" dependencies = [ "typed-builder-macro", ] [[package]] name = "typed-builder-macro" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c36781cc0e46a83726d9879608e4cf6c2505237e263a8eb8c24502989cfdb28" +checksum = "60d8d828da2a3d759d3519cdf29a5bac49c77d039ad36d0782edadbf9cd5415b" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index b10545a..9b3e2d1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,6 +33,7 @@ uuid = { version = "1.2", features = ["serde", "v4", "v5"] } ### Prefer git to crates.io for development reactive-graph-plugin-api = { version = "0.10.0", git = "https://github.com/reactive-graph/reactive-graph.git" } +reactive-graph-utils-deployment = { version = "0.10.0", git = "https://github.com/reactive-graph/reactive-graph.git" } ### Prefer local to git for local development diff --git a/plugins/graphql-client/Cargo.toml b/plugins/graphql-client/Cargo.toml index 462bb4f..890cc41 100644 --- a/plugins/graphql-client/Cargo.toml +++ b/plugins/graphql-client/Cargo.toml @@ -40,6 +40,4 @@ static-files = "0.2.3" crate-type = ["cdylib"] [package.metadata.cargo-post.dependencies] -toml = "0.8" -serde = { version = "1.0", features = ["derive"] } -glob = "0.3" +reactive-graph-utils-deployment = { version = "0.10.0", git = "https://github.com/reactive-graph/reactive-graph.git" } diff --git a/plugins/graphql-client/post_build.rs b/plugins/graphql-client/post_build.rs index f7f7790..b8d55fc 100644 --- a/plugins/graphql-client/post_build.rs +++ b/plugins/graphql-client/post_build.rs @@ -1,42 +1,5 @@ -use serde::Deserialize; -use std::env; -use std::fs; -use std::path::PathBuf; +use reactive_graph_utils_deployment::deploy_plugin; -#[derive(Deserialize)] -struct Deployment { - pub target_dirs: Vec, -} - -fn main() { - match fs::read_to_string("./.deployment.toml") { - Ok(toml_string) => { - let deployment: Result = toml::from_str(&toml_string); - match deployment { - Ok(deployment) => { - let mut crate_out_dir = env::var("CRATE_OUT_DIR").unwrap(); - crate_out_dir.push_str("/libreactive_graph_tooling_graphql_client.*"); - for target_dir in deployment.target_dirs { - for entry in glob::glob(crate_out_dir.as_str()).unwrap() { - if let Ok(source_path) = entry { - let file_name = source_path.file_name().unwrap().to_str().unwrap(); - if file_name.ends_with(".so") || file_name.ends_with(".dll") { - let mut target_path = PathBuf::from(&target_dir); - target_path.push(file_name); - println!("Copy plugin from {} to {}", source_path.display(), target_path.display()); - let _ = fs::copy(source_path, target_path); - } - } - } - } - } - Err(e) => { - eprintln!("Failed to parse .deployment.toml: {}", e); - } - } - } - Err(e) => { - eprintln!("Could not read .deployment.toml: {}", e); - } - } +fn main() -> Result<(), Box> { + Ok(deploy_plugin("libreactive_graph_tooling_graphql_client.*")?) } diff --git a/plugins/graphql-schema-visualization/Cargo.toml b/plugins/graphql-schema-visualization/Cargo.toml index 1c7d473..bf5c8d8 100644 --- a/plugins/graphql-schema-visualization/Cargo.toml +++ b/plugins/graphql-schema-visualization/Cargo.toml @@ -40,6 +40,4 @@ static-files = "0.2.3" crate-type = ["cdylib"] [package.metadata.cargo-post.dependencies] -toml = "0.8" -serde = { version = "1.0", features = ["derive"] } -glob = "0.3" +reactive-graph-utils-deployment = { version = "0.10.0", git = "https://github.com/reactive-graph/reactive-graph.git" } diff --git a/plugins/graphql-schema-visualization/post_build.rs b/plugins/graphql-schema-visualization/post_build.rs index f719ca4..246a412 100644 --- a/plugins/graphql-schema-visualization/post_build.rs +++ b/plugins/graphql-schema-visualization/post_build.rs @@ -1,42 +1,5 @@ -use serde::Deserialize; -use std::env; -use std::fs; -use std::path::PathBuf; +use reactive_graph_utils_deployment::deploy_plugin; -#[derive(Deserialize)] -struct Deployment { - pub target_dirs: Vec, -} - -fn main() { - match fs::read_to_string("./.deployment.toml") { - Ok(toml_string) => { - let deployment: Result = toml::from_str(&toml_string); - match deployment { - Ok(deployment) => { - let mut crate_out_dir = env::var("CRATE_OUT_DIR").unwrap(); - crate_out_dir.push_str("/libreactive_graph_tooling_graphql_schema_visualization.*"); - for target_dir in deployment.target_dirs { - for entry in glob::glob(crate_out_dir.as_str()).unwrap() { - if let Ok(source_path) = entry { - let file_name = source_path.file_name().unwrap().to_str().unwrap(); - if file_name.ends_with(".so") || file_name.ends_with(".dll") { - let mut target_path = PathBuf::from(&target_dir); - target_path.push(file_name); - println!("Copy plugin from {} to {}", source_path.display(), target_path.display()); - let _ = fs::copy(source_path, target_path); - } - } - } - } - } - Err(e) => { - eprintln!("Failed to parse .deployment.toml: {}", e); - } - } - } - Err(e) => { - eprintln!("Could not read .deployment.toml: {}", e); - } - } +fn main() -> Result<(), Box> { + Ok(deploy_plugin("libreactive_graph_tooling_graphql_schema_visualization.*")?) }