From 38a8a885c8d1b795a4de68dca823240284626d50 Mon Sep 17 00:00:00 2001 From: OLEGSHA Date: Sat, 14 Nov 2020 21:58:48 +0300 Subject: [PATCH] Updated build.gradle to make build artifacts easily runnable --- build.gradle | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 1eff0a5..f442d6d 100644 --- a/build.gradle +++ b/build.gradle @@ -18,10 +18,12 @@ dependencies { implementation 'ru.windcorp.fork.io.github.java-graphics:glm:1.0.1' // log4j - compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.13.3' - compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.13.3' + implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.13.3' + implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.13.3' testImplementation 'junit:junit:4.12' + + // See also LWJGL dependencies below } /* @@ -77,3 +79,22 @@ dependencies { } // LWJGL END + +jar { + manifest { + attributes( + "Main-Class": "ru.windcorp.progressia.client.ProgressiaClientMain", + "Class-Path": configurations.runtimeClasspath.collect { "lib/" + it.getName() }.join(' ') + ) + } +} + +/* + * Copies runtime dependencies to a prespecified location so they can be packaged properly. + */ +task copyLibs(type: Copy) { + into "${libsDir}/lib" + from configurations.runtimeClasspath +} + +build.dependsOn(copyLibs)