You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
111 lines
3.1 KiB
111 lines
3.1 KiB
apply plugin: 'com.android.library'
|
|
apply plugin: 'com.github.dcendents.android-maven'
|
|
|
|
def abi = System.getenv('GRADLE_ABI')?.toLowerCase()
|
|
def vlcSrcDirs = System.getenv('GRADLE_VLC_SRC_DIRS')
|
|
ext {
|
|
library_version = "$rootProject.ext.libvlcVersion"
|
|
repoName = 'Android'
|
|
libraryName = 'LibVLC-Android'
|
|
lib_artifact = "libvlc-$abi"
|
|
|
|
libraryDescription = 'Android bindings and API for VLC'
|
|
}
|
|
android {
|
|
|
|
defaultConfig {
|
|
compileSdkVersion rootProject.ext.compileSdkVersion
|
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
|
minSdkVersion rootProject.ext.minSdkVersion
|
|
resValue "string", "build_vlc_revision", vlcRevision()
|
|
tasks.whenTaskAdded { task ->
|
|
if (task.name.startsWith('merge')) {
|
|
task.dependsOn hrtfsCopy
|
|
task.dependsOn luaPlaylistCopy
|
|
task.dependsOn luaMetaCopy
|
|
task.dependsOn luaModuleCopy
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
jni.srcDirs = [] // Prevent gradle from building native code with ndk; we have our own Makefile for it.
|
|
jniLibs.srcDirs = [ 'jni/libs' ]
|
|
jniLibs.srcDirs += "$vlcSrcDirs"
|
|
manifest.srcFile 'AndroidManifest.xml'
|
|
java.srcDirs = ['src']
|
|
resources.srcDirs = ['src']
|
|
aidl.srcDirs = ['src']
|
|
renderscript.srcDirs = ['src']
|
|
res.srcDirs = ['res']
|
|
assets.srcDirs = ['assets' ]
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
|
|
}
|
|
dev {
|
|
initWith debug
|
|
matchingFallbacks = ['debug']
|
|
}
|
|
}
|
|
|
|
// 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 = "libvlc-${abi}-${library_version}.aar"
|
|
}
|
|
}
|
|
}
|
|
|
|
task hrtfsCopy(type: Copy) {
|
|
project.logger.lifecycle('hrtfsCopy')
|
|
from '../vlc/share/hrtfs'
|
|
into 'assets/hrtfs'
|
|
}
|
|
|
|
task luaPlaylistCopy(type: Copy) {
|
|
from '../vlc/share/lua/playlist'
|
|
into 'assets/lua/playlist'
|
|
exclude '**/*.txt'
|
|
}
|
|
|
|
task luaModuleCopy(type: Copy) {
|
|
from '../vlc/share/lua/modules'
|
|
into 'assets/lua/modules'
|
|
exclude '**/*.txt'
|
|
}
|
|
|
|
task luaMetaCopy(type: Copy) {
|
|
from '../vlc/share/lua/meta'
|
|
into 'assets/lua/meta'
|
|
exclude '**/*.txt'
|
|
}
|
|
}
|
|
|
|
clean {
|
|
delete 'build', 'jni/libs', 'jni/obj'
|
|
}
|
|
|
|
dependencies {
|
|
api "androidx.annotation:annotation:$rootProject.ext.androidxAnnotationVersion"
|
|
api "androidx.legacy:legacy-support-v4:$rootProject.ext.androidxLegacyVersion"
|
|
}
|
|
|
|
def vlcRevision() {
|
|
def vlc = new ByteArrayOutputStream()
|
|
exec {
|
|
commandLine 'git', 'rev-parse', '--short', 'HEAD'
|
|
standardOutput = vlc
|
|
}
|
|
return vlc.toString()
|
|
}
|
|
|
|
apply from: '../buildsystem/publish.gradle'
|
|
|