libsignal-client/libsignal.patch
2022-03-04 14:19:51 -08:00

226 lines
7 KiB
Diff

From e5798a14c2719ab4f72a3f45a4bd3a7784280087 Mon Sep 17 00:00:00 2001
From: signald <nobody@signald.org>
Date: Thu, 18 Nov 2021 17:54:25 -0800
Subject: [PATCH] update gradle files
---
java/build.gradle | 8 +-
java/java/build.gradle | 100 ++++-------------------
java/java/src/main/java/module-info.java | 28 +++++++
java/settings.gradle | 2 +-
4 files changed, 46 insertions(+), 92 deletions(-)
create mode 100644 java/java/src/main/java/module-info.java
diff --git a/java/build.gradle b/java/build.gradle
index 8a64a47..79d80b5 100644
--- a/java/build.gradle
+++ b/java/build.gradle
@@ -1,6 +1,6 @@
subprojects {
ext.version_number = "0.12.3"
- ext.group_info = "org.whispersystems"
+ ext.group_info = "org.signald"
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
@@ -43,9 +43,3 @@ task clean(type: Delete) {
}
clean.dependsOn(cargoClean)
-task makeAll() {
- group 'Rust'
- description 'Build the native libraries'
-
- dependsOn 'makeJniLibrariesDesktop', 'makeJniLibrariesAndroid'
-}
diff --git a/java/java/build.gradle b/java/java/build.gradle
index 55b1ee2..7f23eed 100644
--- a/java/java/build.gradle
+++ b/java/java/build.gradle
@@ -7,13 +7,12 @@ buildscript {
plugins {
id "de.undercouch.download" version "4.1.1"
+ id 'maven-publish'
}
apply plugin: 'java'
-apply plugin: 'maven'
-apply plugin: 'signing'
-sourceCompatibility = 1.7
+sourceCompatibility = 1.9
archivesBaseName = "signal-client-java"
version = version_number
group = group_info
@@ -24,18 +23,9 @@ repositories {
}
sourceSets {
- test {
- java {
- srcDirs = ['src/test/java/', project(':tests').file('src/test/java')]
- }
- }
otherPlatformLibraries {}
}
-dependencies {
- testCompile ('junit:junit:4.12')
-}
-
test {
testLogging {
events 'passed'
@@ -67,55 +57,23 @@ def getRepositoryPassword() {
return hasProperty('whisperSonatypePassword') ? whisperSonatypePassword : ""
}
-signing {
- required { isReleaseBuild() && gradle.taskGraph.hasTask(":java:uploadArchives") }
- sign configurations.archives
-}
-
-uploadArchives {
- configuration = configurations.archives
- repositories.mavenDeployer {
- beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
-
- repository(url: getReleaseRepositoryUrl()) {
- authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
- }
-
- pom.project {
- name 'signal-client-java'
- packaging 'jar'
- description 'Signal Protocol cryptography library for Java'
- url 'https://github.com/signalapp/libsignal-client'
-
- scm {
- url 'scm:git@github.com:signalapp/libsignal-client.git'
- connection 'scm:git@github.com:signalapp/libsignal-client.git'
- developerConnection 'scm:git@github.com:signalapp/libsignal-client.git'
- }
-
- licenses {
- license {
- name 'AGPLv3'
- url 'https://www.gnu.org/licenses/agpl-3.0.txt'
- distribution 'repo'
- }
- }
-
- developers {
- developer {
- name 'Signal Messenger LLC'
- }
- }
+publishing {
+ publications {
+ library(MavenPublication) {
+ from components.java
+ artifactId = archivesBaseName + "-" + System.getenv("TARGET").replaceAll("_", "-")
}
}
-}
-
-task installArchives(type: Upload) {
- description "Installs the artifacts to the local Maven repository."
- configuration = configurations['archives']
repositories {
- mavenDeployer {
- repository url: "file://${System.properties['user.home']}/.m2/repository"
+ maven {
+ url System.getenv("CI_API_V4_URL") + "/projects/" + System.getenv("CI_PROJECT_ID") + "/packages/maven"
+ credentials(HttpHeaderCredentials) {
+ name = 'Job-Token'
+ value = System.getenv("CI_JOB_TOKEN")
+ }
+ authentication {
+ header(HttpHeaderAuthentication)
+ }
}
}
}
@@ -130,36 +88,10 @@ task packageSources(type: Jar) {
classifier = 'sources'
}
-task testableJar(type: Jar) {
- from sourceSets.main.output
- from sourceSets.otherPlatformLibraries.resources
- classifier = 'testable'
-
- onlyIf { gradle.taskGraph.hasTask(':java:uploadArchives') }
-
- def extraResources = ['signal_jni.dll', 'libsignal_jni.dylib']
- def extraResourcesDir = 'src/otherPlatformLibraries/resources'
-
- doFirst {
- mkdir extraResourcesDir
- extraResources.each { name ->
- download {
- src 'https://github.com/signalapp/libsignal-client/releases/download/v' + project.version + '/' + name
- dest extraResourcesDir + '/' + name
- }
- }
- }
-}
-
artifacts {
archives(packageJavadoc) {
type = 'javadoc'
}
archives packageSources
- archives testableJar
-}
-
-tasks.withType(JavaCompile) {
- compileTask -> compileTask.dependsOn ':makeJniLibrariesDesktop'
}
diff --git a/java/java/src/main/java/module-info.java b/java/java/src/main/java/module-info.java
new file mode 100644
index 0000000..8a766d8
--- /dev/null
+++ b/java/java/src/main/java/module-info.java
@@ -0,0 +1,28 @@
+module org.signald.libsignal.client {
+ exports org.signal.client.internal;
+ exports org.signal.libsignal.crypto;
+ exports org.signal.libsignal.crypto.jce;
+ exports org.signal.libsignal.devicetransfer;
+ exports org.signal.libsignal.hsmenclave;
+ exports org.signal.libsignal.metadata;
+ exports org.signal.libsignal.metadata.certificate;
+ exports org.signal.libsignal.metadata.protocol;
+ exports org.signal.zkgroup;
+ exports org.signal.zkgroup.auth;
+ exports org.signal.zkgroup.groups;
+ exports org.signal.zkgroup.internal;
+ exports org.signal.zkgroup.profiles;
+ exports org.signal.zkgroup.receipts;
+ exports org.whispersystems.libsignal;
+ exports org.whispersystems.libsignal.ecc;
+ exports org.whispersystems.libsignal.fingerprint;
+ exports org.whispersystems.libsignal.groups;
+ exports org.whispersystems.libsignal.groups.state;
+ exports org.whispersystems.libsignal.kdf;
+ exports org.whispersystems.libsignal.logging;
+ exports org.whispersystems.libsignal.protocol;
+ exports org.whispersystems.libsignal.state;
+ exports org.whispersystems.libsignal.state.impl;
+ exports org.whispersystems.libsignal.util;
+ exports org.whispersystems.libsignal.util.guava;
+}
\ No newline at end of file
diff --git a/java/settings.gradle b/java/settings.gradle
index 7412250..4c0f3cd 100644
--- a/java/settings.gradle
+++ b/java/settings.gradle
@@ -1 +1 @@
-include ':java', ':android', ':tests'
+include ':java'
--
2.30.2