Skip to content

Commit

Permalink
update build script and ci
Browse files Browse the repository at this point in the history
  • Loading branch information
RTAkland committed Dec 1, 2024
1 parent 3477d88 commit 750ef05
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,9 @@ jobs:
- name: Make Gradle wrapper executable
run: chmod +x ./gradlew
- name: Build
run: ./gradlew build
run: ./gradlew build buildShadowJar
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: Kwsify-executable
path: build/libs/*-all.jar
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

```shell
$ chmod +x ./gradlew # 可选
$ ./gradlew shadowJar
$ ./gradlew buildShadowJar
```

```shell
Expand Down
14 changes: 14 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

plugins {
alias(libs.plugins.kotlin)
alias(libs.plugins.shadow)
Expand Down Expand Up @@ -25,6 +27,18 @@ application {
mainClass = "cn.rtast.kwsify.KwsifyKt"
}

tasks.shadowJar {
enabled = false
}

tasks.register<ShadowJar>("buildShadowJar") {
group = "build"
description = "Manually build the shadow JAR file"
archiveClassifier.set("all")
from(sourceSets.main.get().output)
configurations = listOf(project.configurations.runtimeClasspath.get())
}

allprojects {
apply {
apply(plugin = "org.jetbrains.kotlin.jvm")
Expand Down

0 comments on commit 750ef05

Please sign in to comment.