vlc-android/medialibrary/build.gradle

109 lines
3.6 KiB
Groovy
Raw Normal View History

/*
* *************************************************************************
* 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'
2021-03-23 17:05:09 +08:00
apply plugin: "com.vanniktech.maven.publish"
2018-11-21 23:33:22 +08:00
def abi = System.getenv('GRADLE_ABI')?.toLowerCase()
ext {
2020-04-16 17:57:58 +08:00
library_version = "$rootProject.ext.medialibraryVersion"
2018-11-21 23:33:22 +08:00
}
android {
2023-06-08 20:50:45 +08:00
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']
}
2018-09-24 21:12:31 +08:00
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
2023-06-08 20:50:45 +08:00
}
buildFeatures {
renderScript true
aidl true
}
2018-11-27 00:34:29 +08:00
// 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 {
2022-05-25 15:45:17 +08:00
releaseImplementation project(':libvlcjni:libvlc')
debugImplementation "org.videolan.android:libvlc-all:$rootProject.ext.libvlcVersion"
2022-05-25 15:45:17 +08:00
devImplementation project(':libvlcjni:libvlc')
2019-07-25 23:09:22 +08:00
api "androidx.legacy:legacy-support-v4:$rootProject.ext.androidxLegacyVersion"
2018-12-08 00:44:54 +08:00
api "androidx.core:core:$rootProject.ext.androidxCoreVersion"
2020-04-20 21:59:34 +08:00
api "androidx.fragment:fragment:$rootProject.ext.androidxFragmentVersion"
2018-09-03 12:48:35 +08:00
testImplementation "junit:junit:$rootProject.ext.junitVersion"
2020-04-20 21:59:34 +08:00
testImplementation "org.robolectric:robolectric:4.3.1"
2018-11-21 23:33:22 +08:00
}
apply from: '../buildsystem/publish.gradle'