Skip to content

Commit

Permalink
Merge pull request #190 from dropbox/jfein/fix-root-dir
Browse files Browse the repository at this point in the history
Use basedir if available for figuring out relative file paths
  • Loading branch information
joshafeinberg authored Jan 10, 2023
2 parents ef23595 + e05621c commit 9460c2e
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
Expand Down

0 comments on commit 9460c2e

Please sign in to comment.