diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index ab77d58e547..72ee8bf108d 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -52,19 +52,11 @@ dependencies { annotationProcessor("com.google.auto.value:auto-value:1.6.5") implementation(kotlin("gradle-plugin", "1.8.22")) implementation(libs.org.json) + implementation(libs.bundles.maven.resolver) - implementation("org.eclipse.aether:aether-api:1.0.0.v20140518") - implementation("org.eclipse.aether:aether-util:1.0.0.v20140518") + implementation("com.google.guava:guava:31.1-jre") implementation("org.ow2.asm:asm-tree:9.5") - implementation("org.eclipse.aether:aether-impl:1.0.0.v20140518") - implementation("org.eclipse.aether:aether-connector-basic:1.0.0.v20140518") - implementation("org.eclipse.aether:aether-transport-file:1.0.0.v20140518") - implementation("org.eclipse.aether:aether-transport-http:1.0.0.v20140518") - implementation("org.eclipse.aether:aether-transport-wagon:1.0.0.v20140518") - implementation("org.apache.maven:maven-aether-provider:3.3.9") - implementation("org.eclipse.jgit:org.eclipse.jgit:6.3.0.202209071007-r") - implementation(libs.kotlinx.serialization.json) implementation("com.google.code.gson:gson:2.8.9") implementation(libs.android.gradlePlugin.gradle) diff --git a/buildSrc/src/main/java/com/google/firebase/gradle/bomgenerator/BomGeneratorTask.java b/buildSrc/src/main/java/com/google/firebase/gradle/bomgenerator/BomGeneratorTask.java index bf88f511990..433b9132e36 100644 --- a/buildSrc/src/main/java/com/google/firebase/gradle/bomgenerator/BomGeneratorTask.java +++ b/buildSrc/src/main/java/com/google/firebase/gradle/bomgenerator/BomGeneratorTask.java @@ -16,7 +16,6 @@ import static java.util.stream.Collectors.toList; -import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Sets; import com.google.firebase.gradle.bomgenerator.model.Dependency; @@ -51,7 +50,7 @@ public abstract class BomGeneratorTask extends DefaultTask { private static final List BOM_ARTIFACTS = - ImmutableList.of( + List.of( "com.google.firebase:firebase-analytics", "com.google.firebase:firebase-analytics-ktx", "com.google.firebase:firebase-appcheck-debug", @@ -94,7 +93,7 @@ public abstract class BomGeneratorTask extends DefaultTask { "com.google.firebase:firebase-storage-ktx", "com.google.firebase:firebase-vertexai"); private static final List IGNORED_ARTIFACTS = - ImmutableList.of( + List.of( "crash-plugin", "firebase-ml-vision", "crashlytics", @@ -175,7 +174,7 @@ public abstract class BomGeneratorTask extends DefaultTask { "firebase-ml-natural-language-translate", "firebase-ml-natural-language-translate-model"); private static final List IMPORTANT_NON_FIREBASE_LIBRARIES = - ImmutableList.of( + List.of( "com.google.android.gms:play-services-ads", "com.google.gms:google-services", "com.android.tools.build:gradle", diff --git a/buildSrc/src/main/java/com/google/firebase/gradle/plugins/FirebaseJavaLibraryPlugin.kt b/buildSrc/src/main/java/com/google/firebase/gradle/plugins/FirebaseJavaLibraryPlugin.kt index a3ba6df64a1..84bf1e9b69c 100644 --- a/buildSrc/src/main/java/com/google/firebase/gradle/plugins/FirebaseJavaLibraryPlugin.kt +++ b/buildSrc/src/main/java/com/google/firebase/gradle/plugins/FirebaseJavaLibraryPlugin.kt @@ -16,7 +16,6 @@ package com.google.firebase.gradle.plugins -import com.google.common.collect.ImmutableList import com.google.firebase.gradle.plugins.LibraryType.JAVA import com.google.firebase.gradle.plugins.semver.ApiDiffer import com.google.firebase.gradle.plugins.semver.GmavenCopier @@ -56,7 +55,7 @@ class FirebaseJavaLibraryPlugin : BaseFirebaseLibraryPlugin() { // reduce the likelihood of kotlin module files colliding. project.tasks.withType { - kotlinOptions.freeCompilerArgs = ImmutableList.of("-module-name", kotlinModuleName(project)) + kotlinOptions.freeCompilerArgs = listOf("-module-name", kotlinModuleName(project)) } } diff --git a/buildSrc/src/main/java/com/google/firebase/gradle/plugins/ci/ContinuousIntegrationPlugin.java b/buildSrc/src/main/java/com/google/firebase/gradle/plugins/ci/ContinuousIntegrationPlugin.java index 77e8662a143..4a489e531c5 100644 --- a/buildSrc/src/main/java/com/google/firebase/gradle/plugins/ci/ContinuousIntegrationPlugin.java +++ b/buildSrc/src/main/java/com/google/firebase/gradle/plugins/ci/ContinuousIntegrationPlugin.java @@ -14,7 +14,6 @@ package com.google.firebase.gradle.plugins.ci; -import com.google.common.collect.ImmutableList; import com.google.firebase.gradle.plugins.FirebaseLibraryExtension; import java.util.List; import java.util.Set; @@ -124,7 +123,7 @@ private static void setupChangedTask( } private static final List ANDROID_PLUGINS = - ImmutableList.of("com.android.application", "com.android.library", "com.android.test"); + List.of("com.android.application", "com.android.library", "com.android.test"); private static boolean isAndroidProject(Project project) { return ANDROID_PLUGINS.stream() diff --git a/buildSrc/src/main/java/com/google/firebase/gradle/plugins/ci/Coverage.java b/buildSrc/src/main/java/com/google/firebase/gradle/plugins/ci/Coverage.java index 7da0afe8bdd..a785420ab0f 100644 --- a/buildSrc/src/main/java/com/google/firebase/gradle/plugins/ci/Coverage.java +++ b/buildSrc/src/main/java/com/google/firebase/gradle/plugins/ci/Coverage.java @@ -15,10 +15,10 @@ package com.google.firebase.gradle.plugins.ci; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import com.google.firebase.gradle.plugins.FirebaseLibraryExtension; import java.io.File; import java.util.List; +import java.util.Map; import org.gradle.api.Project; import org.gradle.api.tasks.testing.Test; import org.gradle.testing.jacoco.plugins.JacocoPluginExtension; @@ -32,7 +32,7 @@ private Coverage() {} public static void apply(FirebaseLibraryExtension firebaseLibrary) { Project project = firebaseLibrary.getProject(); - project.apply(ImmutableMap.of("plugin", "jacoco")); + project.apply(Map.of("plugin", "jacoco")); File reportsDir = new File(project.getBuildDir(), "/reports/jacoco"); JacocoPluginExtension jacoco = project.getExtensions().getByType(JacocoPluginExtension.class); @@ -45,7 +45,7 @@ public static void apply(FirebaseLibraryExtension firebaseLibrary) { test -> { JacocoTaskExtension testJacoco = test.getExtensions().getByType(JacocoTaskExtension.class); - testJacoco.setExcludeClassLoaders(ImmutableList.of("jdk.internal.*")); + testJacoco.setExcludeClassLoaders(List.of("jdk.internal.*")); testJacoco.setIncludeNoLocationClasses(true); }); @@ -72,13 +72,13 @@ public static void apply(FirebaseLibraryExtension firebaseLibrary) { .setFrom( project.files( project.fileTree( - ImmutableMap.of( + Map.of( "dir", project.getBuildDir() + "/intermediates/javac/release", "excludes", excludes)), project.fileTree( - ImmutableMap.of( + Map.of( "dir", project.getBuildDir() + "/tmp/kotlin-classes/release", "excludes", @@ -88,7 +88,7 @@ public static void apply(FirebaseLibraryExtension firebaseLibrary) { task.getExecutionData() .setFrom( project.fileTree( - ImmutableMap.of( + Map.of( "dir", project.getBuildDir(), "includes", diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6daa38d361d..172b219bbaa 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,6 +11,8 @@ grpc = "1.62.2" grpcKotlin = "1.4.1" javalite = "3.25.5" kotlin = "1.8.22" +mavenResolverApi = "1.9.22" +mavenResolverProvider = "3.9.9" mockk = "1.13.11" serialization-plugin = "1.8.22" protoc = "3.25.5" @@ -61,6 +63,13 @@ kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version kotlinx-serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "serialization" } kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization" } kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" } +maven-resolver-api = { module = "org.apache.maven.resolver:maven-resolver-api", version.ref = "mavenResolverApi" } +maven-resolver-connector-basic = { module = "org.apache.maven.resolver:maven-resolver-connector-basic", version.ref = "mavenResolverApi" } +maven-resolver-impl = { module = "org.apache.maven.resolver:maven-resolver-impl", version.ref = "mavenResolverApi" } +maven-resolver-provider = { module = "org.apache.maven:maven-resolver-provider", version.ref = "mavenResolverProvider" } +maven-resolver-transport-file = { module = "org.apache.maven.resolver:maven-resolver-transport-file", version.ref = "mavenResolverApi" } +maven-resolver-transport-http = { module = "org.apache.maven.resolver:maven-resolver-transport-http", version.ref = "mavenResolverApi" } +maven-resolver-util = { module = "org.apache.maven.resolver:maven-resolver-util", version.ref = "mavenResolverApi" } okhttp = { module = "com.squareup.okhttp3:okhttp", version = "3.12.13" } org-json = { module = "org.json:json", version = "20210307" } playservices-base = { module = "com.google.android.gms:play-services-base", version = "18.1.0" } @@ -104,6 +113,15 @@ testonly-three-ten-abp = { module = "com.jakewharton.threetenabp:threetenabp", v [bundles] kotest = ["kotest-runner", "kotest-assertions", "kotest-property", "kotest-property-arbs"] playservices = ["playservices-base", "playservices-basement", "playservices-tasks"] +maven-resolver = [ + "maven-resolver-api", + "maven-resolver-connector-basic", + "maven-resolver-impl", + "maven-resolver-provider", + "maven-resolver-transport-file", + "maven-resolver-transport-http", + "maven-resolver-util" +] [plugins] kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }