diff --git a/crates/cli/src/commands/check.rs b/crates/cli/src/commands/check.rs index 171044356e2..8f8ae2a3f43 100644 --- a/crates/cli/src/commands/check.rs +++ b/crates/cli/src/commands/check.rs @@ -68,7 +68,7 @@ pub async fn check( for project in projects { for task in project.get_tasks()? { if task.is_build_type() || task.is_test_type() { - targets.push(TargetLocator::Target(task.target.clone())); + targets.push(TargetLocator::Qualified(task.target.clone())); } } } diff --git a/crates/core/action-context/src/lib.rs b/crates/core/action-context/src/lib.rs index 6e54e544080..3ae5fd0955a 100644 --- a/crates/core/action-context/src/lib.rs +++ b/crates/core/action-context/src/lib.rs @@ -62,8 +62,8 @@ impl ActionContext { } // :task == scope:task - for initial_target in &self.initial_targets { - if target.is_all_task(initial_target) { + for locator in &self.initial_targets { + if target.is_all_task(locator.as_str()) { return true; } } diff --git a/crates/core/dep-graph/src/dep_builder.rs b/crates/core/dep-graph/src/dep_builder.rs index 0770f050740..3da9be7a126 100644 --- a/crates/core/dep-graph/src/dep_builder.rs +++ b/crates/core/dep-graph/src/dep_builder.rs @@ -397,8 +397,8 @@ impl<'ws> DepGraphBuilder<'ws> { for locator in target_locators { let result = match locator { - TargetLocator::Target(target) => self.run_target(target, touched_files)?, - TargetLocator::Path(task_id) => { + TargetLocator::Qualified(target) => self.run_target(target, touched_files)?, + TargetLocator::TaskFromWorkingDir(task_id) => { if project.is_none() { project = Some(self.project_graph.get_from_path(&cwd)?); } diff --git a/nextgen/target/src/target_locator.rs b/nextgen/target/src/target_locator.rs index 9e7fd84d4a6..ea2b1f84bfb 100644 --- a/nextgen/target/src/target_locator.rs +++ b/nextgen/target/src/target_locator.rs @@ -5,8 +5,8 @@ use std::str::FromStr; #[derive(Clone, Debug, Eq, Hash, PartialEq)] pub enum TargetLocator { - Target(Target), - Path(Id), + Qualified(Target), // scope:task_id + TaskFromWorkingDir(Id), // task_id } impl TargetLocator { @@ -24,8 +24,8 @@ impl AsRef for TargetLocator { impl AsRef for TargetLocator { fn as_ref(&self) -> &str { match self { - Self::Target(target) => target.as_str(), - Self::Path(id) => id.as_str(), + Self::Qualified(target) => target.as_str(), + Self::TaskFromWorkingDir(id) => id.as_str(), } } } @@ -35,9 +35,9 @@ impl FromStr for TargetLocator { fn from_str(value: &str) -> Result { Ok(if value.contains(':') { - TargetLocator::Target(Target::parse(&value)?) + TargetLocator::Qualified(Target::parse(value)?) } else { - TargetLocator::Path(Id::new(&value)?) + TargetLocator::TaskFromWorkingDir(Id::new(value)?) }) } }