diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 1733fa1..a6701b3 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -5,9 +5,12 @@ * For more details on building Java & JVM projects, please refer to https://docs.gradle.org/8.4/userguide/building_java_projects.html in the Gradle documentation. */ +import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar + plugins { // Apply the application plugin to add support for building a CLI application in Java. application + id("com.github.johnrengelman.shadow") version "8.1.1" } repositories { @@ -41,3 +44,16 @@ tasks.named("test") { // Use JUnit Platform for unit tests. useJUnitPlatform() } + +tasks.withType { + archiveBaseName.set("xl") + archiveVersion.set("") + manifest { + attributes(mapOf("Main-Class" to "com.github.csolem.gradle.shadow.kotlin.example.App")) + } +} + +// Set build to depend on shadowJar +tasks.named("build") { + dependsOn("shadowJar") +} \ No newline at end of file diff --git a/app/src/main/java/xl/App.java b/app/src/main/java/xl/App.java deleted file mode 100644 index 329d4ad..0000000 --- a/app/src/main/java/xl/App.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This Java source file was generated by the Gradle 'init' task. - */ -package xl; - -public class App { - public String getGreeting() { - return "Hello World!"; - } - - public static void main(String[] args) { - System.out.println(new App().getGreeting()); - } -} diff --git a/makefile b/makefile index b3ce6d2..3debf1d 100644 --- a/makefile +++ b/makefile @@ -10,7 +10,7 @@ watch: build: ./gradlew build - #./gradlew shadowJar + ls -lh app/build/libs/*.jar clean: ./gradlew clean