upgrade: migrate to SDK 34 and upgrade APG

Additionally, add Jetpack Compose to the project
This commit is contained in:
Rohit Verma 2024-08-24 20:40:49 +05:30
parent c0a28d01e3
commit 1c9609eb3d
3 changed files with 27 additions and 6 deletions

View file

@ -51,6 +51,22 @@ dependencies {
implementation 'com.karumi:dexter:5.0.0' implementation 'com.karumi:dexter:5.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
// Jetpack Compose
def composeBom = platform('androidx.compose:compose-bom:2024.08.00')
implementation "androidx.appcompat:appcompat:1.7.0"
implementation "androidx.activity:activity-compose:1.9.1"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.8.4"
implementation (composeBom)
implementation "androidx.compose.runtime:runtime"
implementation "androidx.compose.ui:ui"
implementation "androidx.compose.ui:ui-graphics"
implementation "androidx.compose.ui:ui-tooling"
implementation "androidx.compose.foundation:foundation"
implementation "androidx.compose.foundation:foundation-layout"
implementation "androidx.compose.material3:material3"
androidTestImplementation(composeBom)
implementation "com.hannesdorfmann:adapterdelegates4-kotlin-dsl-viewbinding:$ADAPTER_DELEGATES_VERSION" implementation "com.hannesdorfmann:adapterdelegates4-kotlin-dsl-viewbinding:$ADAPTER_DELEGATES_VERSION"
implementation "com.hannesdorfmann:adapterdelegates4-pagination:$ADAPTER_DELEGATES_VERSION" implementation "com.hannesdorfmann:adapterdelegates4-pagination:$ADAPTER_DELEGATES_VERSION"
implementation "androidx.paging:paging-runtime-ktx:$PAGING_VERSION" implementation "androidx.paging:paging-runtime-ktx:$PAGING_VERSION"
@ -186,7 +202,7 @@ project.gradle.taskGraph.whenReady {
} }
android { android {
compileSdkVersion 33 compileSdkVersion 34
defaultConfig { defaultConfig {
//applicationId 'fr.free.nrw.commons' //applicationId 'fr.free.nrw.commons'
@ -196,7 +212,7 @@ android {
setProperty("archivesBaseName", "app-commons-v$versionName-" + getBranchName()) setProperty("archivesBaseName", "app-commons-v$versionName-" + getBranchName())
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 33 targetSdkVersion 34
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments clearPackageData: 'true' testInstrumentationRunnerArguments clearPackageData: 'true'
@ -253,11 +269,12 @@ android {
} }
} }
debug { debug {
testCoverageEnabled true
minifyEnabled false minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
testProguardFile 'test-proguard-rules.txt' testProguardFile 'test-proguard-rules.txt'
versionNameSuffix "-debug-" + getBranchName() versionNameSuffix "-debug-" + getBranchName()
enableUnitTestCoverage true
enableAndroidTestCoverage true
} }
} }
@ -354,13 +371,17 @@ android {
targetCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_11
} }
kotlinOptions { kotlinOptions {
jvmTarget = "1.8" jvmTarget = "11"
} }
buildToolsVersion buildToolsVersion buildToolsVersion buildToolsVersion
buildFeatures { buildFeatures {
viewBinding true viewBinding true
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.3.2'
} }
namespace 'fr.free.nrw.commons' namespace 'fr.free.nrw.commons'
lint { lint {

View file

@ -6,7 +6,7 @@ buildscript {
maven { url "https://plugins.gradle.org/m2/" } maven { url "https://plugins.gradle.org/m2/" }
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:8.0.2' classpath 'com.android.tools.build:gradle:8.5.0'
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.8.2' classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.8.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION"
classpath 'org.codehaus.groovy:groovy-all:2.4.15' classpath 'org.codehaus.groovy:groovy-all:2.4.15'

View file

@ -1,6 +1,6 @@
#Sun Apr 23 18:22:54 IST 2023 #Sun Apr 23 18:22:54 IST 2023
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists