Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.

Commit

Permalink
Update build file to support bintray publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmc24 committed Aug 20, 2019
1 parent 75e4e85 commit 15a85d7
Showing 1 changed file with 50 additions and 37 deletions.
87 changes: 50 additions & 37 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ plugins {
id "codenarc"
id "idea"
id "maven-publish"
id "com.gradle.plugin-publish" version "0.9.1"
id "java-gradle-plugin"
id "com.jfrog.bintray" version "1.8.1"
}

repositories {
Expand Down Expand Up @@ -32,51 +33,67 @@ tasks.withType(AbstractArchiveTask) {
reproducibleFileOrder = true
}

pluginBundle {
website = "https://github.com/commercehub-oss/gradle-avro-plugin"
vcsUrl = "https://github.com/commercehub-oss/gradle-avro-plugin"
description = "A Gradle plugin to allow easily performing Java code generation for Apache Avro. It supports JSON schema declaration files, JSON protocol declaration files, and Avro IDL files."
tags = ["serialization", "avro"]
plugins {
avro {
id = "com.commercehub.gradle.plugin.avro"
displayName = "Avro Plugin"
}
avroBase {
id = "com.commercehub.gradle.plugin.avro-base"
displayName = "Avro Base Plugin"
}
}
mavenCoordinates {
groupId = group
artifactId = rootProject.name
}
}

task sourcesJar(type: Jar) {
from sourceSets.main.allJava
archiveClassifier = 'sources'
task sourcesJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource
classifier "sources"
extension "jar"
}

task javadocJar(type: Jar) {
from javadoc
archiveClassifier = 'javadoc'
task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
classifier "javadoc"
extension "jar"
}

publishing {
publications {
maven(MavenPublication) {
groupId = group
artifactId = rootProject.name
version = version

mainMaven(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}

bintray {
// dryRun = true
// publish = true
user = project.hasProperty("bintrayUserName") ? bintrayUserName : null
key = project.hasProperty("bintrayApiKey") ? bintrayApiKey : null
publications = ["mainMaven", "avroBasePluginMarkerMaven", "avroPluginMarkerMaven"]
pkg {
repo = "main"
name = project.name
userOrg = "commercehub-oss"
licenses = ["Apache-2.0"]
desc = "A Gradle plugin to allow easily performing Java code generation for Apache Avro. It supports JSON schema declaration files, JSON protocol declaration files, and Avro IDL files."
websiteUrl = "https://github.com/commercehub-oss/gradle-avro-plugin"
issueTrackerUrl = 'https://github.com/commercehub-oss/gradle-avro-plugin/issues'
vcsUrl = "https://github.com/commercehub-oss/gradle-avro-plugin"
labels = ["serialization", "avro"]
githubRepo = "commercehub-oss/gradle-avro-plugin"
version {
name = project.version
vcsTag = project.version
}
}
}

bintrayUpload.dependsOn build, { generatePomFileForAvroBasePluginMarkerMavenPublication }, { generatePomFileForAvroPluginMarkerMavenPublication }

gradlePlugin {
plugins {
avro {
id = "com.commercehub.gradle.plugin.avro"
implementationClass = "com.commercehub.gradle.plugin.avro.AvroPlugin"
}
avroBase {
id = "com.commercehub.gradle.plugin.avro-base"
implementationClass = "com.commercehub.gradle.plugin.avro.AvroBasePlugin"
}
}
}

idea {
project {
vcs = "Git"
Expand Down Expand Up @@ -135,7 +152,3 @@ codenarc {
toolVersion = "0.24.1"
config = project.resources.text.fromFile("config/codenarc/codenarc.groovy")
}

wrapper {
gradleVersion = '5.6'
}

0 comments on commit 15a85d7

Please sign in to comment.