forked from facebook/hermes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
62 lines (54 loc) · 1.8 KB
/
build.gradle
File metadata and controls
62 lines (54 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
apply plugin: 'com.android.library'
buildDir = "${rootProject.ext.hermes_ws}/build_android/cppruntime"
buildDir.mkdirs()
android {
compileSdkVersion = rootProject.ext.compileSdkVersion
defaultConfig {
minSdkVersion = rootProject.ext.minSdkVersion
externalNativeBuild {
cmake {
arguments "-DANDROID_STL=c++_shared"
arguments "-DANDROID_PIE=True"
}
}
ndk {
abiFilters (*rootProject.ext.abis)
}
}
externalNativeBuild {
cmake {
version "3.6.0"
path "src/main/cpp/CMakeLists.txt"
buildStagingDirectory = "${rootProject.ext.hermes_ws}/staging/cppruntime"
buildStagingDirectory.mkdirs()
}
}
packagingOptions {
exclude "**/libstub.so"
}
afterEvaluate {
// Gradle 4/5.0 outputs android-debug.aar and android-release.aar
// Gradle 5.1 outputs android.aar for both
// Unify the two by renaming the files afterwards.
// Neither appear to care whether the original filename actually exists.
def aarDir = "$buildDir/outputs/aar"
tasks.named("assembleDebug").configure {
doLast {
file("$aarDir/cppruntime-debug.aar").renameTo("${rootProject.ext.outputDir}/hermes-cppruntime-debug.aar")
file("$aarDir/cppruntime.aar").renameTo("${rootProject.ext.outputDir}/hermes-cppruntime-debug.aar")
}
}
tasks.named("assembleRelease").configure {
doLast {
file("$aarDir/cppruntime-release.aar").renameTo("${rootProject.ext.outputDir}/hermes-cppruntime-release.aar")
file("$aarDir/cppruntime.aar").renameTo("${rootProject.ext.outputDir}/hermes-cppruntime-release.aar")
}
}
}
}