build.gradle 3.54 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/*
 * *************************************************************************
 *  build.gradle.java
 * **************************************************************************
 *  Copyright © 2015 VLC authors and VideoLAN
 *  Author: Geoffrey Métais
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *  ***************************************************************************
 */
apply plugin: 'com.android.library'
Geoffrey Métais's avatar
Geoffrey Métais committed
24 25 26 27
apply plugin: 'com.github.dcendents.android-maven'

def abi = System.getenv('GRADLE_ABI')?.toLowerCase()
ext {
28
    library_version = '0.4.9'
29
    repoName = 'Android'
Geoffrey Métais's avatar
Geoffrey Métais committed
30 31 32 33 34
    libraryName = 'Medialibrary-Android'
    lib_artifact = "medialibrary-$abi"

    libraryDescription = 'Android bindings and API for Medialibrary'
}
35 36
android {
    compileSdkVersion rootProject.ext.compileSdkVersion
37 38 39 40
    defaultConfig {
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
    }
41 42 43 44 45 46 47 48 49 50 51 52 53 54

    sourceSets {
        main {
            jni.srcDirs = []
            // Prevent gradle from building native code with ndk; we have our own Makefile for it.
            jniLibs.srcDir 'jni/libs' // Where generated .so files are placed.
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets', 'libcompat/libs/armeabi']
        }
55 56 57 58 59 60 61
        test {
            java.srcDirs = ['test']
        }
        androidTest {
            java.srcDirs = ['androidTest']
            assets.srcDirs += files("$projectDir/assets/schemas".toString())
        }
62 63 64 65 66 67 68
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFile 'proguard.cfg'
        }
69 70 71 72
        dev {
            initWith debug
            matchingFallbacks = ['debug']
        }
73
    }
74 75 76 77

    dataBinding {
        enabled = true
    }
78 79 80 81 82 83 84 85 86 87

    // Make per-variant version code
    libraryVariants.all { variant ->
        //Custom APK name
        variant.outputs.each { output ->
            if (output.outputFileName != null && output.outputFileName.endsWith('.aar')) {
                output.outputFileName = "medialibrary-${abi}-${library_version}.aar"
            }
        }
    }
88 89
}

90 91 92 93
clean {
    delete 'build', 'jni/libs', 'jni/obj'
}

94
dependencies {
95 96 97
    releaseImplementation "org.videolan.android:libvlc-all:$rootProject.ext.libvlcVersion"
    debugImplementation "org.videolan.android:libvlc-all:$rootProject.ext.libvlcVersion"
    devImplementation project(':libvlc')
98
    api "androidx.legacy:legacy-support-v4:$rootProject.ext.androidxVersion"
99
    api "androidx.core:core:$rootProject.ext.androidxCoreVersion"
100
    api "androidx.fragment:fragment:$rootProject.ext.androidxVersion"
101
    testImplementation "junit:junit:$rootProject.ext.junitVersion"
Geoffrey Métais's avatar
Geoffrey Métais committed
102 103 104
}

apply from: '../publish.gradle'