]> git.proxmox.com Git - ceph.git/blob - ceph/src/seastar/fmt/support/build.gradle
update download target update for octopus release
[ceph.git] / ceph / src / seastar / fmt / support / build.gradle
1
2 // General gradle arguments for root project
3 buildscript {
4 repositories {
5 google()
6 jcenter()
7 }
8 dependencies {
9 //
10 // https://developer.android.com/studio/releases/gradle-plugin
11 //
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
14 //
15 classpath 'com.android.tools.build:gradle:3.1.3'
16 }
17 }
18 repositories {
19 google()
20 jcenter()
21 }
22
23 // Output: Shared library (.so) for Android
24 apply plugin: 'com.android.library'
25
26 android {
27 compileSdkVersion 25 // Android 7.0
28
29 // Target ABI
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
34 splits {
35 abi {
36 enable true
37 // Specify platforms for Application
38 reset()
39 include "arm64-v8a", "armeabi-v7a", "x86_64"
40 }
41 }
42
43 defaultConfig {
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"
49
50 externalNativeBuild {
51 cmake {
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
56 cppFlags "-std=c++17"
57 }
58 }
59 println("Gradle CMake Plugin: ")
60 println(externalNativeBuild.cmake.cppFlags)
61 println(externalNativeBuild.cmake.arguments)
62 }
63
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
68 externalNativeBuild {
69 cmake {
70 path "../CMakeLists.txt"
71 // buildStagingDirectory "./build" // Custom path for cmake output
72 }
73 //println(cmake.path)
74 }
75
76 sourceSets{
77 // Android Manifest for Gradle
78 main {
79 manifest.srcFile 'AndroidManifest.xml'
80 }
81 }
82 }
83
84 assemble.doLast
85 {
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
88 copy {
89 from 'build/intermediates/cmake'
90 into '../libs'
91 }
92 // Copy debug binaries
93 copy {
94 from '../libs/debug/obj'
95 into '../libs/debug'
96 }
97 // Copy Release binaries
98 copy {
99 from '../libs/release/obj'
100 into '../libs/release'
101 }
102 // Remove empty directory
103 delete '../libs/debug/obj'
104 delete '../libs/release/obj'
105 }