Skip to content

Instantly share code, notes, and snippets.

@ahndmal
Created May 1, 2025 18:32
Show Gist options
  • Save ahndmal/b4659c33450f7be69d8a43d287298cc5 to your computer and use it in GitHub Desktop.
Save ahndmal/b4659c33450f7be69d8a43d287298cc5 to your computer and use it in GitHub Desktop.
gradle-jar-as-exec.kts
tasks.jar {
manifest {
attributes["Main-Class"] = "com.andmal.Main"
}
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(sourceSets.main.get().output)
dependsOn(configurations.runtimeClasspath)
from({
configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) }
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment