Skip to content

Commit

Permalink
re-use config from lib in build script
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianLars committed Jul 19, 2023
1 parent 32d067d commit 2a7bffb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
14 changes: 3 additions & 11 deletions plugins/deep-link/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,9 @@
use serde::Deserialize;
use std::process::exit;

#[derive(Deserialize)]
struct AssociatedDomain {
host: String,
#[serde(default, alias = "path-prefix", rename = "pathPrefix")]
path_prefix: Vec<String>,
}

#[derive(Deserialize)]
struct Config {
domains: Vec<AssociatedDomain>,
}
#[path = "src/config.rs"]
mod config;
use config::{AssociatedDomain, Config};

// TODO: Consider using activity-alias in case users may have multiple activities in their app.
// TODO: Do we want to support the other path* configs too?
Expand Down
8 changes: 5 additions & 3 deletions plugins/deep-link/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT

// This module is also imported in build.rs!

#![allow(dead_code)]

use serde::Deserialize;

#[derive(Deserialize)]
pub struct AssociatedDomain {
host: String,
pub host: String,
#[serde(default, alias = "path-prefix", rename = "pathPrefix")]
path_prefix: Vec<String>,
pub path_prefix: Vec<String>,
}

#[derive(Deserialize)]
pub struct Config {
domains: Vec<AssociatedDomain>,
pub domains: Vec<AssociatedDomain>,
}

0 comments on commit 2a7bffb

Please sign in to comment.