From e05621cb418d4868f5650232d5e71cde9f44161e Mon Sep 17 00:00:00 2001 From: Josh Feinberg <15068619+joshafeinberg@users.noreply.github.com> Date: Tue, 10 Jan 2023 15:00:51 -0600 Subject: [PATCH] Use basedir if available for figuring out relative file paths --- .../affectedmoduledetector/AffectedModuleDetector.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetector.kt b/affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetector.kt index a8774b42..76012e28 100644 --- a/affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetector.kt +++ b/affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetector.kt @@ -501,7 +501,12 @@ class AffectedModuleDetectorImpl constructor( private fun affectsAllModules(relativeFilePath: String): Boolean { logger?.info("Paths affecting all modules: ${config.pathsAffectingAllModules}") - val pathSections = relativeFilePath.toPathSections(rootProject.projectDir, git.getGitRoot()) + val rootProjectDir = if (config.baseDir != null) { + File(config.baseDir!!) + } else { + rootProject.projectDir + } + val pathSections = relativeFilePath.toPathSections(rootProjectDir, git.getGitRoot()) val projectRelativePath = pathSections.joinToString(File.separatorChar.toString()) return config.pathsAffectingAllModules.any { projectRelativePath.startsWith(it) }