apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.tantuo.didicar"
        minSdkVersion 18
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true


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

    sourceSets {
        main {
            jniLibs.srcDir 'libs'
            jni.srcDirs = []    //disable automatic ndk-build
        }
    }


//    externalNativeBuild {
//        //指定Android.mk文件
//        ndkBuild {
//            path 'src/main/jni/Android.mk'
//        }
//    }

    // Encapsulates your external native build configurations.
    externalNativeBuild {

        // Encapsulates your CMake build configurations.
        cmake {

            // Provides a relative path to your CMake build script.
            path "CMakeLists.txt"
        }
    }


}


dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation fileTree(dir: "$buildDir/native-libs", include: 'native-libs.jar')
    implementation 'com.android.support:appcompat-v7:26+'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    implementation project(':SlidingMenu_library')
    implementation 'org.xutils:xutils:3.3.36'
    //Gson
    implementation 'com.google.code.gson:gson:2.8.0'
    //ViewPagerIndicator
    implementation 'com.github.JakeWharton:ViewPagerIndicator:2.4.1@aar'
    //增加TabLayout 指示打车的Tab界面
    implementation 'com.android.support:design:26.1.0'
    implementation files('libs/BaiduLBS_Android.jar')
    implementation project(path: ':openCVLibrary320')
    implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.6'
    // okhttp3的依赖
    implementation 'com.squareup.okhttp3:okhttp:3.8.1'
    implementation 'com.android.support:recyclerview-v7:22.2.1'
}

task nativeLibsToJar(type: Jar, description: 'create a jar archive of the native libs') {
    destinationDir file("$buildDir/native-libs")
    baseName 'native-libs'
    from fileTree(dir: 'libs', include: '**/*.so')
    into 'lib/'
}

tasks.withType(org.gradle.api.tasks.compile.JavaCompile) {
    compileTask -> compileTask.dependsOn(nativeLibsToJar)
}

