buildscript {
    repositories {
        jcenter()
        google()
        maven {
            url 'https://raw.githubusercontent.com/android-plugin/mvn-repo/master/'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.4.2'
//        classpath fileTree(dir: '../gradle-plugin', include: '*.jar')
        classpath 'org.appcan.gradle.plugins:appcan-gradle-plugin:2.6.1'
    }
}

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

android {
    compileSdkVersion 30
    buildToolsVersion '30.0.3'
    packagingOptions {
        exclude 'META-INF/MANIFEST.MF'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
    sourceSets {
        // by a similar customization.
        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
    lintOptions {
        abortOnError false
    }
    defaultConfig {
        applicationId 'org.zywx.wbpalmstar.widgetone.uex'
        minSdkVersion 22
        targetSdkVersion 30
        multiDexEnabled true

        ndk {
            // Specifies the ABI configurations of your native
            // libraries Gradle should build and package with your APK.
            abiFilters 'x86', 'x86_64', 'armeabi-v7a',
                    'arm64-v8a'
        }
    }

//    splits {
//        abi {
//            enable true
//            reset()
//            include 'x86', 'x86_64', 'armeabi-v7a',
//                    'arm64-v8a'
//            universalApk true
//        }
//    }

//    externalNativeBuild {
//        ndkBuild {
//            path "./jni/Android.mk"
//        }
//    }

    //声明flavorDimension
    flavorDimensions "kernel"

    productFlavors {
        crosswalk {
            dimension "kernel"
        }
        system {
            dimension "kernel"
        }
        x5 {
            dimension "kernel"
        }
    }
    buildTypes {
        debug {
            minifyEnabled false
        }
        release {
            minifyEnabled false
            proguardFile 'proguard.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

repositories {
    jcenter()
    google()
    flatDir {
        dirs 'libs','src/crosswalk/libs'
    }
}

dependencies {
    crosswalkImplementation(name: 'crosswalk-23.53.589.4', ext: 'aar')
    crosswalkImplementation fileTree(dir: 'src/crosswalk/libs', include: '*.jar')
    x5Implementation fileTree(dir: 'src/x5/libs', include: '*.jar')
    systemImplementation fileTree(dir: 'src/system/libs', include: '*.jar')
    implementation files('libs/aceimageloader.jar')
    implementation files('libs/commons-io-2.4.jar')
    implementation files('libs/httpmime-4.1.3.jar')
    implementation files('libs/wmqtt.jar')
//    implementation files('libs/dynamicLoadLib.jar')

    //note: 源码开发工程使用远程依赖，减小工程体积占用；但是引擎包基础工程依然要使用离线包，因为打包服务中原则上不使用远程依赖。
    implementation 'com.google.code.gson:gson:2.8.5'

    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'

}
