From dcfdc5a0c4f743e02ced7805c741bd863fa10ab4 Mon Sep 17 00:00:00 2001 From: dustin Date: Thu, 9 Aug 2018 14:21:26 -0700 Subject: [PATCH] update android gradle configuration and declare activity in library If you declare the activity in the library, the hosting application's manifest will get merged with the library manifest and then the end user doesn't have to edit their manifest before this plugin works. also updated to latest gradle plugin and kotlin versions --- android/build.gradle | 10 +++++----- android/src/main/AndroidManifest.xml | 4 ++++ example/android/app/build.gradle | 8 ++++---- example/android/app/src/main/AndroidManifest.xml | 1 - example/android/build.gradle | 14 ++++++++------ .../gradle/wrapper/gradle-wrapper.properties | 2 +- example/ios/Flutter/Debug.xcconfig | 1 + example/ios/Flutter/Release.xcconfig | 1 + 8 files changed, 24 insertions(+), 17 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 97ae115..33939fe 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -10,8 +10,8 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:2.3.3' - classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.2-4' + classpath 'com.android.tools.build:gradle:3.1.4' + classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.51' } } @@ -28,7 +28,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - compileSdkVersion 27 + compileSdkVersion 28 buildToolsVersion '27.0.3' sourceSets { @@ -36,7 +36,7 @@ android { } defaultConfig { minSdkVersion 16 - targetSdkVersion 25 + targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" @@ -47,7 +47,7 @@ android { } dependencies { - implementation 'org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.2-4' + implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.51' implementation 'me.dm7.barcodescanner:zxing:1.9.8' implementation 'com.android.support:design:27.1.1' } diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 74c7113..e9675db 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,3 +1,7 @@ + + + + diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 63ba516..614df20 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -16,8 +16,8 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 25 - buildToolsVersion '25.0.3' + compileSdkVersion 28 + buildToolsVersion "27.0.3" sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -31,7 +31,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.yourcompany.barcodescanexample" minSdkVersion 16 - targetSdkVersion 25 + targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" @@ -51,5 +51,5 @@ flutter { } dependencies { - compile 'org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.2-4' + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index 18844d5..0b51b35 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -35,6 +35,5 @@ - diff --git a/example/android/build.gradle b/example/android/build.gradle index 16bdc53..c782bf4 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,22 +1,22 @@ buildscript { + ext.kotlin_version = '1.2.41' repositories { + google() jcenter() - maven { - url "https://maven.google.com" - } } dependencies { - classpath 'com.android.tools.build:gradle:2.3.3' - classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.2-4' + classpath 'com.android.tools.build:gradle:3.1.4' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } allprojects { repositories { + google() jcenter() maven { - url "https://maven.google.com" + url "https://maven.google.com" // Google's Maven repository } } } @@ -24,6 +24,8 @@ allprojects { 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 45e7f14..9372d0f 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-3.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip diff --git a/example/ios/Flutter/Debug.xcconfig b/example/ios/Flutter/Debug.xcconfig index 592ceee..e8efba1 100644 --- a/example/ios/Flutter/Debug.xcconfig +++ b/example/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/example/ios/Flutter/Release.xcconfig b/example/ios/Flutter/Release.xcconfig index 592ceee..399e934 100644 --- a/example/ios/Flutter/Release.xcconfig +++ b/example/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig"