From 74b7180b21222eb55dfc14745729850fa8e3fb56 Mon Sep 17 00:00:00 2001 From: Rachel Murabula <110402503+Raynafs@users.noreply.github.com> Date: Mon, 8 Jan 2024 21:34:03 +0300 Subject: [PATCH] Migrate plugins to version catalog (#2938) * Migrate from groovy to kotlin dsl * Migrate a few plugins to version catalog * Migrate a few plugins to version catalog * Fix CI * Fix spotless * Fix spotless * Fix spotless * Fix spotless --- android/build.gradle.kts | 26 +++++++++++--------------- android/gradle/libs.versions.toml | 16 ++++++++++++++++ android/settings.gradle.kts | 7 +++++++ 3 files changed, 34 insertions(+), 15 deletions(-) diff --git a/android/build.gradle.kts b/android/build.gradle.kts index 7ba580e5e2..12f6f49436 100644 --- a/android/build.gradle.kts +++ b/android/build.gradle.kts @@ -2,31 +2,27 @@ import com.diffplug.gradle.spotless.SpotlessExtension import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.DokkaBaseConfiguration + // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - repositories { - google() - maven(url = "https://plugins.gradle.org/m2/") - maven(url = "https://oss.sonatype.org/content/repositories/snapshots/") - } - dependencies { - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10") - classpath("org.jetbrains.kotlin:kotlin-serialization:1.8.10") - classpath("com.google.dagger:hilt-android-gradle-plugin:2.45") - classpath("androidx.navigation:navigation-safe-args-gradle-plugin:2.5.3") - classpath("com.diffplug.spotless:spotless-plugin-gradle:6.19.0") - classpath("gradle.plugin.org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.12.0") classpath("de.mannodermaus.gradle.plugins:android-junit5:1.8.2.1") classpath("com.android.tools.build:gradle:7.1.3") classpath("org.jetbrains.dokka:dokka-base:1.8.20") - classpath("org.owasp:dependency-check-gradle:8.2.1") } } +@Suppress("DSL_SCOPE_VIOLATION") plugins { - id("org.jetbrains.dokka") version "1.8.20" - id("org.owasp.dependencycheck") version "8.2.1" + id("com.github.kt3k.coveralls") version "2.12.0" + id("org.jetbrains.kotlin.jvm") version "1.8.10" + alias(libs.plugins.kotlin.serialization) + alias(libs.plugins.dagger.hilt.android) apply false + alias(libs.plugins.androidx.navigation.safeargs) apply false + alias(libs.plugins.org.jetbrains.dokka) + alias(libs.plugins.org.owasp.dependencycheck) + alias(libs.plugins.com.diffplug.spotless) + } tasks.dokkaHtmlMultiModule { diff --git a/android/gradle/libs.versions.toml b/android/gradle/libs.versions.toml index 36ea8d101b..83f5158ca3 100644 --- a/android/gradle/libs.versions.toml +++ b/android/gradle/libs.versions.toml @@ -102,6 +102,16 @@ work-testing = "2.8.1" workflow = "0.1.0-alpha02-preview9.1-SNAPSHOT" xercesImpl = "2.12.2" org-jetbrains-kotlin-android = "1.8.10" +jetbrains = "1.8.20" +owasp = "8.2.1" +kt3k-coveralls = "2.12.0" +kotlin-jvm = "1.8.10" +kotlin-serialization = "1.8.10" +dagger-hilt = "2.45" +jetbrains-dokka = "1.8.20" +navigation-safeargs = "2.4.2" +diffplug-spotless = "6.19.0" + [libraries] accompanist-flowlayout = { group = "com.google.accompanist", name = "accompanist-flowlayout", version.ref = "accompanist-flowlayout" } @@ -215,3 +225,9 @@ xercesImpl = { group = "xerces", name = "xercesImpl", version.ref = "xercesImpl" [plugins] org-jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "org-jetbrains-kotlin-android" } +org-jetbrains-dokka = { id = "org.jetbrains.dokka", version.ref = "jetbrains" } +kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin-serialization" } +org-owasp-dependencycheck = { id = "org.owasp.dependencycheck", version.ref = "owasp" } +dagger-hilt-android= { id = "com.google.dagger.hilt.android", version.ref = "dagger-hilt" } +com-diffplug-spotless = { id = "com.diffplug.spotless", version.ref = "diffplug-spotless" } +androidx-navigation-safeargs = { id = "androidx.navigation.safeargs.kotlin", version.ref = "navigation-safeargs" } diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts index 18c6cc1af4..cbfe381ff7 100644 --- a/android/settings.gradle.kts +++ b/android/settings.gradle.kts @@ -1,3 +1,10 @@ +pluginManagement { + repositories { + google() + maven(url = "https://plugins.gradle.org/m2/") + maven(url = "https://oss.sonatype.org/content/repositories/snapshots/") + } +} rootProject.name = "fhircore-android" include (":engine") include (":quest")