From 85561de1caa8fd10b76e96feea3b2553e7f24ee9 Mon Sep 17 00:00:00 2001 From: Gwilym Inzani Date: Sun, 23 Jul 2023 18:35:50 +0100 Subject: [PATCH] Attempt to update the tools to the new folder --- tools/src/publish.rs | 12 +++++++++--- tools/src/release.rs | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/src/publish.rs b/tools/src/publish.rs index 48d2d616..642017a0 100644 --- a/tools/src/publish.rs +++ b/tools/src/publish.rs @@ -3,7 +3,7 @@ use dependency_graph::DependencyGraph; use std::cell::RefCell; use std::collections::HashMap; use std::fs; -use std::path::Path; +use std::path::{Path, PathBuf}; use std::process::Command; use toml_edit::Document; @@ -22,6 +22,7 @@ pub enum Error { struct Package { name: String, dependencies: Vec, + directory: PathBuf, } impl dependency_graph::Node for Package { @@ -55,7 +56,11 @@ pub fn publish(matches: &ArgMatches) -> Result<(), Error> { let mut in_progress: HashMap<_, RefCell> = HashMap::new(); - let dependencies = build_dependency_graph(&root_directory)?; + let mut dependencies = build_dependency_graph(&root_directory)?; + let mut tracker_dependencies = build_dependency_graph(&root_directory.join("tracker"))?; + + dependencies.append(&mut tracker_dependencies); + let graph = DependencyGraph::from(&dependencies[..]); for package in graph { @@ -76,7 +81,7 @@ pub fn publish(matches: &ArgMatches) -> Result<(), Error> { let publish_cmd = Command::new("cargo") .arg("publish") .args(&dry_run) - .current_dir(root_directory.join(&package.name)) + .current_dir(&package.directory) .spawn() .map_err(|_| Error::PublishCrate)?; @@ -117,6 +122,7 @@ fn build_dependency_graph(root: &Path) -> Result, Error> { packages.push(Package { name: dir.file_name().to_string_lossy().to_string(), dependencies: get_agb_dependencies(&crate_path)?, + directory: crate_path, }); } diff --git a/tools/src/release.rs b/tools/src/release.rs index dbe4bb9f..ffdfe241 100644 --- a/tools/src/release.rs +++ b/tools/src/release.rs @@ -108,6 +108,7 @@ fn update_to_version( &[ "agb-*/Cargo.toml", "agb/Cargo.toml", + "tracker/agb-*/Cargo.toml", "examples/*/Cargo.toml", "book/games/*/Cargo.toml", "template/Cargo.toml",