GoogleContainerTools / jib-extensions

Apache License 2.0
117 stars 35 forks source link

Applying plugin with the plugins DSL #132

Closed luisalves00 closed 2 years ago

luisalves00 commented 2 years ago

Is the extension released in a way that it can be used using Plugin DSL (https://docs.gradle.org/current/userguide/plugins.html#sec:plugins_block)

Example:

    plugins {
        id("com.google.cloud.tools.jib-ownership-extension-gradle")
                ...
    }

tried and the artifact cannot be found while jib is:

    plugins {
                ...
        id("com.google.cloud.tools.jib")
    }

thanks

chanseokoh commented 2 years ago

No, the extensions are not Gradle plugins and not meant to be "applied." You just want the classes in the JAR file available (i.e., be on the classpath) inside the build script.

luisalves00 commented 2 years ago

It's a good point. Plan was to put

id("com.google.cloud.tools.jib-ownership-extension-gradle") version("${jibOwnershipVersion}") apply false

So it wasn't applied but loaded into the classpath.

I'll keep my OCD aside and add the buildscript part as you propose in documentation:

buildscript {
  dependencies {
    classpath('com.google.cloud.tools:jib-ownership-extension-gradle:0.1.0')
  }
}