File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import com.dropbox.affectedmoduledetector.AffectedModuleDetector.Companion.DEPEN
2626import com.dropbox.affectedmoduledetector.AffectedModuleDetector.Companion.ENABLE_ARG
2727import com.dropbox.affectedmoduledetector.AffectedModuleDetector.Companion.MODULES_ARG
2828import com.dropbox.affectedmoduledetector.commitshaproviders.CommitShaProvider
29+ import com.dropbox.affectedmoduledetector.util.toPathSections
2930import org.gradle.api.GradleException
3031import org.gradle.api.Project
3132import org.gradle.api.Task
@@ -496,9 +497,13 @@ class AffectedModuleDetectorImpl constructor(
496497 }
497498 }
498499
499- private fun affectsAllModules (file : String ): Boolean {
500+ private fun affectsAllModules (relativeFilePath : String ): Boolean {
500501 logger?.info(" Paths affecting all modules: ${config.pathsAffectingAllModules} " )
501- return config.pathsAffectingAllModules.any { file.startsWith(it) }
502+
503+ val pathSections = relativeFilePath.toPathSections(rootProject.projectDir, git.getGitRoot())
504+ val projectRelativePath = pathSections.joinToString(File .separatorChar.toString())
505+
506+ return config.pathsAffectingAllModules.any { projectRelativePath.startsWith(it) }
502507 }
503508
504509 private fun findContainingProject (filePath : String ): Project ? {
You can’t perform that action at this time.
0 commit comments