java-sdk/build.gradle.kts
dependabot[bot] 797582f39f
build: bump jvm from 1.6.20 to 1.6.21 (#4)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-04 15:31:20 +02:00

90 lines
2.2 KiB
Plaintext

plugins {
// Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin.
kotlin("jvm") version "1.6.21"
id("org.jetbrains.dokka") version "1.6.21"
// Apply the java-library plugin for API and implementation separation.
`java-library`
`maven-publish`
}
val artifact = System.getenv("artifact") ?: "sdk"
group = System.getenv("group") ?: "net.tcgdex"
version = System.getenv("version") ?: "2.0.0"
repositories {
mavenCentral()
}
dependencies {
// Use the Kotlin JDK 8 standard library.
implementation(kotlin("stdlib-jdk8"))
// Gson
implementation("com.google.code.gson:gson:2.9.0")
testImplementation(kotlin("test"))
}
tasks.test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
tasks {
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
}
java {
withJavadocJar()
withSourcesJar()
}
// Javadocs
val javadocJar = tasks.named<Jar>("javadocJar") {
from(tasks.named("dokkaJavadoc"))
}
publishing {
publications {
create<MavenPublication>("maven") {
// groupId = group
artifactId = artifact
// version = ver
from(components["java"])
pom {
name.set("TCGdex SDK")
description.set("Communicate with the Open Source TCGdex API in Kotlin/Java using the SDK")
url.set("https://github.com/tcgdex/java-sdk")
licenses {
license {
name.set("MIT License")
url.set("https://github.com/tcgdex/java-sdk/blob/master/LICENSE.txt")
}
}
developers {
developer {
id.set("avior")
name.set("Avior")
email.set("contact@tcgdex.net")
}
}
scm {
connection.set("scm:git@github.com:tcgdex/java-sdk.git")
url.set("https://github.com/tcgdex/java-sdk")
}
}
}
}
}