From 011487917059ea97a95af0ae33ca04b966da01e6 Mon Sep 17 00:00:00 2001 From: Taylor Becker Date: Mon, 10 Feb 2020 19:46:59 -0500 Subject: [PATCH] Ported updated jar config and nokt task from template (#14) --- .github/workflows/release-workflow.yml | 2 +- CHANGELOG.md | 2 ++ build.gradle.kts | 21 +++++++++++++++++---- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-workflow.yml b/.github/workflows/release-workflow.yml index 4a0278d..1715ee3 100644 --- a/.github/workflows/release-workflow.yml +++ b/.github/workflows/release-workflow.yml @@ -33,4 +33,4 @@ jobs: with: args: | build/libs/simplehealthbars2-${{ steps.format-version.outputs.replaced }}.jar - build/libs/simplehealthbars2-${{ steps.format-version.outputs.replaced }}-all.jar + build/libs/simplehealthbars2-${{ steps.format-version.outputs.replaced }}-nokt.jar diff --git a/CHANGELOG.md b/CHANGELOG.md index 23a6bbe..729fa3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ ### Changed - Updated README.md to include actual information - Update to v3 of anton-yurchenko/git-release action +- Previous `-all` (fat-jar) distribution is now the default jar and added a `-nokt` distribution without the kotlin stdlib. + - Users can provide the stdlib on their classpath and avoid every plugin needing to include it. ## [0.1.2] - 2020-01-24 ### Changed diff --git a/build.gradle.kts b/build.gradle.kts index c6f54d5..68212fe 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,4 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import pl.allegro.tech.build.axion.release.domain.hooks.HookContext import pl.allegro.tech.build.axion.release.domain.hooks.HooksConfig import java.time.OffsetDateTime @@ -79,17 +78,31 @@ tasks { distributionType = Wrapper.DistributionType.ALL } - withType { + compileKotlin { kotlinOptions { jvmTarget = "1.8" } } - withType { + // standard jar should be ready to go with all dependencies + shadowJar { minimize() + archiveClassifier.set("") + } + + // nokt jar without the kotlin runtime + register("nokt") { + minimize() + archiveClassifier.set("nokt") + from(sourceSets.main.get().output) + configurations = listOf(project.configurations.runtimeClasspath.get()) + + dependencies { + exclude(dependency("org.jetbrains.*:")) + } } build { - dependsOn(":shadowJar") + dependsOn(":shadowJar", ":nokt") } }