From f9124bc9efa5f59a4eb5d830a02ea6a04866a1c8 Mon Sep 17 00:00:00 2001 From: Robin Farmer Date: Mon, 23 Sep 2024 09:50:13 +0200 Subject: [PATCH 1/2] bump android scanner sdk version. --- .gitignore | 3 ++- CHANGELOG.md | 5 +++++ android/build.gradle | 2 +- example/android/app/build.gradle | 19 ++++++------------- example/android/build.gradle | 13 ------------- example/android/settings.gradle | 30 ++++++++++++++++++++++-------- pubspec.yaml | 2 +- 7 files changed, 37 insertions(+), 37 deletions(-) diff --git a/.gitignore b/.gitignore index 9e2922e..6a26ecc 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,5 @@ build/ pubspec.lock podfile.lock -local.properties \ No newline at end of file +local.properties +.vscode \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a83760..95c914a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.3.3 + +* Bump Android to 3.1.10 +* Now use Gradle declarative plugin in Android Example. + ## 0.3.2 * Bump Android to 3.1.8 diff --git a/android/build.gradle b/android/build.gradle index bf471a3..1cd6495 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -67,7 +67,7 @@ android { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - def fallbackKlippaScannerVersion = "3.1.8" + def fallbackKlippaScannerVersion = "3.1.10" def klippaScannerVersion = project.hasProperty('klippaScannerVersion') ? project.klippaScannerVersion : fallbackKlippaScannerVersion implementation "com.klippa:scanner:$klippaScannerVersion" implementation 'com.google.android.material:material:1.6.1' diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index c43fc9d..f6d1ebd 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) { } } -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' @@ -21,10 +22,6 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { compileSdk 34 @@ -65,7 +62,3 @@ android { flutter { source '../..' } - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" -} diff --git a/example/android/build.gradle b/example/android/build.gradle index b387281..18437ee 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,16 +1,3 @@ -buildscript { - ext.kotlin_version = '1.8.0' - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:7.0.2' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - allprojects { repositories { google() diff --git a/example/android/settings.gradle b/example/android/settings.gradle index 44e62bc..7eef9f7 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -1,11 +1,25 @@ -include ':app' +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "7.0.2" apply false + id "org.jetbrains.kotlin.android" version "1.8.0" apply false +} + +include ":app" \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index 8fc2dab..842df19 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: klippa_scanner_sdk description: Allows you to do document scanning with the Klippa Scanner SDK from Flutter apps. -version: 0.3.2 +version: 0.3.3 homepage: https://github.com/klippa-app/flutter-klippa-scanner-sdk environment: From d7cf88929591912ac1dbe4fd4ae630e0f4c96023 Mon Sep 17 00:00:00 2001 From: Robin Farmer Date: Mon, 23 Sep 2024 09:53:54 +0200 Subject: [PATCH 2/2] bump flutter version build.yml --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 44b09dd..c7dcd16 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: java-version: '12.x' - uses: subosito/flutter-action@v2 with: - flutter-version: '3.10.0' + flutter-version: '3.24.3' - run: dart --version - run: flutter --version - run: flutter pub get @@ -49,7 +49,7 @@ jobs: java-version: '12.x' - uses: subosito/flutter-action@v2 with: - flutter-version: '3.10.0' + flutter-version: '3.24.3' - run: dart --version - run: flutter --version - run: flutter pub get