From b118716b6762535f008c76e52ce2f238ba16c15d Mon Sep 17 00:00:00 2001 From: Josh Feinberg <15068619+joshafeinberg@users.noreply.github.com> Date: Wed, 6 Nov 2024 13:44:32 -0600 Subject: [PATCH] Add a bit of additional functionality --- .../AffectedModuleDetector.kt | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetector.kt b/affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetector.kt index 8307ac8..f82c00a 100644 --- a/affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetector.kt +++ b/affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetector.kt @@ -312,6 +312,28 @@ abstract class AffectedModuleDetector(protected val logger: Logger?) { ).hasAffectedProjects() } + /** + * Returns a set of all affected project paths + * + * Can only be called during the execution phase + */ + fun affectedProjects(project: Project): Set { + return getOrThrow( + project + ).getAllAffectedProjects() + } + + /** + * Returns a set of all changed project paths + * + * Can only be called during the execution phase + */ + fun changedProjects(project: Project): Set { + return getOrThrow( + project + ).getAllChangedProjects() + } + /** * Returns true if the project was provided via [MODULES_ARG] or no [MODULES_ARG] was set *