Skip to content

Commit 4bd2a94

Browse files
Merge pull request juliansteenbakker#1566 from juliansteenbakker/fix/groovy-syntax
fix: groovy syntax
2 parents 5157923 + 64e3c0e commit 4bd2a94

File tree

2 files changed

+33
-33
lines changed

2 files changed

+33
-33
lines changed

android/build.gradle

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ group = 'dev.steenbakker.mobile_scanner'
22
version = '1.0-SNAPSHOT'
33

44
buildscript {
5-
ext.kotlin_version = '1.8.0'
5+
ext.kotlin_version = "2.1.0"
66
repositories {
77
google()
88
mavenCentral()
@@ -29,15 +29,15 @@ android {
2929
namespace = 'dev.steenbakker.mobile_scanner'
3030
}
3131

32-
compileSdk 36
32+
compileSdk = 36
3333

3434
compileOptions {
35-
sourceCompatibility JavaVersion.VERSION_17
36-
targetCompatibility JavaVersion.VERSION_17
35+
sourceCompatibility = JavaVersion.VERSION_17
36+
targetCompatibility = JavaVersion.VERSION_17
3737
}
3838

3939
kotlinOptions {
40-
jvmTarget = '17'
40+
jvmTarget = JavaVersion.VERSION_17.toString()
4141
}
4242

4343
sourceSets {
@@ -46,10 +46,28 @@ android {
4646
}
4747

4848
defaultConfig {
49-
minSdk 23
49+
minSdk = 23
5050
consumerProguardFiles 'proguard-rules.pro'
5151
}
5252

53+
dependencies {
54+
def useUnbundled = project.findProperty('dev.steenbakker.mobile_scanner.useUnbundled') ?: false
55+
if (useUnbundled.toBoolean()) {
56+
// Dynamically downloaded model via Google Play Services
57+
implementation 'com.google.android.gms:play-services-mlkit-barcode-scanning:18.3.1'
58+
} else {
59+
// Bundled model in app
60+
implementation 'com.google.mlkit:barcode-scanning:17.3.0'
61+
}
62+
63+
implementation 'androidx.camera:camera-lifecycle:1.5.1'
64+
implementation 'androidx.camera:camera-camera2:1.5.1'
65+
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2'
66+
67+
testImplementation 'org.jetbrains.kotlin:kotlin-test'
68+
testImplementation 'org.mockito:mockito-core:5.20.0'
69+
}
70+
5371
testOptions {
5472
unitTests.all {
5573
useJUnitPlatform()
@@ -61,22 +79,4 @@ android {
6179
}
6280
}
6381
}
64-
}
65-
66-
dependencies {
67-
def useUnbundled = project.findProperty('dev.steenbakker.mobile_scanner.useUnbundled') ?: false
68-
if (useUnbundled.toBoolean()) {
69-
// Dynamically downloaded model via Google Play Services
70-
implementation 'com.google.android.gms:play-services-mlkit-barcode-scanning:18.3.1'
71-
} else {
72-
// Bundled model in app
73-
implementation 'com.google.mlkit:barcode-scanning:17.3.0'
74-
}
75-
76-
implementation 'androidx.camera:camera-lifecycle:1.5.1'
77-
implementation 'androidx.camera:camera-camera2:1.5.1'
78-
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2'
79-
80-
testImplementation 'org.jetbrains.kotlin:kotlin-test'
81-
testImplementation 'org.mockito:mockito-core:5.19.0'
82-
}
82+
}

example/android/app/build.gradle

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ if (flutterVersionName == null) {
2424

2525
android {
2626
namespace = "dev.steenbakker.mobile_scanner_example"
27-
compileSdk 36
27+
compileSdk = 36
2828

2929
compileOptions {
30-
sourceCompatibility JavaVersion.VERSION_17
31-
targetCompatibility JavaVersion.VERSION_17
30+
sourceCompatibility = JavaVersion.VERSION_17
31+
targetCompatibility = JavaVersion.VERSION_17
3232
}
3333

3434
kotlinOptions {
35-
jvmTarget = '17'
35+
jvmTarget = JavaVersion.VERSION_17.toString()
3636
}
3737

3838
sourceSets {
@@ -42,11 +42,11 @@ android {
4242
defaultConfig {
4343
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4444
applicationId "dev.steenbakker.mobile_scanner_example"
45-
minSdkVersion 24
46-
targetSdkVersion 36
45+
minSdkVersion = 24
46+
targetSdkVersion = 36
4747
ndkVersion = flutter.ndkVersion
48-
versionCode flutterVersionCode.toInteger()
49-
versionName flutterVersionName
48+
versionCode = flutterVersionCode.toInteger()
49+
versionName = flutterVersionName
5050
}
5151

5252
buildTypes {

0 commit comments

Comments
 (0)