Compare commits
4 commits
fec401be5d
...
0dca2fd27a
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0dca2fd27a | ||
![]() |
abc163fdb5 | ||
![]() |
99b9da9be1 | ||
![]() |
04bef1b3e8 |
3 changed files with 17 additions and 15 deletions
|
@ -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")
|
||||
}
|
|
@ -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());
|
||||
}
|
||||
}
|
2
makefile
2
makefile
|
@ -10,7 +10,7 @@ watch:
|
|||
|
||||
build:
|
||||
./gradlew build
|
||||
#./gradlew shadowJar
|
||||
ls -lh app/build/libs/*.jar
|
||||
|
||||
clean:
|
||||
./gradlew clean
|
||||
|
|
Loading…
Reference in a new issue