mirror of
https://github.com/signalapp/libsignal.git
synced 2026-04-25 17:25:18 +02:00
Test it by porting several tests from FutureTest.java to Kotlin and using Kotlin idioms for awaiting and cancellation.
138 lines
3.4 KiB
Groovy
138 lines
3.4 KiB
Groovy
buildscript {
|
|
dependencies {
|
|
// This isn't compatible with the `plugins` lookup method, so it has to
|
|
// be declared in a `buildscript` block. See
|
|
// https://github.com/gradle/gradle/issues/1541 for info.
|
|
classpath 'com.guardsquare:proguard-gradle:7.4.2'
|
|
}
|
|
}
|
|
|
|
plugins {
|
|
id 'java-library'
|
|
id 'maven-publish'
|
|
id 'signing'
|
|
id 'org.jetbrains.kotlin.jvm'
|
|
}
|
|
|
|
sourceCompatibility = 17
|
|
archivesBaseName = "libsignal-client"
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
mavenLocal()
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
java {
|
|
// Include libsignal sources shared between the client and server
|
|
srcDir '../shared/java'
|
|
}
|
|
kotlin {
|
|
srcDir 'src/main/java'
|
|
srcDir 'src/main/kotlin'
|
|
// Include libsignal sources shared between the client and server
|
|
srcDir '../shared/java'
|
|
srcDir '../shared/kotlin'
|
|
}
|
|
resources {
|
|
srcDir '../shared/resources'
|
|
}
|
|
}
|
|
test {
|
|
java {
|
|
srcDir '../shared/test/java'
|
|
}
|
|
kotlin {
|
|
srcDir 'src/test/java'
|
|
srcDir 'src/test/kotlin'
|
|
srcDir '../shared/test/java'
|
|
srcDir '../shared/test/kotlin'
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
testImplementation 'junit:junit:4.13'
|
|
testImplementation 'com.googlecode.json-simple:json-simple:1.1'
|
|
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.10.2'
|
|
testImplementation 'org.jetbrains.kotlin:kotlin-test:2.1.0'
|
|
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2'
|
|
}
|
|
|
|
test {
|
|
jvmArgs '-Xcheck:jni'
|
|
testLogging {
|
|
events 'passed','skipped','failed'
|
|
showStandardStreams = true
|
|
showExceptions true
|
|
exceptionFormat 'full'
|
|
showCauses true
|
|
showStackTraces true
|
|
}
|
|
}
|
|
|
|
java {
|
|
withSourcesJar()
|
|
withJavadocJar()
|
|
}
|
|
|
|
sourcesJar {
|
|
// Cut down on artifact size by leaving these out of the sources jar.
|
|
exclude '*.dll'
|
|
exclude '*.dylib'
|
|
exclude '*.so'
|
|
}
|
|
|
|
tasks.named('jar') {
|
|
manifest {
|
|
attributes('Automatic-Module-Name': 'org.signal.libsignal')
|
|
}
|
|
}
|
|
|
|
processResources {
|
|
dependsOn ':makeJniLibrariesDesktop'
|
|
}
|
|
|
|
// MARK: Publishing
|
|
|
|
publishing {
|
|
publications {
|
|
mavenJava(MavenPublication) {
|
|
artifactId = archivesBaseName
|
|
from components.java
|
|
|
|
pom {
|
|
name = archivesBaseName
|
|
description = 'Signal Protocol cryptography library for Java'
|
|
url = 'https://github.com/signalapp/libsignal'
|
|
|
|
scm {
|
|
url = 'scm:git@github.com:signalapp/libsignal.git'
|
|
connection = 'scm:git@github.com:signalapp/libsignal.git'
|
|
developerConnection = 'scm:git@github.com:signalapp/libsignal.git'
|
|
}
|
|
|
|
licenses {
|
|
license {
|
|
name = 'AGPLv3'
|
|
url = 'https://www.gnu.org/licenses/agpl-3.0.txt'
|
|
}
|
|
}
|
|
|
|
developers {
|
|
developer {
|
|
name = 'Signal Messenger LLC'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
setUpSigningKey(signing)
|
|
signing {
|
|
required { isReleaseBuild() && gradle.taskGraph.hasTask(":client:publish") }
|
|
sign publishing.publications.mavenJava
|
|
}
|