Skip to content

Commit

Permalink
ci: setup bintray publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
AlmazKo committed May 19, 2020
1 parent 33e7798 commit dbacfbe
Showing 1 changed file with 85 additions and 1 deletion.
86 changes: 85 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import java.util.*

plugins {
java
jacoco
`maven-publish`
id("com.jfrog.bintray") version "1.8.5"
}

group = "almazko"
version = "1.0-SNAPSHOT"
version = "0.2"

repositories {
mavenCentral()
jcenter()
}

java {
Expand Down Expand Up @@ -64,5 +68,85 @@ dependencies {
}


val sourcesJar by tasks.creating(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.getByName("main").allSource)
}


val artifactName = project.name
val artifactGroup = project.group.toString()
val artifactVersion = project.version.toString()
val baseUrl = "https://github.com/AlmazKo/microjson"
val pomUrl = baseUrl
val pomScmUrl = baseUrl
val pomIssueUrl = "$baseUrl/issues"
val pomDesc = baseUrl
val githubRepo = "AlmazKo/microjson"
val githubReadme = "README.md"
val pomLicenseName = "MIT"
val pomLicenseUrl = "https://opensource.org/licenses/mit-license.php"
val pomLicenseDist = "repo"
val pomDeveloperId = "AlmazKo"
val pomDeveloperName = "Alex Suslov"


publishing {
publications {
create<MavenPublication>("microjson") {
groupId = artifactGroup
artifactId = artifactName
version = artifactVersion
from(components["java"])
artifact(sourcesJar)
pom.withXml {
asNode().apply {
appendNode("description", pomDesc)
appendNode("name", rootProject.name)
appendNode("url", pomUrl)
appendNode("licenses").appendNode("license").apply {
appendNode("name", pomLicenseName)
appendNode("url", pomLicenseUrl)
appendNode("distribution", pomLicenseDist)
}
appendNode("developers").appendNode("developer").apply {
appendNode("id", pomDeveloperId)
appendNode("name", pomDeveloperName)
}
appendNode("scm").apply {
appendNode("url", pomScmUrl)
}
}
}
}
}
}


bintray {
user = project.findProperty("bintrayUser").toString()
key = project.findProperty("bintrayKey").toString()
publish = true
setPublications("microjson")
pkg.apply {
repo = "microjson"
name = artifactName
userOrg = "almazko"
githubRepo = githubRepo
vcsUrl = pomScmUrl
description = "JSON tiny library written in modern Java"
setLabels("json-parser")
setLicenses("MIT")
desc = description
websiteUrl = pomUrl
issueTrackerUrl = pomIssueUrl
githubReleaseNotesFile = githubReadme

version.apply {
name = artifactVersion
desc = pomDesc
released = Date().toString()
vcsTag = artifactVersion
}
}
}

0 comments on commit dbacfbe

Please sign in to comment.