Skip to content

Commit

Permalink
excludedProjectsFromScanning property support (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxirosson committed Aug 24, 2021
1 parent 0239a6c commit 12caef0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -101,6 +101,7 @@ byeByeJetifier {
// com.squareup.leakcanary:leakcanary-object-watcher-android-support-fragments:2.5
"leakcanary/internal/AndroidSupportFragmentDestroyWatcher"
]
excludedProjectsFromScanning = [] // Here you can define a list of Gradle project names to be excluded from the scanning analysis
excludeSupportAnnotations = true
verbose = false
}
Expand Down
Expand Up @@ -31,6 +31,8 @@ open class ByeByeJetifierExtension {
"leakcanary/internal/AndroidSupportFragmentDestroyWatcher"
)

var excludedProjectsFromScanning: List<String> = emptyList()

var excludeSupportAnnotations = true

var verbose = false
Expand Down
Expand Up @@ -19,6 +19,7 @@ class ByeByeJetifierGradlePlugin : Plugin<Project> {
canISayByeByeJetifierTask.excludedConfigurations = extension.excludedConfigurations
canISayByeByeJetifierTask.excludedFilesFromScanning = extension.excludedFilesFromScanning
canISayByeByeJetifierTask.excludeSupportAnnotations = extension.excludeSupportAnnotations
canISayByeByeJetifierTask.excludedProjectsFromScanning = extension.excludedProjectsFromScanning
canISayByeByeJetifierTask.verbose = extension.verbose
}
}
Expand Down
Expand Up @@ -35,6 +35,10 @@ open class CanISayByeByeJetifierTask : AbstractTask() {
@get:Optional
var excludedFilesFromScanning: List<String> = emptyList()

@get:Input
@get:Optional
var excludedProjectsFromScanning: List<String> = emptyList()

@get:Input
var excludeSupportAnnotations = true

Expand All @@ -61,7 +65,7 @@ open class CanISayByeByeJetifierTask : AbstractTask() {
LoggerHelper.log("excludeSupportAnnotations: $excludeSupportAnnotations")

val projectAnalyzerResult = ProjectAnalyzerResult()
project.allprojects.forEach {
project.allprojects.filter { !excludedProjectsFromScanning.contains(it.name) }.forEach {
ProjectAnalyzer(it, excludedConfigurations, legacyGroupIdPrefixes, scannerProcessor, excludeSupportAnnotations).analyze(projectAnalyzerResult)
}

Expand Down
1 change: 1 addition & 0 deletions sample/build.gradle
Expand Up @@ -30,6 +30,7 @@ apply plugin: "com.dipien.byebyejetifier"

byeByeJetifier {
verbose = false
//excludedProjectsFromScanning = ["app", "library"]
}

wrapper {
Expand Down

0 comments on commit 12caef0

Please sign in to comment.