From 21e0a4f1f3aec43589e052f5c46a44c58d41a82b Mon Sep 17 00:00:00 2001 From: signald Date: Sat, 16 Dec 2023 16:42:49 -0800 Subject: [PATCH] update build files and provide a way for the websocket receive callback to indicate the message was not saved --- build.gradle.kts | 16 ++---- constants.gradle.kts | 2 +- core-util-jvm/build.gradle.kts | 18 +++++-- dependencies.gradle.kts | 2 +- gradle/verification-metadata.xml | 88 +++++++++++++++++++++++++++++--- service/build.gradle.kts | 21 ++++++-- settings.gradle.kts | 7 ++- 7 files changed, 122 insertions(+), 32 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 89519ef1..8d9d01d9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,6 +6,9 @@ buildscript { rootProject.extra["kotlin_version"] = "1.9.10" repositories { + maven { + url = uri("https://gitlab.com/api/v4/groups/6853927/-/packages/maven") // https://gitlab.com/groups/signald/-/packages + } google() mavenCentral() maven { @@ -31,23 +34,12 @@ buildscript { apply(from = "${rootDir}/constants.gradle.kts") -plugins { - id("io.github.gradle-nexus.publish-plugin") version "1.3.0" -} -project.group = "com.github.turasa" +project.group = "org.signald" val repositoryUsername = project.findProperty("whisperSonatypeUsername")?.toString() ?: "" val repositoryPassword = project.findProperty("whisperSonatypePassword")?.toString() ?: "" -nexusPublishing { - repositories { - sonatype { - username = repositoryUsername - password = repositoryPassword - } - } -} val lib_signal_service_version_number: String by rootProject.extra val lib_signal_service_group_info: String by rootProject.extra diff --git a/constants.gradle.kts b/constants.gradle.kts index ab7c497a..f1875c35 100644 --- a/constants.gradle.kts +++ b/constants.gradle.kts @@ -1,4 +1,4 @@ val signalJavaVersion by extra(JavaVersion.VERSION_17) val signalKotlinJvmTarget by extra("17") val lib_signal_service_version_number by extra { "2.15.3_unofficial_90" } -val lib_signal_service_group_info by extra { "com.github.turasa" } +val lib_signal_service_group_info by extra { "org.signald" } diff --git a/core-util-jvm/build.gradle.kts b/core-util-jvm/build.gradle.kts index 83af3c34..8ca9ba2b 100644 --- a/core-util-jvm/build.gradle.kts +++ b/core-util-jvm/build.gradle.kts @@ -58,10 +58,18 @@ publishing { } } } + repositories { + maven { + url = uri(System.getenv("CI_API_V4_URL") + "/projects/" + System.getenv("CI_PROJECT_ID") + "/packages/maven") + name = "GitLab" + credentials(HttpHeaderCredentials::class) { + name = "Job-Token" + value = System.getenv("CI_JOB_TOKEN") + } + authentication { + create("header", HttpHeaderAuthentication::class) + } + } + } } } - -signing { - isRequired = gradle.taskGraph.hasTask("uploadArchives") - sign(publishing.publications["mavenJava"]) -} diff --git a/dependencies.gradle.kts b/dependencies.gradle.kts index 152a0298..e0bd16af 100644 --- a/dependencies.gradle.kts +++ b/dependencies.gradle.kts @@ -13,7 +13,7 @@ dependencyResolutionManagement { library("google-jsr305", "com.google.code.findbugs:jsr305:3.0.2") // 1st Party - library("libsignal-client", "org.signal", "libsignal-client").versionRef("libsignal-client") + library("libsignal-client", "org.signald", "libsignal-client-" + System.getenv("TARGET")).versionRef("libsignal-client") // Third Party library("jackson-core", "com.fasterxml.jackson.core:jackson-databind:2.16.0") diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index 7b9f9ca9..87bc8856 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -1,5 +1,5 @@ - + true false @@ -60,6 +60,11 @@ + + + + + @@ -451,6 +456,9 @@ + + + @@ -800,6 +808,12 @@ + + + + + + @@ -816,6 +830,12 @@ + + + + + + @@ -890,6 +910,14 @@ + + + + + + + + @@ -978,6 +1006,14 @@ + + + + + + + + @@ -1012,6 +1048,14 @@ + + + + + + + + @@ -1046,6 +1090,14 @@ + + + + + + + + @@ -1070,6 +1122,14 @@ + + + + + + + + @@ -1209,6 +1269,22 @@ + + + + + + + + + + + + + + + + @@ -1238,12 +1314,12 @@ - - - + + + - - + + diff --git a/service/build.gradle.kts b/service/build.gradle.kts index bc927658..00f2081c 100644 --- a/service/build.gradle.kts +++ b/service/build.gradle.kts @@ -112,9 +112,10 @@ publishing { publications { create("mavenJava") { from(components["java"]) + "signal-service-java-" + System.getenv("TARGET") pom { - name.set("signal-service-java") + name.set("signal-service-java-" + System.getenv("TARGET")) description.set("Signal Service communication library for Java, unofficial fork") url.set("https://github.com/Turasa/libsignal-service-java") licenses { @@ -141,10 +142,20 @@ publishing { } } } + + repositories { + maven { + url = uri(System.getenv("CI_API_V4_URL") + "/projects/" + System.getenv("CI_PROJECT_ID") + "/packages/maven") + name = "GitLab" + credentials(HttpHeaderCredentials::class) { + name = "Job-Token" + value = System.getenv("CI_JOB_TOKEN") + } + authentication { + create("header", HttpHeaderAuthentication::class) + } + } + } } } -signing { - isRequired = gradle.taskGraph.hasTask("uploadArchives") - sign(publishing.publications["mavenJava"]) -} diff --git a/settings.gradle.kts b/settings.gradle.kts index b0de0df4..83b67727 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,12 +1,15 @@ dependencyResolutionManagement { repositories { + maven { + url = uri("https://gitlab.com/api/v4/groups/6853927/-/packages/maven") // https://gitlab.com/groups/signald/-/packages + } mavenCentral() mavenLocal() } } -include("signal-service-java") -project(":signal-service-java").projectDir = file("service") +include("signal-service-java-" + System.getenv("TARGET")) +project(":signal-service-java-" + System.getenv("TARGET")).projectDir = file("service") include(":core-util-jvm") -- 2.39.2