excludedModules is not working with custom task.
Environment
- macOS 12.5
- Gradle 7.5
- AMD 0.1.6
- AGP 7.2.1
- Detekt 1.21.0
- Java 17
- Kotlin 1.6.21
Description
I'm integrating AMD into my project and I created two custom tasks. When I run `./gradlew runAffectedDetekt', I'm getting this error even though linter is specified in the excludedModules.
* What went wrong:
Could not determine the dependencies of task ':runAffectedDetekt'.
> Task with path ':linter:detekt' not found in root project 'Rappi-Android-User'.
This error makes sense since Detekt is not applied in the linter module; however, it should be ignored by AMD if it's specified in the excluded modules.
Configuration
import com.dropbox.affectedmoduledetector.AffectedModuleConfiguration
apply plugin: "com.dropbox.affectedmoduledetector"
def branch = System.getenv('DESTINATION_BRANCH')
if (!branch) {
branch = "origin/develop"
}
logger.lifecycle("Destination branch: $branch")
affectedModuleDetector {
baseDir = "${project.rootDir}"
pathsAffectingAllModules = [
"tools/global-dependencies.gradle"
]
logFilename = "output.log"
logFolder = "${project.rootDir}"
specifiedBranch = "$branch"
compareFrom = "SpecifiedBranchCommit"
excludedModules = ["linter", ":linter"]
customTasks = [
new AffectedModuleConfiguration.CustomTask(
"runAffectedDetekt,
"detekt",
"Run detekt"
),
new AffectedModuleConfiguration.CustomTask(
"runAffectedAndroidLint",
"lintDebug",
"Run lint"
),
]
Hey! Sorry for a long ansver. I'll try to reproduce this issue later and fix it. I let u know the results of my invistigation.
Hey! I couldn't reproduce your issue unfortunately. But I have hipotetical solution for it.
But, @GianfrancoMS can you create sample project with this issue for me? It helps me to test my hipotetical solution and debug problem.
Hey! I'll try to reproduce it in a differente repo as soon as I can, I'll let you know.
Unfortunately, I could not reproduce it in a different repo; I can only reproduce it in my work's project