1
1
mirror of https://github.com/MarginaliaSearch/MarginaliaSearch.git synced 2025-10-05 21:22:39 +02:00
Files
MarginaliaSearch/code/libraries/native/build.gradle
2025-08-11 18:04:25 +02:00

36 lines
862 B
Groovy

plugins {
id 'java'
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(rootProject.ext.jvmVersion))
}
}
dependencies {
implementation libs.bundles.slf4j
implementation libs.fastutil
testImplementation libs.bundles.slf4j.test
testImplementation libs.bundles.junit
}
apply from: "$rootProject.projectDir/srcsets.gradle"
// We use a custom task to compile the C++ code into a shared library
// with a shellscript as gradle's c++ tasks are kind of insufferable
tasks.register('compileCpp', Exec) {
inputs.files('Makefile', 'src/sort.cc', 'src/unix.cc', 'src/uring.cc')
outputs.files('resources/libcpp.so', 'resources/liburing.so')
commandLine 'make', 'all'
}
tasks.register('cleanCpp', Exec) {
commandLine 'make', 'clean'
}
processResources.dependsOn('compileCpp')
clean.dependsOn('cleanCpp')