diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 9444bf962..3ad57f39a 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -25,10 +25,10 @@ import com.google.gms.googleservices.GoogleServicesPlugin import java.io.FileInputStream plugins { - id("com.android.application") + id(libs.plugins.android.build.tool.get().pluginId) id("be.ugent.zeus.hydra.licenses") - id("com.google.gms.google-services") - id("com.google.firebase.crashlytics") + alias(libs.plugins.gms) + alias(libs.plugins.firebase.crashlytics.gradle) } // Read our properties, see bottom for details. diff --git a/build.gradle b/build.gradle.kts similarity index 65% rename from build.gradle rename to build.gradle.kts index c80dd284b..889be1796 100644 --- a/build.gradle +++ b/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2022 The Hydra authors + * Copyright (c) 2015-2024 The Hydra authors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -19,36 +19,14 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -buildscript { - repositories { - // For Google-related dependencies - google() - // For the license plugin - mavenCentral() - } - dependencies { - classpath libs.android.build.tool - classpath libs.gms - classpath libs.firebase.crashlytics.gradle - } -} - -allprojects { - repositories { - // Google libraries - google() - // Other libraries - mavenCentral() - // Some custom libraries - maven { url 'https://jitpack.io' } - } -} -tasks.register('clean', Delete) { - delete rootProject.layout.buildDirectory +plugins { + id(libs.plugins.android.build.tool.get().pluginId) apply false + alias(libs.plugins.gms) apply false + alias(libs.plugins.firebase.crashlytics.gradle) apply false } // We want sources to improve IDE features inside our Gradle files. -wrapper { +tasks.wrapper { distributionType = Wrapper.DistributionType.ALL } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 83d105fd4..cc782db89 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,9 +5,10 @@ livedata = '2.8.6' okhttp3 = '4.12.0' recordbuilder = '42' room = '2.6.1' +buildtool = '8.5.2' [libraries] -android-build-tool = { module = 'com.android.tools.build:gradle', version = '8.5.2' } +android-build-tool = { module = 'com.android.tools.build:gradle', version.ref = 'buildtool' } androidx-appcompat = { module = 'androidx.appcompat:appcompat', version = '1.7.0' } androidx-browser = { module = 'androidx.browser:browser', version = '1.8.0' } androidx-cardview = { module = 'androidx.cardview:cardview', version = '1.0.0' } @@ -40,8 +41,6 @@ easyrandom = { module = 'com.github.niknetniko:easy-random', version = 'master-S equalsverifier = { module = 'nl.jqno.equalsverifier:equalsverifier', version = '3.17' } firebase-analytics = { module = 'com.google.firebase:firebase-analytics', version = '22.1.0' } firebase-crashlytics = { module = 'com.google.firebase:firebase-crashlytics', version = '19.2.0' } -firebase-crashlytics-gradle = { module = 'com.google.firebase:firebase-crashlytics-gradle', version = '3.0.2' } -gms = { module = 'com.google.gms:google-services', version = '4.4.2' } guava = { module = 'com.google.guava:guava', version = '33.3.1-jre' } insetter = { module = 'dev.chrisbanes.insetter:insetter', version = '0.6.1' } ipcam = { module = 'com.github.niqdev:ipcam-view', version = '2.4.1' } @@ -68,5 +67,11 @@ rxjava-rules = { module = 'com.artemzin.rxjava:proguard-rules', version = '1.3.3 shazamcrest = { module = 'com.shazam:shazamcrest', version = '0.11' } zxing = { module = 'com.journeyapps:zxing-android-embedded', version = '4.3.0' } +[plugins] +android-build-tool = { id = 'com.android.application', version.ref = 'buildtool' } +android-build-library = { id = 'com.android.library', version.ref = 'buildtool' } +gms = 'com.google.gms.google-services:4.4.2' +firebase-crashlytics-gradle = 'com.google.firebase.crashlytics:3.0.2' + [bundles] androidx-lifecycle = ['androidx-lifecycle-vm', 'androidx-lifecycle-data', 'androidx-lifecycle-java'] diff --git a/material-intro/build.gradle.kts b/material-intro/build.gradle.kts index e183b7a51..ee67915f8 100644 --- a/material-intro/build.gradle.kts +++ b/material-intro/build.gradle.kts @@ -24,7 +24,7 @@ import java.io.FileInputStream import java.util.* plugins { - id("com.android.library") + id(libs.plugins.android.build.library.get().pluginId) } val versions = loadAndroidVersions() diff --git a/settings.gradle.kts b/settings.gradle.kts index 1abfef35c..54fda11ca 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -20,5 +20,22 @@ * SOFTWARE. */ +pluginManagement { + repositories { + gradlePluginPortal() + google() + mavenCentral() + } +} + +dependencyResolutionManagement { + @Suppress("UnstableApiUsage") + repositories { + google() + mavenCentral() + maven { url = uri("https://jitpack.io") } + } +} + include(":app") include(":material-intro") \ No newline at end of file