Skip to content

Commit 8c794df

Browse files
feat: support the com.google.cloud.tools.jib plugin as an application-type plugin.
1 parent 6e4039e commit 8c794df

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

README.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ Additionally, the plugin:
3535
The plugin can be used to analyze JVM or Android projects, including multi-project builds including both JVM and
3636
Android. It supports Groovy, Java, Kotlin, and Scala on the JVM. For Android, it supports analysis of
3737
`com.android.application`, `com.android.library`, and `com.android.test` modules. It has special handling for
38-
"application" modules, which are those that apply the `application`, `org.gretty`, or `org.springframework.boot`
39-
plugins.
38+
"application" modules, which are those that apply the `application`, `org.gretty`, `com.google.cloud.tools.jib`, or
39+
`org.springframework.boot` plugins.
4040

4141
Please see the https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin/wiki/Compatibilities-&-Limitations[wiki]
4242
for comprehensive information.

src/main/kotlin/com/autonomousapps/subplugin/ProjectPlugin.kt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import java.util.concurrent.atomic.AtomicBoolean
4545
private const val APPLICATION_PLUGIN = "application"
4646
private const val JAVA_LIBRARY_PLUGIN = "java-library"
4747
private const val JAVA_PLUGIN = "java"
48+
private const val JIB_PLUGIN = "com.google.cloud.tools.jib"
4849
private const val SCALA_PLUGIN = "scala"
4950

5051
private const val ANDROID_APP_PLUGIN = "com.android.application"
@@ -684,12 +685,14 @@ internal class ProjectPlugin(private val project: Project) {
684685
return hasApiConfiguration && isNotTest && isNotMainApp
685686
}
686687

687-
private fun Project.isAppProject() =
688-
pluginManager.hasPlugin(APPLICATION_PLUGIN) ||
689-
pluginManager.hasPlugin(SPRING_BOOT_PLUGIN) ||
690-
pluginManager.hasPlugin(GRETTY_PLUGIN) ||
691-
pluginManager.hasPlugin(ANDROID_APP_PLUGIN) ||
692-
dagpExtension.forceAppProject
688+
private fun Project.isAppProject(): Boolean {
689+
return dagpExtension.forceAppProject
690+
|| pluginManager.hasPlugin(ANDROID_APP_PLUGIN)
691+
|| pluginManager.hasPlugin(APPLICATION_PLUGIN)
692+
|| pluginManager.hasPlugin(GRETTY_PLUGIN)
693+
|| pluginManager.hasPlugin(JIB_PLUGIN)
694+
|| pluginManager.hasPlugin(SPRING_BOOT_PLUGIN)
695+
}
693696

694697
/* ===============================================
695698
* The main work of the plugin happens below here.

0 commit comments

Comments
 (0)