apply plugin: 'com.android.application'
apply plugin: 'walle'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.heweather.owp"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 3
        versionName "1.0.2"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    signingConfigs {
        he {
            keyAlias "heweather"
            keyPassword "He123qwe."
            storeFile rootProject.file("he.jks")
            storePassword "He123qwe."
        }
    }
    buildTypes {
        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.he
        }
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.he
        }
    }
    allprojects {
        repositories {
            mavenCentral()
        }
    }
    sourceSets {
        main {
            jniLibs.srcDirs = ['libs']
        }

        // Move the tests to tests/java, tests/res, etc...
//        instrumentTest.setRoot('tests')

        // Move the build types to build-types/<type>
        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
        // This moves them out of them default location under src/<type>/... which would
        // conflict with src/ being used by the main source set.
        // Adding new build types or product flavors should be accompanied
        // by a similar customization.
        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
}
buildscript {
    repositories {
        jcenter()
    }
}
//生成渠道包 ./gradlew clean assembleReleaseChannels
//支持 productFlavors ./gradlew clean assembleMeituanReleaseChannels
//生成单个渠道包 ./gradlew clean assembleReleaseChannels -PchannelList=google
//生成多个渠道包 ./gradlew clean assembleReleaseChannels -PchannelList=google,dianping
walle {
    // 指定渠道包的输出路径
    apkOutputFolder = new File("${project.buildDir}/channels")
    // 定制渠道包的APK的文件名称
    apkFileNameFormat = '${appName}-${channel}-${buildType}-v${versionName}-${versionCode}-${buildTime}.apk'
    // 渠道配置文件
    channelFile = new File("${project.getProjectDir()}/channel")
}
dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:support-v4:28.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'joda-time:joda-time:2.10'
    implementation 'com.squareup.okhttp3:okhttp:3.10.0'
    implementation 'com.zhy:okhttputils:2.6.2'
    implementation files('libs/android-logging-log4j-1.0.3.jar')
    implementation files('libs/log4j-1.2.17.jar')
    implementation 'com.google.code.gson:gson:2.8.0'
    implementation files('libs/AMap_Location_V4.0.1_20180426.jar')
    implementation files('libs/HeWeather_sdk.jar')
}