From 9fa4ea141b506c3fa301477d66f7024786f4b4a3 Mon Sep 17 00:00:00 2001 From: Bharath Vishal G Date: Sat, 29 Jun 2024 12:30:49 +0530 Subject: [PATCH] Dev commit - Upgraded gradle plugin to 8.5.0. - Migrated build configuration files from Groovy to Kotlin. - Migrated build to version catalogs (libs.versions.toml). - Updated all internal dependencies. --- .idea/deploymentTargetSelector.xml | 10 + .idea/kotlinc.xml | 2 +- .idea/other.xml | 263 +++++++++++++++++++++++ app/build.gradle | 78 ------- app/build.gradle.kts | 88 ++++++++ app/proguard-rules.pro | 2 +- build.gradle | 28 --- build.gradle.kts | 6 + gradle/libs.versions.toml | 52 +++++ gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle | 1 - settings.gradle.kts | 23 ++ 12 files changed, 445 insertions(+), 110 deletions(-) create mode 100644 .idea/deploymentTargetSelector.xml create mode 100644 .idea/other.xml delete mode 100644 app/build.gradle create mode 100644 app/build.gradle.kts delete mode 100644 build.gradle create mode 100644 build.gradle.kts create mode 100644 gradle/libs.versions.toml delete mode 100644 settings.gradle create mode 100644 settings.gradle.kts diff --git a/.idea/deploymentTargetSelector.xml b/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..b268ef3 --- /dev/null +++ b/.idea/deploymentTargetSelector.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml index fe63bb6..6d0ee1c 100644 --- a/.idea/kotlinc.xml +++ b/.idea/kotlinc.xml @@ -1,6 +1,6 @@ - \ No newline at end of file diff --git a/.idea/other.xml b/.idea/other.xml new file mode 100644 index 0000000..0d3a1fb --- /dev/null +++ b/.idea/other.xml @@ -0,0 +1,263 @@ + + + + + + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100644 index 8adbfe8..0000000 --- a/app/build.gradle +++ /dev/null @@ -1,78 +0,0 @@ -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' - -android { - compileSdk 34 - defaultConfig { - applicationId "com.bharathvishal.appmanager" - vectorDrawables.useSupportLibrary = true - minSdkVersion 23 - targetSdkVersion 34 - versionCode 95 - versionName "3.9" - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - buildFeatures { - viewBinding true - compose true - } - buildTypes { - debug { - debuggable true - minifyEnabled true - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - release { - debuggable false - minifyEnabled true - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 - } - - kotlinOptions { - jvmTarget = "17" - } - composeOptions { - kotlinCompilerExtensionVersion "1.5.11" - } - packagingOptions { - jniLibs { - excludes += ['/META-INF/{AL2.0,LGPL2.1}'] - } - resources { - excludes += ['/META-INF/{AL2.0,LGPL2.1}'] - } - } - namespace 'com.bharathvishal.appmanager' -} - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.6.1' - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - implementation 'com.google.android.material:material:1.11.0' - implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - testImplementation 'junit:junit:4.13.2' - implementation 'com.github.bumptech.glide:glide:4.16.0' - annotationProcessor 'com.github.bumptech.glide:compiler:4.16.0' - implementation 'androidx.cardview:cardview:1.0.0' - androidTestImplementation 'androidx.test:runner:1.5.2' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' - - implementation 'androidx.compose.material3:material3:1.2.1' - implementation "androidx.compose.material3:material3-window-size-class:1.2.1" - implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.7.0' - implementation 'androidx.activity:activity-compose:1.8.2' - androidTestImplementation "androidx.compose.ui:ui-test-junit4:1.6.5" - implementation 'androidx.core:core-splashscreen:1.0.1' - debugImplementation 'androidx.compose.ui:ui-tooling:1.6.5' - implementation 'androidx.compose.material:material-icons-extended:1.6.5' - implementation "androidx.compose.ui:ui-tooling-preview:1.6.5" - implementation "com.google.accompanist:accompanist-systemuicontroller:0.28.0" - implementation("io.coil-kt:coil-compose:2.2.2") -} diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 0000000..7718db8 --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,88 @@ +plugins { + alias(libs.plugins.android.application) + alias(libs.plugins.jetbrains.kotlin.android) + alias(libs.plugins.compose.compiler) +} + +android { + namespace = "com.bharathvishal.appmanager" + compileSdk = 34 + defaultConfig { + applicationId = "com.bharathvishal.appmanager" + vectorDrawables { + useSupportLibrary = true + } + minSdk = 23 + targetSdk = 34 + versionCode = 98 + versionName = "4.0" + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + buildFeatures { + viewBinding = true + compose = true + } + buildTypes { + debug { + isDebuggable = true + isMinifyEnabled = true + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + release { + isDebuggable = false + isMinifyEnabled = true + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = "17" + } + composeOptions { + kotlinCompilerExtensionVersion = "1.5.14" + } + + packaging { + jniLibs { + excludes += "/META-INF/{AL2.0,LGPL2.1}" + } + resources { + excludes += "/META-INF/{AL2.0,LGPL2.1}" + } + } +} + +dependencies { + implementation(libs.androidx.appcompat) + implementation(libs.jetbrains.kotlinx.couroutine) + implementation(libs.coil.kt) + implementation(libs.jetbrains.kotlin.stdlib) + implementation(libs.google.android.material) + implementation(libs.androidx.constraintlayout) + testImplementation(libs.junit) + implementation(libs.glide) + annotationProcessor(libs.glide.compiler) + androidTestImplementation(libs.androidx.espresso.core) + implementation(libs.androidx.cardview) + implementation(libs.androidx.compose.material3) + implementation(libs.androidx.compose.material3.windowsize) + implementation(libs.androidx.compose.material3.windowsize) + implementation(libs.androidx.lifecycle.runtime.ktx) + implementation(libs.androidx.activity.compose) + androidTestImplementation(libs.androidx.ui.test.junit4) + debugImplementation(libs.androidx.compose.ui.tooling) + implementation(libs.androidx.compose.ui.tooling.preview) + implementation(libs.androidx.core.core.splashscreen) + implementation(libs.androidx.compose.material.material.icons) + implementation(libs.google.accompanist.accompanist) +} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index ff3bedb..fd604e1 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -1,6 +1,6 @@ # Add project specific ProGuard rules here. # You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. +# proguardFiles setting in build.gradle.kts. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html diff --git a/build.gradle b/build.gradle deleted file mode 100644 index cbe21ca..0000000 --- a/build.gradle +++ /dev/null @@ -1,28 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - ext.kotlin_version = '1.9.23' - repositories { - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:8.3.1' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - google() - mavenCentral() - maven { url 'https://jitpack.io' } - } -} - -tasks.register('clean', Delete) { - delete rootProject.buildDir -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..f41eb6b --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,6 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + alias(libs.plugins.android.application) apply false + alias(libs.plugins.jetbrains.kotlin.android) apply false + alias(libs.plugins.compose.compiler) apply false +} \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..2786e11 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,52 @@ +[versions] +agp = "8.5.0" +appCompatVer="1.7.0" +kotlinxCoroutinesVer="1.7.3" +coilVer="2.6.0" +kotlinVer = "2.0.0" +materialVer = "1.12.0" +constraintlayoutVer="2.1.4" +coreKtxVer = "1.13.1" +glideVer="4.16.0" +cardViewVer="1.0.0" +compose3MaterialVer="1.2.1" +lifecycleRuntimeKtxVer="2.8.2" +activityComposeVer="1.9.0" +composeUItestVer="1.6.8" +uitoolingVer="1.6.8" +uitoolingpreviewVer="1.6.8" +splashScreenVer="1.0.1" +junitVersion = "4.13.2" +materialiconsVer="1.6.8" +espressoCoreVer = "3.6.1" +accompanistVer = "0.28.0" + + +[libraries] +androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appCompatVer" } +jetbrains-kotlinx-couroutine = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-android", version.ref = "kotlinxCoroutinesVer" } +coil-kt = { group = "io.coil-kt", name = "coil-compose", version.ref = "coilVer" } +jetbrains-kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlinVer" } +google-android-material = { group = "com.google.android.material", name = "material", version.ref = "materialVer" } +androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayoutVer" } +androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtxVer" } +junit = { group = "junit", name = "junit", version.ref = "junitVersion" } +glide = { group = "com.github.bumptech.glide", name = "glide", version.ref = "glideVer" } +glide-compiler = { group = "com.github.bumptech.glide", name = "compiler", version.ref = "glideVer" } +androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCoreVer" } +androidx-cardview = { group = "androidx.cardview", name = "cardview", version.ref = "cardViewVer" } +androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "compose3MaterialVer" } +androidx-compose-material3-windowsize= { group = "androidx.compose.material3", name = "material3-window-size-class", version.ref = "compose3MaterialVer" } +androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtxVer" } +androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityComposeVer" } +androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4",version.ref="composeUItestVer" } +androidx-compose-ui-tooling = { group = "androidx.compose.ui", name="ui-tooling",version.ref = "uitoolingVer" } +androidx-compose-ui-tooling-preview = { group = "androidx.compose.ui", name="ui-tooling-preview",version.ref = "uitoolingpreviewVer" } +androidx-core-core-splashscreen= { group = "androidx.core", name = "core-splashscreen",version.ref="splashScreenVer" } +androidx-compose-material-material-icons = { group = "androidx.compose.material", name = "material-icons-extended", version.ref = "materialiconsVer" } +google-accompanist-accompanist = { group = "com.google.accompanist", name = "accompanist-systemuicontroller", version.ref = "accompanistVer" } + +[plugins] +android-application = { id = "com.android.application", version.ref = "agp" } +jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlinVer" } +compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlinVer" } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 275ac0c..0d2eb75 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Sat Feb 05 13:24:30 IST 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index e7b4def..0000000 --- a/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -include ':app' diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..baa6fb6 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,23 @@ +pluginManagement { + repositories { + google { + content { + includeGroupByRegex("com\\.android.*") + includeGroupByRegex("com\\.google.*") + includeGroupByRegex("androidx.*") + } + } + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} + +rootProject.name = "App-Manager-for-Android" +include(":app")