forked from KhalilBellakrid/ledger-test-library-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
executable file
·125 lines (107 loc) · 3.82 KB
/
build.gradle
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
plugins {
id 'com.github.jlouns.cpe' version '0.1.0'
}
task wrapper(type: Wrapper) {
gradleVersion = '4.4'
jarFile = "${project.projectDir}/deps/gradle/wrapper/gradle-wrapper.jar"
scriptFile = "${project.projectDir}/deps/gradle/gradlew"
}
task djinniBuild(type: Exec) {
description = 'Building Djinni.'
inputs.files file("deps/djinni/src/source"), file("deps/djinni/src/build.sbt"), file("deps/djinni/src/project/plugins.sbt")
outputs.file file("deps/djinni/src/target")
workingDir = file("deps/djinni/src")
executable = "java"
args = [
"-Xms512M",
"-Xmx1024M",
"-Xss1M",
"-XX:+CMSClassUnloadingEnabled",
"-XX:MaxPermSize=256M",
"-Djava.security.manager",
"-Djava.security.policy=support/sbt.security.policy",
"-jar", "support/sbt-launch.jar",
"-Dsbt.override.build.repos=true",
"-Dsbt.repository.config=support/sbt.resolvers.properties",
"compile", "start-script"]
}
File temp_out = file("djinni-output-temp")
File input = file("djinni/ledgerapp.djinni")
File cpp_out = file("src/interface")
File objc_out = file("objc/gen")
File nodejs_out = file("nodejs/gen")
File jni_out = file("android/jni_gen")
File java_out = file("android/java_gen/com/ledgerapp")
File tmp_cpp_out = new File(temp_out.getPath(), "cpp")
File tmp_objc_out = new File(temp_out.getPath(), "objc")
File tmp_nodejs_out = new File(temp_out.getPath(), "nodejs")
File tmp_jni_out = new File(temp_out.getPath(), "jni")
File tmp_java_out = new File(temp_out.getPath(), "java")
task djinniGen(type: CrossPlatformExec, dependsOn: djinniBuild) {
description = 'Compiling djinni interfaces.'
inputs.dir file("djinni")
outputs.files tmp_cpp_out, tmp_objc_out, tmp_jni_out, tmp_java_out
executable = file("deps/djinni/src/target/start")
args = [
"--cpp-out", tmp_cpp_out,
"--cpp-namespace", "ledgerapp_gen",
"--ident-cpp-enum-type", "foo_bar",
"--cpp-optional-header", "\"stl.hpp\"",
"--cpp-optional-template", "std::experimental::optional",
"--objc-out", tmp_objc_out,
"--objcpp-out", tmp_objc_out,
"--objcpp-namespace", "djinni_generated",
"--objc-type-prefix", "LG",
"--java-out", tmp_java_out,
"--java-package", "com.ledgerapp",
"--ident-java-field", "mFooBar",
"--jni-out", tmp_jni_out,
"--ident-jni-class", "NativeFooBar",
"--ident-jni-file", "native_foo_bar",
"--node-out", tmp_nodejs_out,
"--node-type-prefix", "NJSItf",
"--node-include-cpp", "../../src/interface",
"--node-package", "ledgerapp_nodejs",
"--idl", input]
}
task djinniOutSyncCpp(type: Sync) {
from tmp_cpp_out
into cpp_out
}
task djinniOutSyncObjc(type: Sync) {
from tmp_objc_out
into objc_out
}
task djinniOutSyncJava(type: Sync) {
from tmp_java_out
into java_out
}
task djinniOutSyncJni(type: Sync) {
from tmp_jni_out
into jni_out
}
task djinniOutSyncNodsJS(type: Sync) {
from tmp_nodejs_out
into nodejs_out
}
task djinniOutSync(dependsOn: [djinniOutSyncCpp, djinniOutSyncObjc, djinniOutSyncJava, djinniOutSyncJni, djinniOutSyncNodsJS])
task djinni(dependsOn: [djinniGen, djinniOutSync]) {
description = "Runs djinni to generate glue code between C++ and platforms."
}
task clean(type: Delete) {
delete fileTree(dir: '.').matching { include '*.target.mk' }
delete fileTree(dir: 'deps/').matching { include '*.target.mk' }
delete (
"build/",
"deps/build/",
"djinni-output-temp/",
"build_mac/",
"build_ios/",
"obj/",
"libs/",
"GypAndroid.mk",
"test_ldb",
"test.sqlite",
"play"
)
}