Skip to content

Commit

Permalink
added task to assemble jar file which outputs to build/libs/Batil.jar
Browse files Browse the repository at this point in the history
  • Loading branch information
ssoper committed Sep 2, 2021
1 parent 268241c commit 4fadbba
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
val buildGroupId = "com.seansoper"
val buildArtifactId = "batil"
val buildVersion = "1.0.0"
val buildJvmTarget = "11"

plugins {
kotlin("jvm") version "1.5.30"
id("maven-publish")
Expand All @@ -22,12 +27,23 @@ dependencies {
testImplementation("com.squareup.okhttp3:mockwebserver:4.9.1")
}

tasks.jar {
manifest {
attributes(mapOf(
"Main-Class" to "$buildGroupId.$buildArtifactId.Core",
"Manifest-Version" to "1.0",
"Implementation-Version" to buildVersion))
}

from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
}

tasks.compileKotlin {
this.kotlinOptions.jvmTarget = "11"
this.kotlinOptions.jvmTarget = buildJvmTarget
}

tasks.compileTestKotlin {
this.kotlinOptions.jvmTarget = "11"
this.kotlinOptions.jvmTarget = buildJvmTarget
}

tasks.withType<Test> {
Expand All @@ -38,9 +54,9 @@ publishing {
publications {
create<MavenPublication>("gpr") {
run {
groupId = "com.seansoper"
artifactId = "batil"
version = "1.0.0"
groupId = buildGroupId
artifactId = buildArtifactId
version = buildVersion
}
}
}
Expand Down

0 comments on commit 4fadbba

Please sign in to comment.