Skip to content

Commit

Permalink
Merge pull request #6 from sqids/add-maven-central-configs
Browse files Browse the repository at this point in the history
Add build configs for deploying to maven central
  • Loading branch information
kevinxmorales authored Jan 31, 2024
2 parents 45cd901 + 59959b8 commit c61938f
Showing 1 changed file with 64 additions and 2 deletions.
66 changes: 64 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
plugins {
id("org.jetbrains.kotlin.jvm") version "1.6.0"
id("java-library")
id("maven-publish")
id("signing")
}

var rootArtifactId = "sqids-kotlin"
var projectUrl = "https://sqids.org/kotlin"
group = "org.sqids"
version = "0.1.1-SNAPSHOT"

repositories {
mavenCentral()
}
Expand All @@ -11,12 +18,67 @@ dependencies {
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
}

tasks.named('test', Test) {
tasks.named("test", Test) {
useJUnitPlatform()

maxHeapSize = '1G'
maxHeapSize = "1G"

testLogging {
showStandardStreams = true
}
}

publishing {
publications {

mavenJava(MavenPublication) {
groupId = group
artifactId = rootArtifactId
version = version
from components.java
pom {
name = "Sqids"
description = "Generate short YouTube-looking IDs from numbers."
url = projectUrl
properties = [
"parent.groupId": "org.sonatype.oss",
"parent.artifactId": "oss-parent",
"parent.version": "7"
]
licenses {
license {
name = "MIT License"
url = "https://github.com/sqids/sqids-kotlin/blob/main/LICENSE"
}
}
developers {
developer {
id = "kevinxmorales"
name = "Kevin Morales"
email = "[email protected]"
}
}
scm {
connection = "scm:git:https://github.com/sqids/sqids-kotlin.git"
developerConnection = "scm:git:ssh://[email protected]:sqids/sqids-kotlin.git"
url = projectUrl
}
}
}
}
repositories {
maven {
url = version.endsWith('SNAPSHOT') ?
"https://s01.oss.sonatype.org/content/repositories/snapshots/" :
"https://s01.oss.sonatype.org/content/repositories/releases/"
credentials {
username "${System.getenv("SONATYPE_USERNAME")}"
password "${System.getenv("SONATYPE_PASSWORD")}"
}
}
}
signing {
useGpgCmd()
sign publishing.publications.mavenJava
}
}

0 comments on commit c61938f

Please sign in to comment.