mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-27 14:40:22 +00:00
Converted libsignal-service to .gradle.kts.
This commit is contained in:
committed by
Cody Henthorne
parent
8f59e51445
commit
923eb05e59
@@ -53,10 +53,6 @@ allprojects {
|
||||
}
|
||||
|
||||
subprojects {
|
||||
ext.lib_signal_service_version_number = "2.15.3"
|
||||
ext.lib_signal_service_group_info = "org.whispersystems"
|
||||
ext.lib_signal_client_version = "0.1.0"
|
||||
|
||||
if (JavaVersion.current().isJava8Compatible()) {
|
||||
allprojects {
|
||||
tasks.withType(Javadoc) {
|
||||
|
||||
@@ -1,183 +0,0 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
apply plugin: 'java-library'
|
||||
apply plugin: 'org.jetbrains.kotlin.jvm'
|
||||
apply plugin: 'java-test-fixtures'
|
||||
apply plugin: 'maven-publish'
|
||||
apply plugin: 'signing'
|
||||
apply plugin: 'idea'
|
||||
apply plugin: 'org.jlleitschuh.gradle.ktlint'
|
||||
apply plugin: 'com.squareup.wire'
|
||||
|
||||
archivesBaseName = "signal-service-java"
|
||||
version = lib_signal_service_version_number
|
||||
group = lib_signal_service_group_info
|
||||
|
||||
java {
|
||||
withJavadocJar()
|
||||
withSourcesJar()
|
||||
sourceCompatibility = signalJavaVersion
|
||||
targetCompatibility = signalJavaVersion
|
||||
}
|
||||
|
||||
tasks.withType(KotlinCompile).configureEach {
|
||||
kotlinOptions {
|
||||
jvmTarget = signalKotlinJvmTarget
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
ideaTestFixturesImplementation { extendsFrom testFixturesImplementation; canBeConsumed false; canBeResolved true }
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
[
|
||||
'runKtlintCheckOverMainSourceSet',
|
||||
'runKtlintFormatOverMainSourceSet'
|
||||
].forEach { taskName ->
|
||||
tasks.named(taskName) {
|
||||
mustRunAfter tasks.named('generateMainProtos')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ktlint {
|
||||
version.set("0.49.1")
|
||||
|
||||
filter {
|
||||
exclude { entry ->
|
||||
entry.file.toString().contains("build/generated/source/wire")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
implementation project(":core-util-jvm")
|
||||
|
||||
testImplementation testLibs.junit.junit
|
||||
testImplementation testLibs.assertj.core
|
||||
testImplementation testLibs.conscrypt.openjdk.uber
|
||||
testImplementation testLibs.mockito.core
|
||||
|
||||
testFixturesImplementation libs.libsignal.client
|
||||
testFixturesImplementation testLibs.junit.junit
|
||||
}
|
||||
|
||||
tasks.whenTaskAdded { task ->
|
||||
if (task.name.equals("lint")) {
|
||||
task.enabled = false
|
||||
}
|
||||
}
|
||||
|
||||
wire {
|
||||
protoLibrary = true
|
||||
|
||||
kotlin {
|
||||
javaInterop = true
|
||||
}
|
||||
|
||||
sourcePath {
|
||||
srcDir 'src/main/protowire'
|
||||
}
|
||||
|
||||
custom {
|
||||
// Comes from wire-handler jar project
|
||||
schemaHandlerFactoryClass = "org.signal.wire.Factory"
|
||||
}
|
||||
}
|
||||
|
||||
idea {
|
||||
module {
|
||||
scopes.COMPILE.plus += [configurations.ideaTestFixturesImplementation]
|
||||
}
|
||||
}
|
||||
|
||||
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('whisperSonatypeUsername') ? whisperSonatypeUsername : ""
|
||||
}
|
||||
|
||||
def getRepositoryPassword() {
|
||||
return hasProperty('whisperSonatypePassword') ? whisperSonatypePassword : ""
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
artifactId = 'signal-service-java'
|
||||
from components.java
|
||||
|
||||
pom {
|
||||
name = 'signal-service-java'
|
||||
packaging = 'jar'
|
||||
description = 'Signal Service communication library for Java'
|
||||
url = 'https://github.com/WhisperSystems/libsignal-service-java'
|
||||
|
||||
scm {
|
||||
url = 'scm:git@github.com:WhisperSystems/libsignal-service-java.git'
|
||||
connection = 'scm:git@github.com:WhisperSystems/libsignal-service-java.git'
|
||||
developerConnection = 'scm:git@github.com:WhisperSystems/libsignal-service-java.git'
|
||||
}
|
||||
|
||||
licenses {
|
||||
license {
|
||||
name = 'GPLv3'
|
||||
url = 'https://www.gnu.org/licenses/gpl-3.0.txt'
|
||||
distribution = 'repo'
|
||||
}
|
||||
}
|
||||
|
||||
developers {
|
||||
developer {
|
||||
name = 'Moxie Marlinspike'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url = getReleaseRepositoryUrl()
|
||||
credentials {
|
||||
username getRepositoryUsername()
|
||||
password getRepositoryPassword()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
signing {
|
||||
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
|
||||
sign publishing.publications.mavenJava
|
||||
}
|
||||
|
||||
task installArchives(type: Upload) {
|
||||
description "Installs the artifacts to the local Maven repository."
|
||||
configuration = configurations['archives']
|
||||
repositories {
|
||||
mavenLocal()
|
||||
}
|
||||
}
|
||||
101
libsignal-service/build.gradle.kts
Normal file
101
libsignal-service/build.gradle.kts
Normal file
@@ -0,0 +1,101 @@
|
||||
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 {
|
||||
kotlinOptions {
|
||||
jvmTarget = signalKotlinJvmTarget
|
||||
}
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
listOf(
|
||||
"runKtlintCheckOverMainSourceSet",
|
||||
"runKtlintFormatOverMainSourceSet"
|
||||
).forEach { taskName ->
|
||||
tasks.named(taskName) {
|
||||
mustRunAfter(tasks.named("generateMainProtos"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ktlint {
|
||||
version.set("0.49.1")
|
||||
|
||||
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)
|
||||
|
||||
implementation(project(":core-util-jvm"))
|
||||
|
||||
testImplementation(testLibs.junit.junit)
|
||||
testImplementation(testLibs.assertj.core)
|
||||
testImplementation(testLibs.conscrypt.openjdk.uber)
|
||||
testImplementation(testLibs.mockito.core)
|
||||
|
||||
testFixturesImplementation(libs.libsignal.client)
|
||||
testFixturesImplementation(testLibs.junit.junit)
|
||||
}
|
||||
Reference in New Issue
Block a user