From 6a8d351df3afe4481c30f258180d303f18d6097e Mon Sep 17 00:00:00 2001 From: reger <> Date: Tue, 18 Jan 2022 11:55:21 +0100 Subject: [PATCH] Enable Gradle test and add manifest to yacycore.jar, set outputdir to lib as part of migration from Ant to Gradle builds. --- build.gradle | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/build.gradle b/build.gradle index 7b74b7cd1..2d2677791 100644 --- a/build.gradle +++ b/build.gradle @@ -19,6 +19,7 @@ repositories { flatDir { dirs 'lib' } + mavenCentral() } sourceSets { @@ -27,6 +28,12 @@ sourceSets { srcDirs = ['source'] } } + + test { + java { + srcDirs = ['test/java'] + } + } } group = 'net.yacy' @@ -65,4 +72,21 @@ tasks.withType(JavaCompile) { dependencies { implementation(fileTree("lib")) + + testImplementation('junit:junit:4.13.2') } + +// output to lib/yacycore.jar (like with ant with downside by determine class-path) +jar { + archiveFileName = 'yacycore.jar' + destinationDirectory = new File('lib') + + // @TODO: class-path workaround until we've dependencies to use configurations.implementation instead of filetree. + FileTree libdir = fileTree("lib").include ("*.jar").exclude("yacycore.jar") + manifest { + attributes( + "Main-Class": "net.yacy.yacy" , + "Class-Path": libdir.collect { it.name }.join(' ') + ) + } +} \ No newline at end of file