Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,13 @@ MediaInfoLib.VC.db

# Temporary files
*~

# Android app directories
**/.cxx/*
**/.gradle
**/.idea
**/local.properties
/Source/AndroidLib/app/build
/Source/AndroidLib/build
/Source/Example/HowToUse_Dll-Android/app/build
/Source/Example/HowToUse_Dll-Android/build
4 changes: 3 additions & 1 deletion Project/CMake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,10 @@ endif()
# disable some features. Maybe it should be enabled.
target_compile_definitions(mediainfo PRIVATE MEDIAINFO_LIBMMS_NO)
target_compile_definitions(mediainfo PRIVATE FMT_UNICODE=0)
if(NOT CURL_FOUND)
if(NOT CURL_FOUND AND NOT curl_FOUND)
target_compile_definitions(mediainfo PRIVATE MEDIAINFO_LIBCURL_DLL_RUNTIME)
elseif(TARGET curl::curl_static)
target_link_libraries(mediainfo curl::curl_static)
else()
include_directories(${CURL_INCLUDE_DIRS})
target_link_libraries(mediainfo ${CURL_LIBRARIES})
Expand Down
41 changes: 13 additions & 28 deletions Release/Release_DLL_Android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,44 +17,29 @@ if [ -z "$VERSION" ] ; then
VERSION=$(<"$releasedir"/../Project/version.txt)
fi

if [ -z "$NDK" ] ; then
echo "error: missing mandatory environment \$NDK" >&2
if [ -z "$JAVA_HOME" ] ; then
echo "error: missing mandatory environment \$JAVA_HOME" >&2
exit 1
fi

if [ -z "$MINSDKVERSION" ] ; then
MINSDKVERSION=24 # Android 7.0 needed for -D_FILE_OFFSET_BITS=64
if [ -z "$ANDROID_HOME" ] ; then
echo "error: missing mandatory environment \$ANDROID_HOME" >&2
exit 1
fi

#-----------------------------------------------------------------------
# Clean
rm -fr "$releasedir"/build
rm -fr "$releasedir"/MediaInfo_DLL_Android
rm -f "$releasedir"/MediaInfo_DLL_*_Android.zip
rm -fr "$releasedir"/../Source/AndroidLib/mediainfolib/.cxx
rm -fr "$releasedir"/../Source/AndroidLib/mediainfolib/build
rm -f "$releasedir"/MediaInfo_DLL_*_Android.aar

#-----------------------------------------------------------------------
# Build
abis=(arm64-v8a armeabi-v7a x86_64 x86)
for abi in "${abis[@]}" ; do
mkdir -p "$releasedir"/build/$abi
pushd "$releasedir"/build/$abi
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="$NDK"/build/cmake/android.toolchain.cmake -DANDROID_ABI=$abi -DANDROID_PLATFORM=android-$MINSDKVERSION -DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON -DBUILD_SHARED_LIBS=1 -DBUILD_ZENLIB=1 "$releasedir"/../Project/CMake
ninja
mkdir -p "$releasedir"/MediaInfo_DLL_Android/lib/$abi
cp libmediainfo.so "$releasedir"/MediaInfo_DLL_Android/lib/$abi
popd
done

mkdir -p "$releasedir"/MediaInfo_DLL_Android/include/MediaInfo
cp -f "$releasedir"/../Source/MediaInfo/MediaInfo.h "$releasedir"/MediaInfo_DLL_Android/include/MediaInfo
cp -f "$releasedir"/../Source/MediaInfo/MediaInfoList.h "$releasedir"/MediaInfo_DLL_Android/include/MediaInfo
cp -f "$releasedir"/../Source/MediaInfo/MediaInfo_Const.h "$releasedir"/MediaInfo_DLL_Android/include/MediaInfo
cp -f "$releasedir"/../Source/MediaInfo/MediaInfo_Events.h "$releasedir"/MediaInfo_DLL_Android/include/MediaInfo
mkdir -p "$releasedir"/MediaInfo_DLL_Android/include/MediaInfoDLL
cp -f "$releasedir"/../Source/MediaInfoDLL/MediaInfoDLL.h "$releasedir"/MediaInfo_DLL_Android/include/MediaInfoDLL
cp -f "$releasedir"/../Source/MediaInfoDLL/MediaInfoDLL_Static.h "$releasedir"/MediaInfo_DLL_Android/include/MediaInfoDLL
pushd "$releasedir"/../Source/AndroidLib
chmod +x ./gradlew
./gradlew assembleRelease
popd

#-----------------------------------------------------------------------
# Package
zip -r MediaInfo_DLL_${VERSION}_Android.zip MediaInfo_DLL_Android

cp "$releasedir"/../Source/AndroidLib/mediainfolib/build/outputs/aar/mediainfolib-release.aar "$releasedir"/MediaInfo_DLL_${VERSION}_Android.aar
22 changes: 22 additions & 0 deletions Source/AndroidLib/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:9.2.0'
classpath 'com.android.tools.build:gradle-settings-api:9.2.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
mavenCentral()
}
}
13 changes: 13 additions & 0 deletions Source/AndroidLib/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
13 changes: 13 additions & 0 deletions Source/AndroidLib/gradle/gradle-daemon-jvm.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#This file is generated by updateDaemonJvm
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/56a19bc915b9ba2eb62ba7554c61b919/redirect
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/398ffe3949748bfb1d5636f023d228fd/redirect
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/56a19bc915b9ba2eb62ba7554c61b919/redirect
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/398ffe3949748bfb1d5636f023d228fd/redirect
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/e99bae143b75f9a10ead10248f02055e/redirect
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/04e088f8677de3b384108493cc9481d0/redirect
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/56a19bc915b9ba2eb62ba7554c61b919/redirect
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/398ffe3949748bfb1d5636f023d228fd/redirect
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/e55dccbfe27cb97945148c61a39c89c5/redirect
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/dbd05c4936d573642f94cd149e1356c8/redirect
toolchainVendor=JETBRAINS
toolchainVersion=21
Binary file not shown.
7 changes: 7 additions & 0 deletions Source/AndroidLib/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
248 changes: 248 additions & 0 deletions Source/AndroidLib/gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading