Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove support for overriding target/ directory #853

Merged
merged 2 commits into from
Jul 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion crates/fj-app/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use serde::Deserialize;
pub struct Config {
pub default_path: Option<PathBuf>,
pub default_model: Option<PathBuf>,
pub target_dir: Option<PathBuf>,
}

impl Config {
Expand Down
2 changes: 1 addition & 1 deletion crates/fj-app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fn main() -> anyhow::Result<()> {
})?;
path.push(model);

let model = Model::from_path(path.clone(), config.target_dir)
let model = Model::from_path(path.clone())
.with_context(|| format!("Failed to load model: {}", path.display()))?;
let parameters = args.parameters.unwrap_or_else(Parameters::empty);

Expand Down
9 changes: 3 additions & 6 deletions crates/fj-host/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ impl Model {
/// Optionally, the target directory where plugin files are compiled to can
/// be provided. If it is not provided, the target directory is assumed to
/// be located within the model path.
pub fn from_path(
path: PathBuf,
target_dir: Option<PathBuf>,
) -> Result<Self, Error> {
pub fn from_path(path: PathBuf) -> Result<Self, Error> {
let crate_dir = path.canonicalize()?;

let metadata = cargo_metadata::MetadataCommand::new()
Expand All @@ -63,8 +60,8 @@ impl Model {
let lib_path = {
let name = pkg.name.replace('-', "_");
let file = HostPlatform::lib_file_name(&name);
let target_dir = target_dir
.unwrap_or_else(|| metadata.target_directory.clone().into());
let target_dir =
metadata.target_directory.clone().into_std_path_buf();
target_dir.join("debug").join(file)
};

Expand Down
4 changes: 0 additions & 4 deletions fj.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,3 @@ default_path = "models"
# The default models that is loaded, if none is specified. If this is a relative
# path, it should be relative to `default_path`.
default_model = "test"

# The `target/` directory, where compiled model libraries are located. By
# default, this is expected to be in the model directory.
target_dir = "target"