plugins { id "de.undercouch.download" version "5.0.2" id "base" } def version_number = "0.31.0" subprojects { ext.version_number = version_number ext.group_info = "org.signal" if (JavaVersion.current().isJava8Compatible()) { allprojects { tasks.withType(Javadoc) { options.encoding = 'UTF-8' options.addStringOption('Xdoclint:none', '-quiet') } } } allprojects { tasks.withType(JavaCompile) { options.encoding = 'UTF-8' options.compilerArgs += ["-Xlint:deprecation", "-Xlint:fallthrough", "-Xlint:unchecked"] } } } task makeJniLibrariesDesktop(type:Exec) { group 'Rust' description 'Build the JNI libraries' // Explicitly specify 'bash' for Windows compatibility. commandLine 'bash', './build_jni.sh', 'desktop' } task cargoClean(type:Exec) { group 'Rust' commandLine 'cargo', 'clean' } task cleanJni(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, cleanJni]) 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 : "" }