mirror of
https://github.com/videolan/vlc-android
synced 2024-12-04 23:34:38 +08:00
109 lines
3.6 KiB
Groovy
109 lines
3.6 KiB
Groovy
/*
|
|
* *************************************************************************
|
|
* 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'
|
|
apply plugin: "com.vanniktech.maven.publish"
|
|
|
|
def abi = System.getenv('GRADLE_ABI')?.toLowerCase()
|
|
ext {
|
|
library_version = "$rootProject.ext.medialibraryVersion"
|
|
}
|
|
android {
|
|
namespace 'org.videolan.medialibrary'
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
}
|
|
|
|
defaultConfig {
|
|
minSdkVersion rootProject.ext.minSdkVersion
|
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
|
compileSdk rootProject.ext.compileSdkVersion
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
jniLibs.srcDir 'jni/libs' // Where generated .so files are placed.
|
|
manifest.srcFile 'AndroidManifest.xml'
|
|
java.srcDirs = rootProject.ext.vlcMajorVersion == 4 ? ['src', 'vlc4/src'] : ['src', 'vlc3/src']
|
|
resources.srcDirs = ['src']
|
|
aidl.srcDirs = ['src']
|
|
renderscript.srcDirs = ['src']
|
|
res.srcDirs = ['res']
|
|
assets.srcDirs = ['assets', 'libcompat/libs/armeabi']
|
|
}
|
|
test {
|
|
java.srcDirs = ['test']
|
|
}
|
|
androidTest {
|
|
java.srcDirs = ['androidTest']
|
|
assets.srcDirs += files("$projectDir/assets/schemas".toString())
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
proguardFile 'proguard.cfg'
|
|
}
|
|
dev {
|
|
initWith debug
|
|
matchingFallbacks = ['debug']
|
|
}
|
|
}
|
|
|
|
dataBinding {
|
|
enabled = true
|
|
}
|
|
buildFeatures {
|
|
renderScript true
|
|
aidl true
|
|
}
|
|
|
|
// 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"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
clean {
|
|
delete 'build', 'jni/libs', 'jni/obj'
|
|
}
|
|
|
|
dependencies {
|
|
releaseImplementation project(':libvlcjni:libvlc')
|
|
debugImplementation "org.videolan.android:libvlc-all:$rootProject.ext.libvlcVersion"
|
|
devImplementation project(':libvlcjni:libvlc')
|
|
api "androidx.legacy:legacy-support-v4:$rootProject.ext.androidxLegacyVersion"
|
|
api "androidx.core:core:$rootProject.ext.androidxCoreVersion"
|
|
api "androidx.fragment:fragment:$rootProject.ext.androidxFragmentVersion"
|
|
testImplementation "junit:junit:$rootProject.ext.junitVersion"
|
|
testImplementation "org.robolectric:robolectric:4.3.1"
|
|
}
|
|
|
|
apply from: '../buildsystem/publish.gradle'
|