Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

Enable Gradle test and add manifest to yacycore.jar, set outputdir to lib as part of migration from Ant to Gradle builds.

reger6a8d351df3af
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