From 22feec66b00ff21aded7e878b42cac9d9c10b446 Mon Sep 17 00:00:00 2001 From: Niko Diamadis Date: Wed, 6 Mar 2024 22:41:29 +0100 Subject: [PATCH] Fix gradle deprecations --- app/build.gradle | 1 + build.gradle | 32 +++++--------------------------- client/build.gradle | 11 ----------- gradle.properties | 1 - settings.gradle | 15 +++++++++++++++ 5 files changed, 21 insertions(+), 39 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index bbc090d7..2879625d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -31,6 +31,7 @@ android { } buildFeatures { viewBinding true + buildConfig true } compileOptions { sourceCompatibility JavaVersion.VERSION_17 diff --git a/build.gradle b/build.gradle index 530a4b21..4bb190c2 100644 --- a/build.gradle +++ b/build.gradle @@ -1,38 +1,16 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - - repositories { - google() - } - dependencies { - classpath 'com.android.tools.build:gradle:8.1.3' - classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10' - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - plugins { + id 'com.android.application' version '8.1.3' apply false + id 'org.jetbrains.kotlin.android' version '1.9.10' apply false id 'org.hidetake.swagger.generator' version '2.14.0' } ext { gotifyVersion = 'master' - specLocation = "$buildDir/gotify.spec.json" -} - -allprojects { - repositories { - google() - mavenCentral() - maven { url "https://jitpack.io/" } - } + specLocation = "$layout.buildDirectory/gotify.spec.json" } tasks.register('clean', Delete) { - delete rootProject.buildDir + delete rootProject.layout.buildDirectory } static def download(String url, String filename ) { @@ -49,7 +27,7 @@ static def download(String url, String filename ) { tasks.register('downloadSpec') { inputs.property 'version', gotifyVersion doFirst { - buildDir.mkdirs() + layout.buildDirectory.mkdirs() download("https://raw.githubusercontent.com/gotify/server/${gotifyVersion}/docs/spec.json", specLocation) } } diff --git a/client/build.gradle b/client/build.gradle index a7aebf00..939a9258 100644 --- a/client/build.gradle +++ b/client/build.gradle @@ -4,17 +4,6 @@ apply plugin: 'eclipse' group = 'io.swagger' version = '1.0.0' -buildscript { - repositories { - google() - } -} - -repositories { - jcenter() -} - - apply plugin: 'java-library' sourceCompatibility = JavaVersion.VERSION_1_7 diff --git a/gradle.properties b/gradle.properties index 65539cbd..8cb3e5a9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,6 @@ # http://www.gradle.org/docs/current/userguide/build_environment.html # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. -android.defaults.buildfeatures.buildconfig=true android.enableJetifier=true android.nonFinalResIds=true android.nonTransitiveRClass=true diff --git a/settings.gradle b/settings.gradle index d1ef5e37..7c42c199 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1,17 @@ +pluginManagement { + repositories { + gradlePluginPortal() + google() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + maven { url "https://jitpack.io/" } + } +} +rootProject.name = "Gotify Android" include ':app' include ':client' \ No newline at end of file