Moved from JCenter to Maven Central.

Updated dependencies.
This commit is contained in:
Erik C. Thauvin 2021-03-21 17:54:34 -07:00
parent c08cb0708d
commit 8eb6847aad
6 changed files with 62 additions and 105 deletions

View file

@ -1,22 +1,19 @@
import com.jfrog.bintray.gradle.tasks.BintrayUploadTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.io.FileInputStream
import java.util.Properties
plugins {
jacoco
java
kotlin("jvm") version "1.4.0"
kotlin("jvm") version "1.4.31"
`maven-publish`
id("com.github.ben-manes.versions") version "0.29.0"
id("com.jfrog.bintray") version "1.8.5"
id("io.gitlab.arturbosch.detekt") version "1.11.1"
id("org.jetbrains.dokka") version "1.4.0-rc"
id("org.sonarqube") version "3.0"
signing
id("com.github.ben-manes.versions") version "0.38.0"
id("io.gitlab.arturbosch.detekt") version "1.16.0"
id("org.jetbrains.dokka") version "1.4.30"
id("org.sonarqube") version "3.1.1"
}
group = "net.thauvin.erik"
version = "1.0.1"
version = "1.1.0"
description = "Pinboard Poster for Kotlin/Java"
val gitHub = "ethauvin/$name"
@ -26,45 +23,32 @@ var isRelease = "release" in gradle.startParameter.taskNames
val publicationName = "mavenJava"
// Load local.properties
File("local.properties").apply {
if (exists()) {
FileInputStream(this).use { fis ->
Properties().apply {
load(fis)
forEach { (k, v) ->
extra[k as String] = v
}
}
}
}
}
object VersionInfo {
const val okhttp = "4.8.1"
const val okhttp = "4.9.1"
}
val versions: VersionInfo by extra { VersionInfo }
repositories {
jcenter()
mavenCentral()
jcenter() // needed for Dokka
}
dependencies {
implementation("com.squareup.okhttp3:okhttp:${versions.okhttp}")
implementation("com.squareup.okhttp3:logging-interceptor:${versions.okhttp}")
testImplementation("org.testng:testng:7.3.0")
testImplementation("org.testng:testng:7.4.0")
}
java {
withSourcesJar()
}
detekt {
baseline = project.rootDir.resolve("config/detekt/baseline.xml")
}
jacoco {
toolVersion = "0.8.5"
}
sonarqube {
properties {
property("sonar.projectKey", "ethauvin_pinboard-poster")
@ -72,11 +56,6 @@ sonarqube {
}
}
val sourcesJar by tasks.creating(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.getByName("main").allSource)
}
val javadocJar by tasks.creating(Jar::class) {
dependsOn(tasks.dokkaJavadoc)
from(tasks.dokkaJavadoc)
@ -106,7 +85,7 @@ tasks {
}
assemble {
dependsOn(sourcesJar, javadocJar)
dependsOn(javadocJar)
}
clean {
@ -147,19 +126,15 @@ tasks {
}
}
val bintrayUpload by existing(BintrayUploadTask::class) {
dependsOn(publishToMavenLocal, gitTag)
}
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
setTermsOfServiceAgree("yes")
}
register("release") {
description = "Publishes version ${project.version} to Bintray."
description = "Publishes version ${project.version} to local repository."
group = PublishingPlugin.PUBLISH_TASK_GROUP
dependsOn("wrapper", bintrayUpload)
dependsOn("wrapper", "deploy", "gitTag", "publishToMavelLocal")
}
"sonarqube" {
@ -167,69 +142,51 @@ tasks {
}
}
fun findProperty(s: String) = project.findProperty(s) as String?
bintray {
user = findProperty("bintray.user")
key = findProperty("bintray.apikey")
publish = isRelease
setPublications(publicationName)
pkg.apply {
repo = "maven"
name = project.name
desc = description
websiteUrl = mavenUrl
issueTrackerUrl = "$mavenUrl/issues"
githubRepo = gitHub
githubReleaseNotesFile = "README.md"
vcsUrl = "$mavenUrl.git"
setLabels("android", "kotlin", "java", "pinboard", "poster", "bookmarks")
publicDownloadNumbers = true
version.apply {
name = project.version as String
desc = description
vcsTag = project.version as String
gpg.apply {
sign = true
}
}
}
}
publishing {
publications {
create<MavenPublication>(publicationName) {
from(components["java"])
artifact(sourcesJar)
artifact(javadocJar)
pom.withXml {
asNode().apply {
appendNode("name", project.name)
appendNode("description", project.description)
appendNode("url", mavenUrl)
appendNode("licenses").appendNode("license").apply {
appendNode("name", "BSD 3-Clause")
appendNode("url", "https://opensource.org/licenses/BSD-3-Clause")
pom {
name.set(project.name)
description.set(project.description)
url.set(mavenUrl)
licenses {
license {
name.set("BSD 3-Clause")
url.set("https://opensource.org/licenses/BSD-3-Clause")
}
}
developers {
developer {
id.set("ethauvin")
name.set("Erik C. Thauvin")
email.set("erik@thauvin.net")
url.set("https://erik.thauvin.net/")
}
}
scm {
connection.set("scm:git:git://github.com/$gitHub.git")
developerConnection.set("scm:git:git@github.com:$gitHub.git")
url.set("$mavenUrl")
}
issueManagement {
system.set("GitHub")
url.set("$mavenUrl/issues")
}
}
}
}
repositories {
maven {
name = "ossrh"
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials(PasswordCredentials::class)
}
}
}
appendNode("developers").appendNode("developer").apply {
appendNode("id", "ethauvin")
appendNode("name", "Erik C. Thauvin")
appendNode("email", "erik@thauvin.net")
}
appendNode("scm").apply {
appendNode("connection", "scm:git:$mavenUrl.git")
appendNode("developerConnection", "scm:git:git@github.com:$gitHub.git")
appendNode("url", mavenUrl)
}
appendNode("issueManagement").apply {
appendNode("system", "GitHub")
appendNode("url", "$mavenUrl/issues")
}
}
}
}
}
signing {
useGpgCmd()
sign(publishing.publications[publicationName])
}

View file

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View file

@ -10,10 +10,10 @@ defaultTasks 'run'
mainClassName = 'net.thauvin.erik.pinboard.samples.JavaExample'
dependencies {
compile 'net.thauvin.erik:pinboard-poster:1.0.1'
compile 'net.thauvin.erik:pinboard-poster:1.1.0'
}
repositories {
mavenLocal()
jcenter()
mavenCentral()
}

View file

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View file

@ -1,6 +1,6 @@
plugins {
application
kotlin("jvm") version "1.4.0"
kotlin("jvm") version "1.4.31"
}
// .gradlew run
@ -8,7 +8,7 @@ plugins {
defaultTasks(ApplicationPlugin.TASK_RUN_NAME)
dependencies {
compile("net.thauvin.erik:pinboard-poster:1.0.1")
compile("net.thauvin.erik:pinboard-poster:1.1.0")
}
application {
@ -17,5 +17,5 @@ application {
repositories {
mavenLocal()
jcenter()
mavenCentral()
}

View file

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists