0
0
mirror of https://github.com/signalapp/libsignal.git synced 2024-09-20 12:02:18 +02:00
libsignal/java/build.gradle
2022-08-22 15:21:40 -07:00

95 lines
2.1 KiB
Groovy

plugins {
id "de.undercouch.download" version "5.0.2"
}
def version_number = "0.20.0"
subprojects {
ext.version_number = version_number
ext.group_info = "org.signal"
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs += ["-Xlint:deprecation", "-Xlint:fallthrough", "-Xlint:unchecked"]
}
}
}
task makeJniLibrariesAndroid(type:Exec) {
group 'Rust'
description 'Build the JNI libraries'
commandLine './build_jni.sh', 'android'
}
task makeJniLibrariesDesktop(type:Exec) {
group 'Rust'
description 'Build the JNI libraries'
commandLine './build_jni.sh', 'desktop'
}
task makeAll() {
group 'Rust'
description 'Build the native libraries'
dependsOn 'makeJniLibrariesDesktop', 'makeJniLibrariesAndroid'
}
task cargoClean(type:Exec) {
group 'Rust'
commandLine 'cargo', 'clean'
}
task clean(type: Delete) {
description 'Clean JNI libs'
delete fileTree('./android/src/main/jniLibs') {
include '**/*.so'
}
delete fileTree('./shared/resources') {
include '**/*.so'
include '**/*.dylib'
include '**/*.dll'
}
}
clean.dependsOn(cargoClean)
task downloadNonLinuxLibraries(type: Download) {
// Must be explicitly enabled.
enabled false
def extraResources = ['signal_jni.dll', 'libsignal_jni.dylib']
src(extraResources.collect {
'https://github.com/signalapp/libsignal/releases/download/v' + version_number + '/' + it
})
dest 'shared/resources'
}
// PUBLISHING
def isReleaseBuild() {
return version.contains("SNAPSHOT") == false
}
def getReleaseRepositoryUrl() {
return hasProperty('sonatypeRepo') ? sonatypeRepo
: "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
}
def getRepositoryUsername() {
return hasProperty('sonatypeUsername') ? sonatypeUsername : ""
}
def getRepositoryPassword() {
return hasProperty('sonatypePassword') ? sonatypePassword : ""
}