2024-05-15 21:41:30 -04:00
|
|
|
/*
|
|
|
|
* Copyright 2024 Signal Messenger, LLC
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2024-12-20 11:23:57 -05:00
|
|
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
2023-11-26 13:41:55 -05:00
|
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
|
|
|
|
|
|
plugins {
|
|
|
|
id("java-library")
|
|
|
|
id("org.jetbrains.kotlin.jvm")
|
|
|
|
id("java-test-fixtures")
|
|
|
|
id("maven-publish")
|
|
|
|
id("signing")
|
|
|
|
id("idea")
|
|
|
|
id("org.jlleitschuh.gradle.ktlint")
|
|
|
|
id("com.squareup.wire")
|
|
|
|
}
|
|
|
|
|
|
|
|
val signalBuildToolsVersion: String by rootProject.extra
|
|
|
|
val signalCompileSdkVersion: String by rootProject.extra
|
|
|
|
val signalTargetSdkVersion: Int by rootProject.extra
|
|
|
|
val signalMinSdkVersion: Int by rootProject.extra
|
|
|
|
val signalJavaVersion: JavaVersion by rootProject.extra
|
|
|
|
val signalKotlinJvmTarget: String by rootProject.extra
|
|
|
|
|
|
|
|
java {
|
|
|
|
withJavadocJar()
|
|
|
|
withSourcesJar()
|
|
|
|
sourceCompatibility = signalJavaVersion
|
|
|
|
targetCompatibility = signalJavaVersion
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType<KotlinCompile>().configureEach {
|
2024-12-20 11:23:57 -05:00
|
|
|
kotlin {
|
|
|
|
compilerOptions {
|
|
|
|
jvmTarget = JvmTarget.fromTarget(signalKotlinJvmTarget)
|
|
|
|
freeCompilerArgs = listOf("-Xjvm-default=all")
|
|
|
|
}
|
2023-11-26 13:41:55 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
afterEvaluate {
|
|
|
|
listOf(
|
|
|
|
"runKtlintCheckOverMainSourceSet",
|
2024-09-20 12:24:57 -04:00
|
|
|
"runKtlintFormatOverMainSourceSet",
|
|
|
|
"sourcesJar"
|
2023-11-26 13:41:55 -05:00
|
|
|
).forEach { taskName ->
|
|
|
|
tasks.named(taskName) {
|
|
|
|
mustRunAfter(tasks.named("generateMainProtos"))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ktlint {
|
2024-05-15 21:41:30 -04:00
|
|
|
version.set("1.2.1")
|
2023-11-26 13:41:55 -05:00
|
|
|
|
|
|
|
filter {
|
|
|
|
exclude { entry ->
|
|
|
|
entry.file.toString().contains("build/generated/source/wire")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
wire {
|
|
|
|
protoLibrary = true
|
|
|
|
|
|
|
|
kotlin {
|
|
|
|
javaInterop = true
|
|
|
|
}
|
|
|
|
|
|
|
|
sourcePath {
|
|
|
|
srcDir("src/main/protowire")
|
|
|
|
}
|
|
|
|
|
|
|
|
custom {
|
|
|
|
// Comes from wire-handler jar project
|
|
|
|
schemaHandlerFactoryClass = "org.signal.wire.Factory"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.whenTaskAdded {
|
|
|
|
if (name == "lint") {
|
|
|
|
enabled = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
api(libs.google.libphonenumber)
|
|
|
|
api(libs.jackson.core)
|
|
|
|
api(libs.jackson.module.kotlin)
|
|
|
|
|
|
|
|
implementation(libs.libsignal.client)
|
|
|
|
api(libs.square.okhttp3)
|
|
|
|
api(libs.square.okio)
|
|
|
|
implementation(libs.google.jsr305)
|
|
|
|
|
|
|
|
api(libs.rxjava3.rxjava)
|
|
|
|
|
|
|
|
implementation(libs.kotlin.stdlib.jdk8)
|
2024-11-07 10:42:54 -05:00
|
|
|
implementation(libs.kotlinx.coroutines.core)
|
|
|
|
implementation(libs.kotlinx.coroutines.core.jvm)
|
2023-11-26 13:41:55 -05:00
|
|
|
|
|
|
|
implementation(project(":core-util-jvm"))
|
|
|
|
|
|
|
|
testImplementation(testLibs.junit.junit)
|
2024-12-12 20:35:57 -06:00
|
|
|
testImplementation(testLibs.assertk)
|
2023-11-26 13:41:55 -05:00
|
|
|
testImplementation(testLibs.conscrypt.openjdk.uber)
|
2024-04-24 12:19:40 -07:00
|
|
|
testImplementation(testLibs.mockk)
|
2023-11-26 13:41:55 -05:00
|
|
|
|
|
|
|
testFixturesImplementation(libs.libsignal.client)
|
|
|
|
testFixturesImplementation(testLibs.junit.junit)
|
|
|
|
}
|