Skip to content

Commit 6f89183

Browse files
damirehmlauciscoderabbitai[bot]
authored
Migrate Android Gradle config to plugins { } DSL using Flutter‑recommended approach (#18)
## Summary by CodeRabbit - **Chores** - Updated and simplified Android build configuration, including SDK and language version adjustments, dependency reorganization, and removal of certain test and build options. ## Walkthrough The Gradle build script for the Android project was simplified by removing buildscript and repository declarations, adjusting SDK and Java/Kotlin versions, modifying source set and test configurations, updating the version string, and reorganizing dependencies. No changes were made to public code entities; all changes are limited to build configuration. ## Changes | File(s) | Change Summary | |--------------------------|-----------------------------------------------------------------------------------------------------------------| | android/build.gradle | Removed buildscript and allprojects blocks, adjusted SDK and language versions, updated version, reorganized dependencies, modified source sets and test configuration, added lintOptions. | --------- Co-authored-by: martins <me@martinslaucis.lv> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 674fd34 commit 6f89183

File tree

1 file changed

+23
-53
lines changed

1 file changed

+23
-53
lines changed

android/build.gradle

Lines changed: 23 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,39 @@
11
group = "io.pnta.pnta_flutter"
2-
version = "1.0-SNAPSHOT"
2+
version = "1.0.0"
33

4-
buildscript {
5-
ext.kotlin_version = "1.8.22"
6-
repositories {
7-
google()
8-
mavenCentral()
9-
}
10-
11-
dependencies {
12-
classpath("com.android.tools.build:gradle:8.2.1")
13-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
14-
classpath("com.google.gms:google-services:4.4.1")
15-
}
4+
plugins {
5+
id "com.android.library"
6+
id "org.jetbrains.kotlin.android"
167
}
17-
18-
allprojects {
19-
repositories {
20-
google()
21-
mavenCentral()
22-
}
23-
}
24-
25-
apply plugin: "com.android.library"
26-
apply plugin: "kotlin-android"
27-
288
android {
29-
namespace = "io.pnta.pnta_flutter"
30-
31-
compileSdk = 35
32-
33-
compileOptions {
34-
sourceCompatibility = JavaVersion.VERSION_11
35-
targetCompatibility = JavaVersion.VERSION_11
36-
}
37-
38-
kotlinOptions {
39-
jvmTarget = JavaVersion.VERSION_11
9+
10+
compileSdkVersion 34
11+
12+
if (project.android.hasProperty("namespace")) {
13+
namespace = "io.pnta.pnta_flutter"
4014
}
4115

4216
sourceSets {
4317
main.java.srcDirs += "src/main/kotlin"
44-
test.java.srcDirs += "src/test/kotlin"
4518
}
4619

47-
defaultConfig {
48-
minSdk = 21
20+
kotlinOptions {
21+
jvmTarget = "1.8"
4922
}
5023

51-
dependencies {
52-
testImplementation("org.jetbrains.kotlin:kotlin-test")
53-
testImplementation("org.mockito:mockito-core:5.0.0")
54-
implementation 'com.google.firebase:firebase-messaging:23.4.1'
55-
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'
24+
defaultConfig {
25+
minSdkVersion 21
26+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
5627
}
5728

58-
testOptions {
59-
unitTests.all {
60-
useJUnitPlatform()
61-
62-
testLogging {
63-
events "passed", "skipped", "failed", "standardOut", "standardError"
64-
outputs.upToDateWhen {false}
65-
showStandardStreams = true
66-
}
67-
}
29+
lintOptions {
30+
disable 'InvalidPackage'
6831
}
6932
}
33+
34+
dependencies {
35+
implementation 'com.google.firebase:firebase-messaging:23.4.1'
36+
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'
37+
testImplementation 'org.jetbrains.kotlin:kotlin-test'
38+
testImplementation 'org.mockito:mockito-core:5.0.0'
39+
}

0 commit comments

Comments
 (0)