Compare commits

...

4 commits

Author SHA1 Message Date
Imbus
0dca2fd27a Remove old gradle-init'd xl directory 2024-05-11 14:09:35 +02:00
Imbus
abc163fdb5 Make build now lists built jars 2024-05-11 14:07:16 +02:00
Imbus
99b9da9be1 Make build depend on shadowJar 2024-05-11 14:06:58 +02:00
Imbus
04bef1b3e8 shadowJar support 2024-05-11 14:02:05 +02:00
3 changed files with 17 additions and 15 deletions

View file

@ -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>("test") {
// Use JUnit Platform for unit tests.
useJUnitPlatform()
}
tasks.withType<ShadowJar> {
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")
}

View file

@ -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());
}
}

View file

@ -10,7 +10,7 @@ watch:
build:
./gradlew build
#./gradlew shadowJar
ls -lh app/build/libs/*.jar
clean:
./gradlew clean