From 7422f73754685ea7fe854d1584c0742d43725cd8 Mon Sep 17 00:00:00 2001 From: Julian Steenbakker Date: Mon, 31 May 2021 09:46:10 +0200 Subject: [PATCH] imp: updated gradle dependencies --- android/build.gradle | 21 +++++++------------ example/android/app/build.gradle | 4 ---- example/android/build.gradle | 10 ++++----- .../gradle/wrapper/gradle-wrapper.properties | 2 +- example/android/settings.gradle | 18 +++++++--------- 5 files changed, 20 insertions(+), 35 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 2401270c..06c00c46 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -2,14 +2,14 @@ group 'net.touchcapture.qr.flutterqr' version '1.0-SNAPSHOT' buildscript { - ext.kotlin_version = '1.4.30' + ext.kotlin_version = '1.5.10' repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:4.1.2' + classpath 'com.android.tools.build:gradle:4.2.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -17,19 +17,16 @@ buildscript { rootProject.allprojects { repositories { google() - jcenter() + mavenCentral() } } apply plugin: 'com.android.library' apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' -apply plugin: 'kotlin-kapt' android { compileSdkVersion 30 - sourceSets { main.java.srcDirs += 'src/main/kotlin' } @@ -38,17 +35,15 @@ android { minSdkVersion 20 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } - lintOptions { - disable 'InvalidPackage' + buildFeatures { + viewBinding = true } - - aaptOptions.cruncherEnabled = false - aaptOptions.useNewCruncher = false + } dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation('com.journeyapps:zxing-android-embedded:4.1.0') { transitive = false } - implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'androidx.appcompat:appcompat:1.3.0' implementation 'com.google.zxing:core:3.3.0' } diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index a2c7d068..adb99255 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -32,10 +32,6 @@ android { main.java.srcDirs += 'src/main/kotlin' } - lintOptions { - disable 'InvalidPackage' - } - defaultConfig { applicationId "net.touchcapture.qr.flutterqrexample" // minSdkVersion is determined by Native View. diff --git a/example/android/build.gradle b/example/android/build.gradle index fb1bf5d8..8d31bfab 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.4.30' + ext.kotlin_version = '1.5.10' repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:4.1.2' + classpath 'com.android.tools.build:gradle:4.2.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -14,15 +14,13 @@ buildscript { allprojects { repositories { google() - jcenter() + mavenCentral() } } rootProject.buildDir = '../build' subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { project.evaluationDependsOn(':app') } diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index 8d5215f6..681e5a56 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip diff --git a/example/android/settings.gradle b/example/android/settings.gradle index 5a2f14fb..44e62bcf 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -1,15 +1,11 @@ include ':app' -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +def properties = new Properties() -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } -} +assert localPropertiesFile.exists() +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} +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"