Commit f58b1d1b authored by Geoffrey Métais's avatar Geoffrey Métais

Set bintray dependencies

- Suppress flavors
- Mutli ABI apk in debug
- splitted apks by ABI in release
- build libvlc & medialibrary with compile.sh in Dev mode
parent e38bf6a1
...@@ -20,6 +20,9 @@ allprojects { ...@@ -20,6 +20,9 @@ allprojects {
repositories { repositories {
google() google()
jcenter() jcenter()
maven {
url "https://dl.bintray.com/videolan/LibVLC"
}
} }
} }
...@@ -29,6 +32,8 @@ ext { ...@@ -29,6 +32,8 @@ ext {
minSdkVersion = 17 minSdkVersion = 17
targetSdkVersion = 28 targetSdkVersion = 28
compileSdkVersion = 28 compileSdkVersion = 28
libvlcVersion = '3.1.0'
medialibraryVersion = '0.4'
androidxVersion = '1.0.0' androidxVersion = '1.0.0'
constraintLayoutVersion = '2.0.0-alpha2' constraintLayoutVersion = '2.0.0-alpha2'
archVersion = '2.0.0' archVersion = '2.0.0'
......
...@@ -40,9 +40,6 @@ while [ $# -gt 0 ]; do ...@@ -40,9 +40,6 @@ while [ $# -gt 0 ]; do
ANDROID_ABI=$2 ANDROID_ABI=$2
shift shift
;; ;;
-c)
CHROME_OS=1
;;
-r|release|--release) -r|release|--release)
RELEASE=1 RELEASE=1
;; ;;
...@@ -74,6 +71,10 @@ while [ $# -gt 0 ]; do ...@@ -74,6 +71,10 @@ while [ $# -gt 0 ]; do
--no-ml) --no-ml)
NO_ML=1 NO_ML=1
;; ;;
--publish)
RELEASE=1
PUBLISH=1
;;
*) *)
diagnostic "$0: Invalid option '$1'." diagnostic "$0: Invalid option '$1'."
diagnostic "$0: Try --help for more information." diagnostic "$0: Try --help for more information."
...@@ -275,7 +276,7 @@ compile() { ...@@ -275,7 +276,7 @@ compile() {
fi fi
# Build LibVLC if asked for it, or needed by medialibrary # Build LibVLC if asked for it, or needed by medialibrary
if [ "$BUILD_MEDIALIB" != 1 -o ! -d "libvlc/jni/libs/$ANDROID_ABI" ]; then if [ "$BUILD_MEDIALIB" != 1 -o ! -d "libvlc/jni/libs/$1" ]; then
./compile-libvlc.sh $OPTS ./compile-libvlc.sh $OPTS
fi fi
...@@ -283,51 +284,60 @@ compile() { ...@@ -283,51 +284,60 @@ compile() {
./compile-medialibrary.sh $OPTS ./compile-medialibrary.sh $OPTS
fi fi
} }
if [ "$ANDROID_ABI" = "all" ]; then if [ "$BUILD_MEDIALIB" = 1 -o "$BUILD_LIBVLC" = 1 -o "$RELEASE" != 1 ]; then
if [ -d libvlc/tmp ]; then if [ "$ANDROID_ABI" = "all" ]; then
rm -rf libvlc/tmp if [ -d tmp ]; then
rm -rf tmp
fi
mkdir tmp
LIB_DIR="libvlc"
if [ "$NO_ML" != 1 ]; then
LIB_DIR="medialibrary"
fi
compile armeabi-v7a
cp -r $LIB_DIR/jni/libs/armeabi-v7a tmp
compile arm64-v8a
cp -r $LIB_DIR/jni/libs/arm64-v8a tmp
compile x86
cp -r $LIB_DIR/jni/libs/x86 tmp
compile x86_64
mv tmp/* $LIB_DIR/jni/libs
rm -rf tmp
else
compile $ANDROID_ABI
fi fi
mkdir libvlc/tmp
compile armeabi-v7a
mv libvlc/jni/libs/armeabi-v7a libvlc/tmp
compile arm64-v8a
mv libvlc/jni/libs/arm64-v8a libvlc/tmp
compile x86
mv libvlc/jni/libs/x86 libvlc/tmp
compile x86_64
mv libvlc/tmp/* libvlc/jni/libs
else
compile $ANDROID_ABI
fi fi
################## ##################
# Compile the UI # # Compile the UI #
################## ##################
PLATFORM="Vanilla" BUILDTYPE="Dev"
BUILDTYPE="Debug"
if [ "$SIGNED_RELEASE" = 1 ]; then if [ "$SIGNED_RELEASE" = 1 ]; then
BUILDTYPE="signedRelease" BUILDTYPE="signedRelease"
elif [ "$RELEASE" = 1 ]; then elif [ "$RELEASE" = 1 ]; then
BUILDTYPE="Release" BUILDTYPE="Release"
fi fi
if [ "$CHROME_OS" = 1 ]; then
PLATFORM="Chrome"
fi
if [ "$BUILD_LIBVLC" = 1 ];then if [ "$BUILD_LIBVLC" = 1 ];then
GRADLE_ABI=$GRADLE_ABI ./gradlew -p libvlc assemble${BUILDTYPE} GRADLE_ABI=$GRADLE_ABI ./gradlew -p libvlc assemble${BUILDTYPE}
RUN=0 RUN=0
CHROME_OS=0 CHROME_OS=0
if [ "$PUBLISH" = 1 ];then
GRADLE_ABI=$GRADLE_ABI ./gradlew -p libvlc install bintrayUpload
fi
elif [ "$BUILD_MEDIALIB" = 1 ]; then elif [ "$BUILD_MEDIALIB" = 1 ]; then
GRADLE_ABI=$GRADLE_ABI ./gradlew -p medialibrary assemble${BUILDTYPE} GRADLE_ABI=$GRADLE_ABI ./gradlew -p medialibrary assemble${BUILDTYPE}
RUN=0 RUN=0
CHROME_OS=0 CHROME_OS=0
if [ "$PUBLISH" = 1 ];then
GRADLE_ABI=$GRADLE_ABI ./gradlew -p medialibrary install bintrayUpload
fi
else else
if [ "$RUN" = 1 ]; then if [ "$RUN" = 1 ]; then
ACTION="install" ACTION="install"
else else
ACTION="assemble" ACTION="assemble"
fi fi
TARGET="${ACTION}${PLATFORM}${GRADLE_ABI}${BUILDTYPE}" TARGET="${ACTION}${BUILDTYPE}"
CLI="" ./gradlew $TARGET CLI="" ./gradlew $TARGET
fi fi
......
...@@ -37,6 +37,10 @@ android { ...@@ -37,6 +37,10 @@ android {
minifyEnabled false minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
} }
dev {
initWith debug
matchingFallbacks = ['debug']
}
} }
// Make per-variant version code // Make per-variant version code
......
...@@ -66,6 +66,10 @@ android { ...@@ -66,6 +66,10 @@ android {
minifyEnabled false minifyEnabled false
proguardFile 'proguard.cfg' proguardFile 'proguard.cfg'
} }
dev {
initWith debug
matchingFallbacks = ['debug']
}
} }
dataBinding { dataBinding {
...@@ -88,7 +92,9 @@ clean { ...@@ -88,7 +92,9 @@ clean {
} }
dependencies { dependencies {
implementation project(':libvlc') releaseImplementation "org.videolan.android:libvlc-all:$rootProject.ext.libvlcVersion"
debugImplementation "org.videolan.android:libvlc-all:$rootProject.ext.libvlcVersion"
devImplementation project(':libvlc')
api "androidx.legacy:legacy-support-v4:$rootProject.ext.androidxVersion" api "androidx.legacy:legacy-support-v4:$rootProject.ext.androidxVersion"
api "androidx.core:core:$rootProject.ext.androidxVersion" api "androidx.core:core:$rootProject.ext.androidxVersion"
api "androidx.fragment:fragment:$rootProject.ext.androidxVersion" api "androidx.fragment:fragment:$rootProject.ext.androidxVersion"
......
...@@ -81,8 +81,7 @@ bintray { ...@@ -81,8 +81,7 @@ bintray {
vcsUrl = gitUrl vcsUrl = gitUrl
labels = ['aar', 'android', 'vlc'] labels = ['aar', 'android', 'vlc']
dryRun = false dryRun = false
publish = true override = true
override = false
publicDownloadNumbers = true publicDownloadNumbers = true
version { version {
desc = libraryDescription desc = libraryDescription
......
import com.android.build.OutputFile
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
...@@ -20,7 +22,7 @@ android { ...@@ -20,7 +22,7 @@ android {
compileSdkVersion rootProject.ext.compileSdkVersion compileSdkVersion rootProject.ext.compileSdkVersion
flavorDimensions "target", "abi" flavorDimensions "abi"
lintOptions { lintOptions {
abortOnError false abortOnError false
...@@ -122,49 +124,40 @@ android { ...@@ -122,49 +124,40 @@ android {
applicationIdSuffix ".debug" applicationIdSuffix ".debug"
jniDebuggable true jniDebuggable true
} }
} dev {
productFlavors { initWith debug
vanilla { matchingFallbacks = ['debug']
dimension "target"
versionCode = 1
}
ARMv7 {
dimension "abi"
versionCode = 4
}
x86 {
dimension "abi"
versionCode = 5
}
MIPS {
dimension "abi"
versionCode = 6
}
ARMv8 {
dimension "abi"
versionCode = 7
} }
x86_64 { }
dimension "abi"
versionCode = 8 splits {
} abi {
MIPS64 { def isReleaseBuild = false
dimension "abi" gradle.startParameter.taskNames.find {
versionCode = 9 // Enable split for release builds in different build flavors
// (assemblePaidRelease, assembleFreeRelease, etc.).
if (it.toLowerCase() ==~ /assemble.*Release/.toLowerCase()) {
isReleaseBuild = true
return true // break
}
return false // continue
}
enable isReleaseBuild
reset()
include "x86", "x86_64", "armeabi-v7a", "arm64-v8a"
// universalApk !isReleaseBuild
} }
} }
def abiCodes = ['x86':5, 'x86_64':8, 'armeabi-v7a':4, 'arm64-v8a':7]
// make per-variant version code // make per-variant version code
applicationVariants.all { variant -> applicationVariants.all { variant ->
def generatedCode = variant.productFlavors.get(0).versionCode * 10000000 + defaultConfig.versionCode + variant.productFlavors.get(1).versionCode
//Custom APK name and versionCode //Custom APK name and versionCode
variant.outputs.each { output -> variant.outputs.each { output ->
output.versionCodeOverride = generatedCode def abiName = output.getFilter(OutputFile.ABI) ?: "all"
output.versionCodeOverride = 10000000 + defaultConfig.versionCode + abiCodes.get(abiName, 0)
def outputName = "VLC-Android-" def outputName = "VLC-Android-"
if (variant.productFlavors.get(0).name != "vanilla") outputName += variant.versionName + "-" + abiName + ".apk"
outputName += variant.productFlavors.get(0).name.toUpperCase() + "-"
outputName += variant.versionName + "-" + variant.productFlavors.get(1).name + ".apk"
output.outputFileName = outputName output.outputFileName = outputName
} }
} }
...@@ -199,9 +192,14 @@ task generateSources (type: Jar) { ...@@ -199,9 +192,14 @@ task generateSources (type: Jar) {
} }
dependencies { dependencies {
implementation project(':libvlc') devImplementation project(':libvlc')
implementation project(':medialibrary') devImplementation project(':medialibrary')
debugImplementation "org.videolan.android:libvlc-all:$rootProject.ext.libvlcVersion"
debugImplementation "org.videolan.android:medialibrary-all:$rootProject.ext.medialibraryVersion"
releaseImplementation "org.videolan.android:libvlc-all:$rootProject.ext.libvlcVersion"
releaseImplementation "org.videolan.android:medialibrary-all:$rootProject.ext.medialibraryVersion"
implementation project(':api') implementation project(':api')
implementation project(':tools')
// AppCompat // AppCompat
implementation "androidx.recyclerview:recyclerview:$rootProject.ext.androidxVersion" implementation "androidx.recyclerview:recyclerview:$rootProject.ext.androidxVersion"
implementation "com.google.android.material:material:$rootProject.ext.androidxVersion" implementation "com.google.android.material:material:$rootProject.ext.androidxVersion"
...@@ -224,7 +222,6 @@ dependencies { ...@@ -224,7 +222,6 @@ dependencies {
// Retrofit // Retrofit
implementation "com.squareup.retrofit2:retrofit:$rootProject.ext.retrofit" implementation "com.squareup.retrofit2:retrofit:$rootProject.ext.retrofit"
implementation "com.squareup.retrofit2:converter-moshi:$rootProject.ext.retrofit" implementation "com.squareup.retrofit2:converter-moshi:$rootProject.ext.retrofit"
implementation project(":tools")
// Test // Test
androidTestImplementation "androidx.test.espresso:espresso-contrib:$rootProject.espressoVersion" androidTestImplementation "androidx.test.espresso:espresso-contrib:$rootProject.espressoVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$rootProject.espressoVersion" androidTestImplementation "androidx.test.espresso:espresso-core:$rootProject.espressoVersion"
......
...@@ -236,7 +236,7 @@ public class UiTools { ...@@ -236,7 +236,7 @@ public class UiTools {
final TextView compiled = v.findViewById(R.id.main_compiled); final TextView compiled = v.findViewById(R.id.main_compiled);
compiled.setText(builder + " (" + builddate + ")"); compiled.setText(builder + " (" + builddate + ")");
final TextView textview_rev = v.findViewById(R.id.main_revision); final TextView textview_rev = v.findViewById(R.id.main_revision);
textview_rev.setText(v.getContext().getString(R.string.revision) + " " + revision + " (" + builddate + ") " + BuildConfig.FLAVOR_abi); textview_rev.setText(v.getContext().getString(R.string.revision) + " " + revision + " (" + builddate + ") " + BuildConfig.FLAVOR);
final ImageView logo = v.findViewById(R.id.logo); final ImageView logo = v.findViewById(R.id.logo);
logo.setOnClickListener(new View.OnClickListener() { logo.setOnClickListener(new View.OnClickListener() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment