plugins {
    id "com.github.hierynomus.license" version "0.14.0"
}

apply plugin: 'com.android.library'

android {

    compileSdkVersion project.compileSdkVersion
    resourcePrefix "weexcomm"

    defaultConfig {
        minSdkVersion project.minSdkVersion
        targetSdkVersion project.targetSdkVersion
        versionCode 1
        versionName "1.0"
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

    lintOptions {
          abortOnError false
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }

        debug {
            jniDebuggable true
            debuggable true

        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "com.android.support:support-v4:${project.supportLibVersion}"
    implementation "com.android.support:appcompat-v7:${project.supportLibVersion}"
    // implementation project(':weex_sdk')
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.facebook.fresco:fresco:0.10.0'
    implementation 'com.taobao.android.weex_inspection:protocol:1.1.4.1'

    compileOnly 'com.taobao.android:weex_analyzer:0.1.0.5'
    compileOnly 'com.squareup.okhttp:okhttp:2.3.0'
    compileOnly 'com.squareup.okhttp:okhttp-ws:2.3.0'
    compileOnly "com.alibaba:fastjson:${project.fastjsonLibVersion}"

    testImplementation 'junit:junit:4.12'
    testImplementation 'org.hamcrest:hamcrest-core:1.3'
    testImplementation 'org.javassist:javassist:3.20.0-GA'
    testImplementation 'org.mockito:mockito-core:1.10.19'
    testImplementation 'org.objenesis:objenesis:2.1'
    testImplementation 'org.powermock:powermock-core:1.6.4'
    testImplementation 'org.powermock:powermock-api-mockito:1.6.4'
    testImplementation 'org.powermock:powermock-module-junit4-common:1.6.4'
    testImplementation 'org.powermock:powermock-module-junit4:1.6.4'
    testImplementation 'org.powermock:powermock-module-junit4-legacy:1.6.4'
    testImplementation 'org.powermock:powermock-module-testng:1.6.4'
    testImplementation 'org.robolectric:robolectric:3.0-rc3'

    if(project.implementFromWeex){
        implementation project(':weex_sdk')
    }
    else {
        implementation "org.apache.weex:sdk_legacy:${project.weexSdkVersion}"
    }
}


if(file('../license/LICENSE').exists()){
    license {
        header = file('../license/LICENSE')
    }
    preBuild.dependsOn licenseFormat
}
