/*
 * MIT License
 *
 * Copyright (c) 2018 Alibaba Group
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

apply plugin: 'com.android.application'
apply plugin: 'com.antfortune.freeline'

android {
    compileSdkVersion System.properties['compileSdkVersion'] ? Integer.parseInt(System.properties['compileSdkVersion']) : 25
    buildToolsVersion System.properties['buildToolsVersion'] ? System.properties['buildToolsVersion'] : '25.0.3'

    lintOptions {
        abortOnError false
    }

    defaultConfig {
        applicationId "com.tmall.wireless.virtualviewdemo"
        minSdkVersion 14
        targetSdkVersion System.properties['targetSdkVersion'] ? Integer.parseInt(System.properties['targetSdkVersion']) : 25
        versionCode 1
        versionName "1.0"
        jackOptions {
            enabled true
        }
    }
    buildTypes {
        debug {
            applicationIdSuffix ".debug"
        }
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets { main { res.srcDirs = ['src/main/res', 'src/main/res/anim'] } }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

configurations.all {
    // check for updates every build
    resolutionStrategy.cacheChangingModulesFor 1000, 'seconds'
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:26.0.2'
    compile project(path: ':virtualview')
    compile 'com.android.support:recyclerview-v7:26.0.2@aar'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
    compile 'com.squareup.picasso:picasso:2.5.2'
    provided('com.alibaba.android:virtual-common:1.0.9') {
        changing = true
    }
    compile('com.alibaba.android:virtual-compiler:1.0.10@jar') {
        exclude group: 'xmlpull', module: 'xmlpull'
        exclude group: 'net.sf.kxml', module: 'kxml2'
        changing = true
    }

    compile 'com.google.code.gson:gson:2.8.2'
    compile 'com.squareup.okhttp3:okhttp:3.9.1'
}
