Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add and enable new plugin extension configuration in Gradle #2431

Merged
merged 27 commits into from
May 4, 2020

Conversation

chanseokoh
Copy link
Member

@chanseokoh chanseokoh commented Apr 27, 2020

(Gradle counterpart of #2420.)

Adds new extension configuration parameters for Gradle. Extensions can additionally get custom properties. The order of executing extensions will be the order defined in pom.xml.

The following example configures two extensions.

  pluginExtensions { pluginExtension { implementation = 'com.example.Test' } }
  pluginExtensions {
    pluginExtension {
      implementation = 'com.google.cloud.tools.jib.plugins.extension.gradle.quarkus.QuarkusJibExtension'
      properties = [customProperty: 'value']
    }
  }

That is, multiple pluginExtensions blocks are needed to configure multiple extensions. I've consulted the implementation of the Gradle plugin for Visual Studio Code IDE. I am not totally sure if this is the standard way, but I could not figure out a way to enable configuring extensions as a list like pluginExtensions = [ { ... }, { ... } ]. (UPDATE: now new syntax with latest commits.)

Originally the name of the block was extensions { ... }. Although it did work, one of our test classes complained that their's ambiguity in setExtensions(), so I went with pluginExtensions { ... }. Seems like an acceptable renaming. Probably I'll have to rename the Maven configuration to be consistent.

@loosebazooka
Copy link
Member

The plural on the base jib config of pluginExtensions seems weird. I think either

jib {
  pluginExtension {..}
  pluginExtension {..}
}

or (and this matches most models I see like licenses and developers in pom config)

jib {
  pluginExtensions {
    pluginExtension {...}
  }
}

Copy link
Member

@loosebazooka loosebazooka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good, but have a few comments

@chanseokoh
Copy link
Member Author

chanseokoh commented May 1, 2020

jib {
  pluginExtensions {
    pluginExtension {...}
  }
}

Trying to find a way to make this work. I'll look into this later.

UPDATE: done. The name of the new intermediate class ExtensionParametersSpec followed the convention of MavenPomLicenseSpec.

@chanseokoh chanseokoh merged commit 2b6f6ca into master May 4, 2020
@chanseokoh chanseokoh deleted the gradle-plugin-extension-config branch May 4, 2020 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants