From fe061a45bd30cfd242c89cd7f6f39769cd2f34d4 Mon Sep 17 00:00:00 2001
From: signald <nobody@signald.org>
Date: Wed, 6 Apr 2022 11:22:32 -0700
Subject: [PATCH] update gradle files

---
 java/build.gradle        |  9 +--------
 java/client/build.gradle | 32 +++++++++-----------------------
 java/settings.gradle     | 11 +----------
 3 files changed, 11 insertions(+), 41 deletions(-)

diff --git a/java/build.gradle b/java/build.gradle
index 0b62e4ac..1d67021c 100644
--- a/java/build.gradle
+++ b/java/build.gradle
@@ -6,7 +6,7 @@ def version_number = "0.15.0"
 
 subprojects {
     ext.version_number     = version_number
-    ext.group_info         = "org.signal"
+    ext.group_info         = "org.signald"
 
     if (JavaVersion.current().isJava8Compatible()) {
         allprojects {
@@ -31,13 +31,6 @@ task makeJniLibrariesDesktop(type:Exec) {
   commandLine './build_jni.sh', 'desktop'
 }
 
-task makeAll() {
-  group 'Rust'
-  description 'Build the native libraries'
-
-  dependsOn 'makeJniLibrariesDesktop', 'makeJniLibrariesAndroid'
-}
-
 task cargoClean(type:Exec) {
   group 'Rust'
   commandLine 'cargo', 'clean'
diff --git a/java/client/build.gradle b/java/client/build.gradle
index 7ee6b154..5dfdea74 100644
--- a/java/client/build.gradle
+++ b/java/client/build.gradle
@@ -1,7 +1,6 @@
 plugins {
     id 'java-library'
     id 'maven-publish'
-    id 'signing'
 }
 
 sourceCompatibility = 1.8
@@ -46,23 +45,12 @@ java {
     withJavadocJar()
 }
 
-processResources {
-    // TODO: Build a different variant of the JNI library for server.
-    dependsOn ':makeJniLibrariesDesktop'
-    dependsOn ':downloadNonLinuxLibraries'
-    gradle.taskGraph.whenReady { graph ->
-        if (graph.hasTask(":client:publish")) {
-            tasks.getByPath(":downloadNonLinuxLibraries").enabled = true
-        }
-    }
-}
-
 // MARK: Publishing
 
 publishing {
     publications {
         mavenJava(MavenPublication) {
-            artifactId = archivesBaseName
+            artifactId = archivesBaseName + "-" + System.getenv("TARGET")
             from components.java
 
             pom {
@@ -93,16 +81,14 @@ publishing {
     }
     repositories {
         maven {
-            url = getReleaseRepositoryUrl()
-            credentials {
-                username = getRepositoryUsername()
-                password = getRepositoryPassword()
+            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)
             }
         }
     }
-}
-
-signing {
-    required { isReleaseBuild() && gradle.taskGraph.hasTask(":client:publish") }
-    sign publishing.publications.mavenJava
-}
+}
\ No newline at end of file
diff --git a/java/settings.gradle b/java/settings.gradle
index f6414646..13575990 100644
--- a/java/settings.gradle
+++ b/java/settings.gradle
@@ -6,13 +6,4 @@ pluginManagement {
     }
 }
 
-include ':client', ':server'
-
-if (JavaVersion.current().isJava11Compatible()) {
-    include ':android'
-} else if (gradle.startParameter.getTaskNames().any { name -> name.contains('android:') }) {
-    throw new GradleException("building for Android requires JDK 11 or newer")
-} else if (gradle.startParameter.getTaskNames().any { name -> name.lastIndexOf(':') <= 0 }) {
-    // If there are any top-level tasks ("build" or ":build" but not ":client:build")...
-    throw new GradleException("building for Android requires JDK 11 or newer; use 'client:' or 'server:' to only build certain products")
-}
+include ':client'
\ No newline at end of file
-- 
2.30.2