2 // General gradle arguments for root project
10 // https://developer.android.com/studio/releases/gradle-plugin
12 // Notice that 3.1.3 here is the version of [Android Gradle Plugin]
13 // Accroding to URL above you will need Gradle 4.4 or higher
15 classpath 'com.android.tools.build:gradle:3.1.3'
23 // Output: Shared library (.so) for Android
24 apply plugin: 'com.android.library'
27 compileSdkVersion 25 // Android 7.0
30 // - This option controls target platform of module
31 // - The platform might be limited by compiler's support
32 // some can work with Clang(default), but some can work only with GCC...
33 // if bad, both toolchains might not support it
37 // Specify platforms for Application
39 include "arm64-v8a", "armeabi-v7a", "x86_64"
44 minSdkVersion 21 // Android 5.0+
45 targetSdkVersion 25 // Follow Compile SDK
46 versionCode 20 // Follow release count
47 versionName "5.2.1" // Follow Official version
48 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
52 arguments "-DANDROID_STL=c++_shared" // Specify Android STL
53 arguments "-DBUILD_SHARED_LIBS=true" // Build shared object
54 arguments "-DFMT_TEST=false" // Skip test
55 arguments "-DFMT_DOC=false" // Skip document
59 println("Gradle CMake Plugin: ")
60 println(externalNativeBuild.cmake.cppFlags)
61 println(externalNativeBuild.cmake.arguments)
64 // External Native build
65 // - Use existing CMakeList.txt
66 // - Give path to CMake. This gradle file should be
67 // neighbor of the top level cmake
70 path "../CMakeLists.txt"
71 // buildStagingDirectory "./build" // Custom path for cmake output
77 // Android Manifest for Gradle
79 manifest.srcFile 'AndroidManifest.xml'
86 // Instead of `ninja install`, Gradle will deploy the files.
87 // We are doing this since FMT is dependent to the ANDROID_STL after build
89 from 'build/intermediates/cmake'
92 // Copy debug binaries
94 from '../libs/debug/obj'
97 // Copy Release binaries
99 from '../libs/release/obj'
100 into '../libs/release'
102 // Remove empty directory
103 delete '../libs/debug/obj'
104 delete '../libs/release/obj'