From 5765cfeca453cfeb1be42ef376a5f45189095b0c Mon Sep 17 00:00:00 2001 From: jmanrique Date: Mon, 24 Nov 2025 10:14:23 +0100 Subject: [PATCH 1/2] ANDROID-17069 update agp to version 8.13.1, libs.versions.toml integration --- app/build.gradle | 21 +++++++------- build.gradle | 16 +++++------ gradle.properties | 2 ++ gradle/libs.versions.toml | 35 ++++++++++++++++++++++++ gradle/wrapper/gradle-wrapper.properties | 2 +- nestedscrollwebview/build.gradle | 18 ++++++------ 6 files changed, 66 insertions(+), 28 deletions(-) create mode 100644 gradle/libs.versions.toml diff --git a/app/build.gradle b/app/build.gradle index 509b98d..d61701f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -4,14 +4,14 @@ plugins { } android { - compileSdk 31 + compileSdk libs.versions.compileSdk.get().toInteger() defaultConfig { applicationId "com.telefonica.nestedscrollwebviewdemo" - minSdk 21 - targetSdk 31 - versionCode 1 - versionName "1.0" + minSdk libs.versions.minSdk.get().toInteger() + targetSdk libs.versions.targetSdk.get().toInteger() + versionCode libs.versions.versionCode.get().toInteger() + versionName libs.versions.versionName.get() } buildTypes { @@ -30,13 +30,14 @@ android { buildFeatures { viewBinding true } + namespace 'com.telefonica.nestedscrollwebviewdemo' } dependencies { implementation project(':nestedscrollwebview') - implementation 'androidx.core:core-ktx:1.8.0' - implementation 'androidx.appcompat:appcompat:1.4.2' - implementation 'com.google.android.material:material:1.6.1' - implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' + implementation(libs.androidx.core.ktx) + implementation(libs.material) + implementation(libs.appcompat) + implementation(libs.constraintlayout) + implementation(libs.swiperefreshlayout) } diff --git a/build.gradle b/build.gradle index 06e7458..b70b87c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,18 +1,18 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { dependencies { - classpath "com.android.tools.build:gradle:7.1.3" - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.0" - classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.30.0" + classpath libs.agp.buildscript + classpath libs.kotlin.gradle + classpath libs.nexus.staging } } plugins { - id 'com.android.application' version '7.4.2' apply false - id 'com.android.library' version '7.4.2' apply false - id 'org.jetbrains.kotlin.android' version '1.6.21' apply false - id 'io.github.gradle-nexus.publish-plugin' version '1.3.0' apply false - id 'io.gitlab.arturbosch.detekt' version '1.22.0' + alias(libs.plugins.android.application) apply false + alias(libs.plugins.android.library) apply false + alias(libs.plugins.kotlin.android) apply false + alias(libs.plugins.nexus.publish) apply false + alias(libs.plugins.detekt) } detekt { diff --git a/gradle.properties b/gradle.properties index 3c7a8bd..cccbfe6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,3 +21,5 @@ kotlin.code.style=official # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library android.nonTransitiveRClass=true +android.defaults.buildfeatures.buildconfig=true +android.nonFinalResIds=false diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..f86c30b --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,35 @@ +[versions] +compileSdk = "31" +minSdk = "21" +targetSdk = "31" +versionCode = "1" +versionName = "1.0" +agp = "8.13.1" +kotlin = "1.8.0" +kotlinAndroid = "1.6.21" +nexusStaging = "0.30.0" +nexusPublish = "1.3.0" +detekt = "1.22.0" +material = "1.6.1" +appcompat = "1.4.2" +constraintlayout = "2.1.4" +swiperefresh = "1.1.0" +junit4 = "4.13.2" + +[libraries] +agp-buildscript = { module = "com.android.tools.build:gradle", version.ref = "agp" } +kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } +nexus-staging = { module = "io.codearte.gradle.nexus:gradle-nexus-staging-plugin", version.ref = "nexusStaging" } +androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "kotlin" } +material = { module = "com.google.android.material:material", version.ref = "material" } +appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" } +constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" } +swiperefreshlayout = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version.ref = "swiperefresh" } +junit4 = { module = "junit:junit", version.ref = "junit4" } + +[plugins] +android-application = { id = "com.android.application", version.ref = "agp" } +android-library = { id = "com.android.library", version.ref = "agp" } +kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlinAndroid" } +nexus-publish = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "nexusPublish" } +detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 93771eb..4ec59c0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Wed Aug 03 11:27:29 CEST 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/nestedscrollwebview/build.gradle b/nestedscrollwebview/build.gradle index b0670f4..47c84b6 100644 --- a/nestedscrollwebview/build.gradle +++ b/nestedscrollwebview/build.gradle @@ -1,15 +1,14 @@ plugins { - id 'com.android.library' - id 'org.jetbrains.kotlin.android' + alias(libs.plugins.android.library) + alias(libs.plugins.kotlin.android) } android { - compileSdk 31 + compileSdk libs.versions.compileSdk.get().toInteger() defaultConfig { - minSdk 21 - targetSdk 31 - + minSdk libs.versions.minSdk.get().toInteger() + targetSdk libs.versions.targetSdk.get().toInteger() consumerProguardFiles "consumer-rules.pro" } @@ -26,13 +25,14 @@ android { kotlinOptions { jvmTarget = '1.8' } + namespace 'com.telefonica.nestedscrollwebview' } dependencies { - implementation 'androidx.core:core-ktx:1.8.0' - implementation 'com.google.android.material:material:1.6.1' + implementation(libs.androidx.core.ktx) + implementation(libs.material) - testImplementation 'junit:junit:4.13.2' + testImplementation(libs.junit4) } apply from: "${rootProject.projectDir}/mavencentral.gradle" From b036fcae0a2e19ecc7410fffad083be851c0a225 Mon Sep 17 00:00:00 2001 From: jmanrique Date: Tue, 25 Nov 2025 11:02:14 +0100 Subject: [PATCH 2/2] ANDROID-17069 unused directive removed --- gradle.properties | 1 - 1 file changed, 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index cccbfe6..cf0008d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,5 +21,4 @@ kotlin.code.style=official # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library android.nonTransitiveRClass=true -android.defaults.buildfeatures.buildconfig=true android.nonFinalResIds=false