build.gradle 1.83 KB
Newer Older
1 2
apply plugin: 'com.android.library'

3 4

task buildDebugARM(type:Exec) {
5 6 7 8 9 10 11 12 13 14
    /*
    Properties set for Android Studio own shell.
    when you run gradlew from cli, OS shell env variables will be used

    To be able to build from Android Studio, you have to set ndk.dir & sdk.dir
    properties in local.properties in the root folder, like this (for example):
    sdk.dir=/home/<username>/SDK/android-sdk-linux
    ndk.dir=/home/<username>/SDK/android-ndk-r10b
     */
    if (System.getenv('ANDROID_SDK') == null || System.getenv('ANDROID_NDK') == null) {
15 16
        environment 'ANDROID_NDK', ndk
        environment 'ANDROID_SDK', sdk
17 18
    }
    workingDir '..'
Geoffrey Métais's avatar
Geoffrey Métais committed
19
    commandLine './compile-libvlc.sh'
20
    args('-a', "armeabi-v7a")
21 22
}

23
task buildDebugx86(type:Exec) {
24
    if (System.getenv('ANDROID_SDK') == null || System.getenv('ANDROID_NDK') == null) {
25 26
        environment 'ANDROID_NDK', ndk
        environment 'ANDROID_SDK', sdk
27 28
    }
    workingDir '..'
Geoffrey Métais's avatar
Geoffrey Métais committed
29
    commandLine './compile-libvlc.sh'
30
    args('-a', "x86")
31 32
}

33
android {
34 35
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion
36 37 38

    sourceSets {
    main {
Edward Wang's avatar
Edward Wang committed
39 40
        jni.srcDirs = [] // Prevent gradle from building native code with ndk; we have our own Makefile for it.
        jniLibs.srcDir 'libs' // Where generated .so files are placed.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src']
        resources.srcDirs = ['src']
        aidl.srcDirs = ['src']
        renderscript.srcDirs = ['src']
        res.srcDirs = ['res']
        assets.srcDirs = ['assets']
    }
    }

    defaultConfig {
        minSdkVersion 7
        targetSdkVersion 21
    }

    buildTypes {
        release {
58
            minifyEnabled false
59 60 61 62
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}