plugins {
  id 'net.researchgate.release'
  id 'maven-publish'
  id 'eclipse'
}

dependencies {
  api dependencyStrings.BUILD_PLAN
  api dependencyStrings.EXTENSION_COMMON
  api gradleApi()
}

jar {
  manifest {
    attributes 'Implementation-Version': archiveVersion
    attributes 'Automatic-Module-Name': 'com.google.cloud.tools.jib.gradle.extension'

    // OSGi metadata
    attributes 'Bundle-SymbolicName': 'com.google.cloud.tools.jib.gradle.extension'
    attributes 'Bundle-Name': 'Extension API for Jib Gradle Plugin'
    attributes 'Bundle-Vendor': 'Google LLC'
    attributes 'Bundle-DocURL': 'https://github.com/GoogleContainerTools/jib'
    attributes 'Bundle-License': 'https://www.apache.org/licenses/LICENSE-2.0'
    attributes 'Export-Package': 'com.google.cloud.tools.jib.gradle.extension'
  }
}

/* RELEASE */
configureMavenRelease()

publishing {
  publications {
    mavenJava(MavenPublication) {
      pom {
        name = 'Extension API for Jib Gradle Plugin'
        description = 'Provides API to extend Jib Gradle Plugin containerization.'
      }
      from components.java
    }
  }
}

// Release plugin (git release commits and version updates)
release {
  tagTemplate = 'v$version-gradle-extension'
  git {
    requireBranch = /^gradle-extension-release-v\d+.*$/  //regex
  }
}
/* RELEASE */

/* ECLIPSE */
eclipse.classpath.plusConfigurations += [configurations.integrationTestImplementation]
/* ECLIPSE */
