-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from sqids/add-maven-central-configs
Add build configs for deploying to maven central
- Loading branch information
Showing
1 changed file
with
64 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} | ||
|
@@ -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 | ||
} | ||
} |