Skip to content

Commit

Permalink
Ported updated jar config and nokt task from template (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
tajobe authored Feb 11, 2020
1 parent 934ebab commit 0114879
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 17 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -79,17 +78,31 @@ tasks {
distributionType = Wrapper.DistributionType.ALL
}

withType<KotlinCompile> {
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}

withType<ShadowJar> {
// standard jar should be ready to go with all dependencies
shadowJar {
minimize()
archiveClassifier.set("")
}

// nokt jar without the kotlin runtime
register<ShadowJar>("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")
}
}

0 comments on commit 0114879

Please sign in to comment.