Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
103 lines (93 loc) · 2.78 KB
/
Copy pathbuild.gradle
File metadata and controls
103 lines (93 loc) · 2.78 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
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
plugins {
id 'com.android.application'
}
def jsEngine = "V8"
if (project.hasProperty("jsEngine")) {
jsEngine = project.property("jsEngine")
}
android {
namespace 'com.jsruntimehost.unittests'
compileSdk 33
ndkVersion = "23.1.7779620"
if (project.hasProperty("ndkVersion")) {
ndkVersion = project.property("ndkVersion")
}
defaultConfig {
applicationId "com.jsruntimehost.unittests"
minSdk 21
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
arguments (
"-DANDROID_STL=c++_shared",
"-DNAPI_JAVASCRIPT_ENGINE=${jsEngine}",
"-DJSRUNTIMEHOST_CORE_APPRUNTIME_V8_INSPECTOR=ON"
)
}
}
if (project.hasProperty("abiFilters")) {
ndk {
abiFilters project.getProperty("abiFilters")
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
externalNativeBuild {
cmake {
path file('src/main/cpp/CMakeLists.txt')
buildStagingDirectory '../../../../Build/Android'
version '3.22.1+'
}
}
buildFeatures {
viewBinding true
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.6.0'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation group: 'org.java-websocket', name: 'Java-WebSocket', version: '1.5.3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}
task copyScripts {
doLast {
// run copy at execution phase because npm command is not done at configuration phase
copy
{
from '../../dist'
include "*.js"
into 'src/main/assets/Scripts'
}
copy
{
from '../../Scripts'
include "*.js"
into 'src/main/assets/Scripts'
}
}
}
// Run copyScripts task after CMake external build
// And make sure merging assets into output is performed after the scripts copy
tasks.configureEach { task ->
if (task.name == 'mergeDebugNativeLibs') {
task.finalizedBy(copyScripts)
}
if (task.name == 'mergeDebugAssets') {
task.dependsOn(copyScripts)
}
}