Skip to content

Commit 9460c2e

Browse files
Merge pull request #190 from dropbox/jfein/fix-root-dir
Use basedir if available for figuring out relative file paths
2 parents ef23595 + e05621c commit 9460c2e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetector.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,12 @@ class AffectedModuleDetectorImpl constructor(
501501
private fun affectsAllModules(relativeFilePath: String): Boolean {
502502
logger?.info("Paths affecting all modules: ${config.pathsAffectingAllModules}")
503503

504-
val pathSections = relativeFilePath.toPathSections(rootProject.projectDir, git.getGitRoot())
504+
val rootProjectDir = if (config.baseDir != null) {
505+
File(config.baseDir!!)
506+
} else {
507+
rootProject.projectDir
508+
}
509+
val pathSections = relativeFilePath.toPathSections(rootProjectDir, git.getGitRoot())
505510
val projectRelativePath = pathSections.joinToString(File.separatorChar.toString())
506511

507512
return config.pathsAffectingAllModules.any { projectRelativePath.startsWith(it) }

0 commit comments

Comments
 (0)