build.gradle 1.68 KB
Newer Older
1 2 3
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
4 5
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
6 7 8 9 10 11 12 13
    }
}

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.")
}

14 15 16 17 18 19 20 21 22 23
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

24 25 26 27
apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
28
    compileSdkVersion 28
29 30 31 32 33 34

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
35 36
        applicationId "io.flutter.examples.layers"
        minSdkVersion 16
37
        targetSdkVersion 28
38 39
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
40
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source '../..'
}

dependencies {
57
    testImplementation 'junit:junit:4.12'
58 59
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
60
}