feat: Upgrade build.grandle #7
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
MisterJimson#166
Summary
This PR updates the build.gradle file to improve compatibility with the latest Android Gradle Plugin (AGP) and Kotlin version, while also enhancing the project’s structure and testing capabilities.
Changes
Updated Plugin and Library Versions:
Gradle Plugin: Upgraded from 7.4.2 to 8.1.0.
Kotlin Version: Added a new Kotlin dependency with ext.kotlin_version = "1.8.22".
Project Group and Version:
Converted group and version syntax from Groovy-style to Kotlin-style (= syntax).
Repositories:
Added mavenCentral() alongside google() in both buildscript and allprojects for broader dependency resolution.
Android Configuration:
Namespace Definition: Modified the namespace configuration to use the Kotlin-style assignment (=) syntax for AGP compatibility.
SDK Versions:
Increased compileSdk from 31 to 34.
Raised minSdk from 16 to 21 for improved compatibility with newer libraries.
Source Sets Configuration:
Updated sourceSets to include Kotlin-specific directories:
main.java.srcDirs += "src/main/kotlin"
test.java.srcDirs += "src/test/kotlin"
Code Quality and Compatibility:
Added kotlinOptions with jvmTarget = JavaVersion.VERSION_1_8 for consistency with compileOptions.
Impact
Improves compatibility with newer versions of Android and Kotlin.
Facilitates better test management with JUnitPlatform and standard logging configurations.
Aligns project structure with modern Android development practices by adding Kotlin support and increasing minimum SDK version.