Skip to content

Commit 8ffd49e

Browse files
committed
Android updates (gradle, build)
1 parent 743131d commit 8ffd49e

File tree

9 files changed

+55
-19
lines changed

9 files changed

+55
-19
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## [0.0.5] - August 21, 2018
2+
* Update Android SDK reference
3+
14
## [0.0.4] - August 21, 2018
25
* Adjust pubspec.yml to match Dart 2.0 SDK version
36

android/build.gradle

+27-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
def localProperties = new Properties()
2+
def localPropertiesFile = rootProject.file('local.properties')
3+
if (localPropertiesFile.exists()) {
4+
localPropertiesFile.withReader('UTF-8') { reader ->
5+
localProperties.load(reader)
6+
}
7+
}
8+
9+
def flutterRoot = localProperties.getProperty('flutter.sdk')
10+
if (flutterRoot == null) {
11+
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12+
}
13+
14+
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15+
if (flutterVersionCode == null) {
16+
flutterVersionCode = '1'
17+
}
18+
19+
def flutterVersionName = localProperties.getProperty('flutter.versionName')
20+
if (flutterVersionName == null) {
21+
flutterVersionName = '1.0'
22+
}
23+
24+
125
group 'flutter.plugins.screen.screen'
226
version '1.0-SNAPSHOT'
327

@@ -10,7 +34,7 @@ buildscript {
1034
}
1135

1236
dependencies {
13-
classpath 'com.android.tools.build:gradle:2.3.3'
37+
classpath 'com.android.tools.build:gradle:3.2.1'
1438
}
1539
}
1640

@@ -26,12 +50,11 @@ rootProject.allprojects {
2650
apply plugin: 'com.android.library'
2751

2852
android {
29-
compileSdkVersion 25
30-
buildToolsVersion '25.0.3'
53+
compileSdkVersion 28
3154

3255
defaultConfig {
3356
minSdkVersion 16
34-
targetSdkVersion 25
57+
targetSdkVersion 28
3558
versionCode 1
3659
versionName "1.0"
3760
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

android/gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip

example/android/app/build.gradle

+19-11
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
def localProperties = new Properties()
22
def localPropertiesFile = rootProject.file('local.properties')
33
if (localPropertiesFile.exists()) {
4-
localPropertiesFile.withInputStream { stream ->
5-
localProperties.load(stream)
4+
localPropertiesFile.withReader('UTF-8') { reader ->
5+
localProperties.load(reader)
66
}
77
}
88

@@ -11,24 +11,32 @@ if (flutterRoot == null) {
1111
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
1212
}
1313

14+
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15+
if (flutterVersionCode == null) {
16+
flutterVersionCode = '1'
17+
}
18+
19+
def flutterVersionName = localProperties.getProperty('flutter.versionName')
20+
if (flutterVersionName == null) {
21+
flutterVersionName = '1.0'
22+
}
23+
1424
apply plugin: 'com.android.application'
1525
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
1626

1727
android {
18-
compileSdkVersion 25
19-
buildToolsVersion '25.0.3'
28+
compileSdkVersion 28
2029

2130
lintOptions {
2231
disable 'InvalidPackage'
2332
}
2433

2534
defaultConfig {
26-
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
2735
applicationId "flutter.plugins.screen.screenexample"
2836
minSdkVersion 16
29-
targetSdkVersion 25
30-
versionCode 1
31-
versionName "1.0"
37+
targetSdkVersion 28
38+
versionCode flutterVersionCode.toInteger()
39+
versionName flutterVersionName
3240
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
3341
}
3442

@@ -46,7 +54,7 @@ flutter {
4654
}
4755

4856
dependencies {
49-
androidTestCompile 'com.android.support:support-annotations:25.4.0'
50-
androidTestCompile 'com.android.support.test:runner:0.5'
51-
androidTestCompile 'com.android.support.test:rules:0.5'
57+
androidTestImplementation 'com.android.support:support-annotations:28.0.3'
58+
androidTestImplementation 'com.android.support.test:runner:1.0.2'
59+
androidTestImplementation 'com.android.support.test:rules:1.0.2'
5260
}

example/android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
}
88

99
dependencies {
10-
classpath 'com.android.tools.build:gradle:2.3.3'
10+
classpath 'com.android.tools.build:gradle:3.2.1'
1111
}
1212
}
1313

example/android/gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip

example/ios/Flutter/Debug.xcconfig

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
12
#include "Generated.xcconfig"

example/ios/Flutter/Release.xcconfig

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
12
#include "Generated.xcconfig"

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: screen
22
description: A Flutter plugin to manage the device's screen on Android and iOS.
3-
version: 0.0.4
3+
version: 0.0.5
44
author: Clovis Nicolas <clovisnicolas0@gmail.com>
55
homepage: https://github.com/clovisnicolas/flutter_screen
66

0 commit comments

Comments
 (0)