@padosoft/react-native-ecr17 0.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Ecr17.podspec +39 -39
- package/README.md +348 -348
- package/android/CMakeLists.txt +41 -41
- package/android/build.gradle +148 -148
- package/android/fix-prefab.gradle +50 -50
- package/android/gradle.properties +5 -5
- package/android/src/main/AndroidManifest.xml +2 -2
- package/android/src/main/cpp/cpp-adapter.cpp +8 -8
- package/android/src/main/java/com/margelo/nitro/ecr17/HybridEcr17Transport.kt +233 -233
- package/android/src/main/java/com/padosoft/ecr17/Ecr17Package.kt +30 -30
- package/cpp/Ecr17.hpp +1 -1
- package/cpp/Ecr17Client/HybridEcr17Client.cpp +598 -598
- package/cpp/Ecr17Client/HybridEcr17Client.hpp +85 -85
- package/cpp/Ecr17Protocol/Ecr17Protocol.cpp +277 -277
- package/cpp/Ecr17Protocol/Ecr17Protocol.hpp +103 -103
- package/cpp/Ecr17Response/Ecr17Response.cpp +155 -155
- package/cpp/Ecr17Response/Ecr17Response.hpp +113 -113
- package/cpp/Lcr/Lcr.cpp +42 -42
- package/cpp/Lcr/Lcr.hpp +21 -21
- package/cpp/PacketCodec/PacketCodec.cpp +145 -145
- package/cpp/PacketCodec/PacketCodec.hpp +47 -47
- package/cpp/Session/Ecr17Session.cpp +260 -260
- package/cpp/Session/Ecr17Session.hpp +97 -97
- package/cpp/Session/RetryPolicy.hpp +23 -23
- package/cpp/Transport/FakeTransport.hpp +95 -95
- package/cpp/Transport/NativeTransportAdapter.cpp +42 -42
- package/cpp/Transport/NativeTransportAdapter.hpp +32 -32
- package/cpp/Transport/Transport.hpp +30 -30
- package/cpp/tests/CMakeLists.txt +55 -55
- package/cpp/tests/PosixTcpTransport.hpp +105 -105
- package/cpp/tests/stubs/LrcMode.hpp +25 -25
- package/cpp/tests/test_flows.cpp +148 -148
- package/cpp/tests/test_integration_terminal.cpp +72 -72
- package/cpp/tests/test_lrc.cpp +66 -66
- package/cpp/tests/test_packet_codec.cpp +164 -164
- package/cpp/tests/test_protocol.cpp +102 -102
- package/cpp/tests/test_protocol_commands.cpp +190 -190
- package/cpp/tests/test_response.cpp +164 -164
- package/cpp/tests/test_retry_policy.cpp +28 -28
- package/cpp/tests/test_session.cpp +262 -262
- package/ios/HybridEcr17Transport.swift +103 -103
- package/lib/commonjs/index.js +50 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/specs/client.nitro.js +17 -0
- package/lib/commonjs/specs/client.nitro.js.map +1 -0
- package/lib/commonjs/specs/transport.nitro.js +6 -0
- package/lib/commonjs/specs/transport.nitro.js.map +1 -0
- package/lib/commonjs/types/client.js +2 -0
- package/lib/commonjs/types/client.js.map +1 -0
- package/lib/commonjs/utils/client.js +13 -0
- package/lib/commonjs/utils/client.js.map +1 -0
- package/lib/module/index.js +7 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/specs/client.nitro.js +13 -0
- package/lib/module/specs/client.nitro.js.map +1 -0
- package/lib/module/specs/transport.nitro.js +4 -0
- package/lib/module/specs/transport.nitro.js.map +1 -0
- package/lib/module/types/client.js +2 -0
- package/lib/module/types/client.js.map +1 -0
- package/lib/module/utils/client.js +9 -0
- package/lib/module/utils/client.js.map +1 -0
- package/lib/typescript/src/index.d.ts +5 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/specs/client.nitro.d.ts +63 -0
- package/lib/typescript/src/specs/client.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/transport.nitro.d.ts +13 -0
- package/lib/typescript/src/specs/transport.nitro.d.ts.map +1 -0
- package/lib/typescript/src/types/client.d.ts +138 -0
- package/lib/typescript/src/types/client.d.ts.map +1 -0
- package/lib/typescript/src/utils/client.d.ts +3 -0
- package/lib/typescript/src/utils/client.d.ts.map +1 -0
- package/nitro.json +30 -30
- package/package.json +4 -4
- package/react-native.config.js +18 -18
- package/src/index.ts +4 -4
- package/src/specs/client.nitro.ts +102 -102
- package/src/specs/transport.nitro.ts +25 -25
- package/src/types/client.ts +196 -196
- package/src/utils/client.ts +10 -10
package/android/CMakeLists.txt
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
project(Ecr17)
|
|
2
|
-
cmake_minimum_required(VERSION 3.9.0)
|
|
3
|
-
|
|
4
|
-
set (PACKAGE_NAME Ecr17)
|
|
5
|
-
set (CMAKE_VERBOSE_MAKEFILE ON)
|
|
6
|
-
set (CMAKE_CXX_STANDARD 20)
|
|
7
|
-
|
|
8
|
-
# Enable Raw Props parsing in react-native (for Nitro Views)
|
|
9
|
-
add_compile_options(-DRN_SERIALIZABLE_STATE=1)
|
|
10
|
-
|
|
11
|
-
# Define C++ library and add all sources
|
|
12
|
-
add_library(${PACKAGE_NAME} SHARED
|
|
13
|
-
src/main/cpp/cpp-adapter.cpp
|
|
14
|
-
../cpp/Ecr17.cpp
|
|
15
|
-
../cpp/Ecr17Client/HybridEcr17Client.cpp
|
|
16
|
-
../cpp/Ecr17Protocol/Ecr17Protocol.cpp
|
|
17
|
-
../cpp/Ecr17Response/Ecr17Response.cpp
|
|
18
|
-
../cpp/Lcr/Lcr.cpp
|
|
19
|
-
../cpp/PacketCodec/PacketCodec.cpp
|
|
20
|
-
../cpp/Session/Ecr17Session.cpp
|
|
21
|
-
../cpp/Transport/NativeTransportAdapter.cpp
|
|
22
|
-
)
|
|
23
|
-
|
|
24
|
-
# Add Nitrogen specs :)
|
|
25
|
-
include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/Ecr17+autolinking.cmake)
|
|
26
|
-
|
|
27
|
-
# Set up local includes
|
|
28
|
-
include_directories(
|
|
29
|
-
"src/main/cpp"
|
|
30
|
-
"../cpp"
|
|
31
|
-
"../cpp/Ecr17Client" # generated Ecr17OnLoad.cpp does a flat #include "HybridEcr17Client.hpp"
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
find_library(LOG_LIB log)
|
|
35
|
-
|
|
36
|
-
# Link all libraries together
|
|
37
|
-
target_link_libraries(
|
|
38
|
-
${PACKAGE_NAME}
|
|
39
|
-
${LOG_LIB}
|
|
40
|
-
android # <-- Android core
|
|
41
|
-
)
|
|
1
|
+
project(Ecr17)
|
|
2
|
+
cmake_minimum_required(VERSION 3.9.0)
|
|
3
|
+
|
|
4
|
+
set (PACKAGE_NAME Ecr17)
|
|
5
|
+
set (CMAKE_VERBOSE_MAKEFILE ON)
|
|
6
|
+
set (CMAKE_CXX_STANDARD 20)
|
|
7
|
+
|
|
8
|
+
# Enable Raw Props parsing in react-native (for Nitro Views)
|
|
9
|
+
add_compile_options(-DRN_SERIALIZABLE_STATE=1)
|
|
10
|
+
|
|
11
|
+
# Define C++ library and add all sources
|
|
12
|
+
add_library(${PACKAGE_NAME} SHARED
|
|
13
|
+
src/main/cpp/cpp-adapter.cpp
|
|
14
|
+
../cpp/Ecr17.cpp
|
|
15
|
+
../cpp/Ecr17Client/HybridEcr17Client.cpp
|
|
16
|
+
../cpp/Ecr17Protocol/Ecr17Protocol.cpp
|
|
17
|
+
../cpp/Ecr17Response/Ecr17Response.cpp
|
|
18
|
+
../cpp/Lcr/Lcr.cpp
|
|
19
|
+
../cpp/PacketCodec/PacketCodec.cpp
|
|
20
|
+
../cpp/Session/Ecr17Session.cpp
|
|
21
|
+
../cpp/Transport/NativeTransportAdapter.cpp
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
# Add Nitrogen specs :)
|
|
25
|
+
include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/Ecr17+autolinking.cmake)
|
|
26
|
+
|
|
27
|
+
# Set up local includes
|
|
28
|
+
include_directories(
|
|
29
|
+
"src/main/cpp"
|
|
30
|
+
"../cpp"
|
|
31
|
+
"../cpp/Ecr17Client" # generated Ecr17OnLoad.cpp does a flat #include "HybridEcr17Client.hpp"
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
find_library(LOG_LIB log)
|
|
35
|
+
|
|
36
|
+
# Link all libraries together
|
|
37
|
+
target_link_libraries(
|
|
38
|
+
${PACKAGE_NAME}
|
|
39
|
+
${LOG_LIB}
|
|
40
|
+
android # <-- Android core
|
|
41
|
+
)
|
package/android/build.gradle
CHANGED
|
@@ -1,149 +1,149 @@
|
|
|
1
|
-
buildscript {
|
|
2
|
-
repositories {
|
|
3
|
-
google()
|
|
4
|
-
mavenCentral()
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
dependencies {
|
|
8
|
-
classpath "com.android.tools.build:gradle:9.2.1"
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
def reactNativeArchitectures() {
|
|
13
|
-
def value = rootProject.getProperties().get("reactNativeArchitectures")
|
|
14
|
-
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
def isNewArchitectureEnabled() {
|
|
18
|
-
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
apply plugin: "com.android.library"
|
|
22
|
-
apply plugin: 'org.jetbrains.kotlin.android'
|
|
23
|
-
apply from: '../nitrogen/generated/android/Ecr17+autolinking.gradle'
|
|
24
|
-
apply from: "./fix-prefab.gradle"
|
|
25
|
-
|
|
26
|
-
if (isNewArchitectureEnabled()) {
|
|
27
|
-
apply plugin: "com.facebook.react"
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
def getExtOrDefault(name) {
|
|
31
|
-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["Ecr17_" + name]
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
def getExtOrIntegerDefault(name) {
|
|
35
|
-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["Ecr17_" + name]).toInteger()
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
android {
|
|
39
|
-
namespace "com.padosoft.ecr17"
|
|
40
|
-
|
|
41
|
-
ndkVersion getExtOrDefault("ndkVersion")
|
|
42
|
-
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
|
43
|
-
|
|
44
|
-
defaultConfig {
|
|
45
|
-
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
46
|
-
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
47
|
-
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
|
48
|
-
|
|
49
|
-
externalNativeBuild {
|
|
50
|
-
cmake {
|
|
51
|
-
cppFlags "-frtti -fexceptions -Wall -Wextra -fstack-protector-all"
|
|
52
|
-
arguments "-DANDROID_STL=c++_shared", "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON"
|
|
53
|
-
abiFilters (*reactNativeArchitectures())
|
|
54
|
-
|
|
55
|
-
buildTypes {
|
|
56
|
-
debug {
|
|
57
|
-
cppFlags "-O1 -g"
|
|
58
|
-
}
|
|
59
|
-
release {
|
|
60
|
-
cppFlags "-O2"
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
externalNativeBuild {
|
|
68
|
-
cmake {
|
|
69
|
-
path "CMakeLists.txt"
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
packagingOptions {
|
|
74
|
-
excludes = [
|
|
75
|
-
"META-INF",
|
|
76
|
-
"META-INF/**",
|
|
77
|
-
"**/libc++_shared.so",
|
|
78
|
-
"**/libNitroModules.so",
|
|
79
|
-
"**/libfbjni.so",
|
|
80
|
-
"**/libjsi.so",
|
|
81
|
-
"**/libfolly_json.so",
|
|
82
|
-
"**/libfolly_runtime.so",
|
|
83
|
-
"**/libglog.so",
|
|
84
|
-
"**/libhermes.so",
|
|
85
|
-
"**/libhermes-executor-debug.so",
|
|
86
|
-
"**/libhermes_executor.so",
|
|
87
|
-
"**/libreactnative.so",
|
|
88
|
-
"**/libreactnativejni.so",
|
|
89
|
-
"**/libturbomodulejsijni.so",
|
|
90
|
-
"**/libreact_nativemodule_core.so",
|
|
91
|
-
"**/libjscexecutor.so"
|
|
92
|
-
]
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
buildFeatures {
|
|
96
|
-
buildConfig true
|
|
97
|
-
prefab true
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
buildTypes {
|
|
101
|
-
release {
|
|
102
|
-
minifyEnabled false
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
lintOptions {
|
|
107
|
-
disable "GradleCompatible"
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
compileOptions {
|
|
111
|
-
sourceCompatibility JavaVersion.VERSION_1_8
|
|
112
|
-
targetCompatibility JavaVersion.VERSION_1_8
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
sourceSets {
|
|
116
|
-
main {
|
|
117
|
-
if (isNewArchitectureEnabled()) {
|
|
118
|
-
java.srcDirs += [
|
|
119
|
-
// React Codegen files
|
|
120
|
-
"${project.buildDir}/generated/source/codegen/java"
|
|
121
|
-
]
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
repositories {
|
|
128
|
-
mavenCentral()
|
|
129
|
-
google()
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
dependencies {
|
|
134
|
-
// For < 0.71, this will be from the local maven repo
|
|
135
|
-
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
|
|
136
|
-
//noinspection GradleDynamicVersion
|
|
137
|
-
implementation "com.facebook.react:react-native:+"
|
|
138
|
-
|
|
139
|
-
// Add a dependency on NitroModules
|
|
140
|
-
implementation project(":react-native-nitro-modules")
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if (isNewArchitectureEnabled()) {
|
|
144
|
-
react {
|
|
145
|
-
jsRootDir = file("../src/")
|
|
146
|
-
libraryName = "Ecr17"
|
|
147
|
-
codegenJavaPackageName = "com.padosoft.ecr17"
|
|
148
|
-
}
|
|
1
|
+
buildscript {
|
|
2
|
+
repositories {
|
|
3
|
+
google()
|
|
4
|
+
mavenCentral()
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
dependencies {
|
|
8
|
+
classpath "com.android.tools.build:gradle:9.2.1"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
def reactNativeArchitectures() {
|
|
13
|
+
def value = rootProject.getProperties().get("reactNativeArchitectures")
|
|
14
|
+
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
def isNewArchitectureEnabled() {
|
|
18
|
+
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
apply plugin: "com.android.library"
|
|
22
|
+
apply plugin: 'org.jetbrains.kotlin.android'
|
|
23
|
+
apply from: '../nitrogen/generated/android/Ecr17+autolinking.gradle'
|
|
24
|
+
apply from: "./fix-prefab.gradle"
|
|
25
|
+
|
|
26
|
+
if (isNewArchitectureEnabled()) {
|
|
27
|
+
apply plugin: "com.facebook.react"
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
def getExtOrDefault(name) {
|
|
31
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["Ecr17_" + name]
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
def getExtOrIntegerDefault(name) {
|
|
35
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["Ecr17_" + name]).toInteger()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
android {
|
|
39
|
+
namespace "com.padosoft.ecr17"
|
|
40
|
+
|
|
41
|
+
ndkVersion getExtOrDefault("ndkVersion")
|
|
42
|
+
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
|
43
|
+
|
|
44
|
+
defaultConfig {
|
|
45
|
+
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
46
|
+
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
47
|
+
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
|
48
|
+
|
|
49
|
+
externalNativeBuild {
|
|
50
|
+
cmake {
|
|
51
|
+
cppFlags "-frtti -fexceptions -Wall -Wextra -fstack-protector-all"
|
|
52
|
+
arguments "-DANDROID_STL=c++_shared", "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON"
|
|
53
|
+
abiFilters (*reactNativeArchitectures())
|
|
54
|
+
|
|
55
|
+
buildTypes {
|
|
56
|
+
debug {
|
|
57
|
+
cppFlags "-O1 -g"
|
|
58
|
+
}
|
|
59
|
+
release {
|
|
60
|
+
cppFlags "-O2"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
externalNativeBuild {
|
|
68
|
+
cmake {
|
|
69
|
+
path "CMakeLists.txt"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
packagingOptions {
|
|
74
|
+
excludes = [
|
|
75
|
+
"META-INF",
|
|
76
|
+
"META-INF/**",
|
|
77
|
+
"**/libc++_shared.so",
|
|
78
|
+
"**/libNitroModules.so",
|
|
79
|
+
"**/libfbjni.so",
|
|
80
|
+
"**/libjsi.so",
|
|
81
|
+
"**/libfolly_json.so",
|
|
82
|
+
"**/libfolly_runtime.so",
|
|
83
|
+
"**/libglog.so",
|
|
84
|
+
"**/libhermes.so",
|
|
85
|
+
"**/libhermes-executor-debug.so",
|
|
86
|
+
"**/libhermes_executor.so",
|
|
87
|
+
"**/libreactnative.so",
|
|
88
|
+
"**/libreactnativejni.so",
|
|
89
|
+
"**/libturbomodulejsijni.so",
|
|
90
|
+
"**/libreact_nativemodule_core.so",
|
|
91
|
+
"**/libjscexecutor.so"
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
buildFeatures {
|
|
96
|
+
buildConfig true
|
|
97
|
+
prefab true
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
buildTypes {
|
|
101
|
+
release {
|
|
102
|
+
minifyEnabled false
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
lintOptions {
|
|
107
|
+
disable "GradleCompatible"
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
compileOptions {
|
|
111
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
112
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
sourceSets {
|
|
116
|
+
main {
|
|
117
|
+
if (isNewArchitectureEnabled()) {
|
|
118
|
+
java.srcDirs += [
|
|
119
|
+
// React Codegen files
|
|
120
|
+
"${project.buildDir}/generated/source/codegen/java"
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
repositories {
|
|
128
|
+
mavenCentral()
|
|
129
|
+
google()
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
dependencies {
|
|
134
|
+
// For < 0.71, this will be from the local maven repo
|
|
135
|
+
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
|
|
136
|
+
//noinspection GradleDynamicVersion
|
|
137
|
+
implementation "com.facebook.react:react-native:+"
|
|
138
|
+
|
|
139
|
+
// Add a dependency on NitroModules
|
|
140
|
+
implementation project(":react-native-nitro-modules")
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (isNewArchitectureEnabled()) {
|
|
144
|
+
react {
|
|
145
|
+
jsRootDir = file("../src/")
|
|
146
|
+
libraryName = "Ecr17"
|
|
147
|
+
codegenJavaPackageName = "com.padosoft.ecr17"
|
|
148
|
+
}
|
|
149
149
|
}
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
tasks.configureEach { task ->
|
|
2
|
-
// Make sure that we generate our prefab publication file only after having built the native library
|
|
3
|
-
// so that not a header publication file, but a full configuration publication will be generated, which
|
|
4
|
-
// will include the .so file
|
|
5
|
-
|
|
6
|
-
def prefabConfigurePattern = ~/^prefab(.+)ConfigurePackage$/
|
|
7
|
-
def matcher = task.name =~ prefabConfigurePattern
|
|
8
|
-
if (matcher.matches()) {
|
|
9
|
-
def variantName = matcher[0][1]
|
|
10
|
-
task.outputs.upToDateWhen { false }
|
|
11
|
-
task.dependsOn("externalNativeBuild${variantName}")
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
afterEvaluate {
|
|
16
|
-
def abis = reactNativeArchitectures()
|
|
17
|
-
rootProject.allprojects.each { proj ->
|
|
18
|
-
if (proj === rootProject) return
|
|
19
|
-
|
|
20
|
-
def dependsOnThisLib = proj.configurations.findAll { it.canBeResolved }.any { config ->
|
|
21
|
-
config.dependencies.any { dep ->
|
|
22
|
-
dep.group == project.group && dep.name == project.name
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
if (!dependsOnThisLib && proj != project) return
|
|
26
|
-
|
|
27
|
-
if (!proj.plugins.hasPlugin('com.android.application') && !proj.plugins.hasPlugin('com.android.library')) {
|
|
28
|
-
return
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
def variants = proj.android.hasProperty('applicationVariants') ? proj.android.applicationVariants : proj.android.libraryVariants
|
|
32
|
-
// Touch the prefab_config.json files to ensure that in ExternalNativeJsonGenerator.kt we will re-trigger the prefab CLI to
|
|
33
|
-
// generate a libnameConfig.cmake file that will contain our native library (.so).
|
|
34
|
-
// See this condition: https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:build-system/gradle-core/src/main/java/com/android/build/gradle/tasks/ExternalNativeJsonGenerator.kt;l=207-219?q=createPrefabBuildSystemGlue
|
|
35
|
-
variants.all { variant ->
|
|
36
|
-
def variantName = variant.name
|
|
37
|
-
abis.each { abi ->
|
|
38
|
-
def searchDir = new File(proj.projectDir, ".cxx/${variantName}")
|
|
39
|
-
if (!searchDir.exists()) return
|
|
40
|
-
def matches = []
|
|
41
|
-
searchDir.eachDir { randomDir ->
|
|
42
|
-
def prefabFile = new File(randomDir, "${abi}/prefab_config.json")
|
|
43
|
-
if (prefabFile.exists()) matches << prefabFile
|
|
44
|
-
}
|
|
45
|
-
matches.each { prefabConfig ->
|
|
46
|
-
prefabConfig.setLastModified(System.currentTimeMillis())
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
1
|
+
tasks.configureEach { task ->
|
|
2
|
+
// Make sure that we generate our prefab publication file only after having built the native library
|
|
3
|
+
// so that not a header publication file, but a full configuration publication will be generated, which
|
|
4
|
+
// will include the .so file
|
|
5
|
+
|
|
6
|
+
def prefabConfigurePattern = ~/^prefab(.+)ConfigurePackage$/
|
|
7
|
+
def matcher = task.name =~ prefabConfigurePattern
|
|
8
|
+
if (matcher.matches()) {
|
|
9
|
+
def variantName = matcher[0][1]
|
|
10
|
+
task.outputs.upToDateWhen { false }
|
|
11
|
+
task.dependsOn("externalNativeBuild${variantName}")
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
afterEvaluate {
|
|
16
|
+
def abis = reactNativeArchitectures()
|
|
17
|
+
rootProject.allprojects.each { proj ->
|
|
18
|
+
if (proj === rootProject) return
|
|
19
|
+
|
|
20
|
+
def dependsOnThisLib = proj.configurations.findAll { it.canBeResolved }.any { config ->
|
|
21
|
+
config.dependencies.any { dep ->
|
|
22
|
+
dep.group == project.group && dep.name == project.name
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (!dependsOnThisLib && proj != project) return
|
|
26
|
+
|
|
27
|
+
if (!proj.plugins.hasPlugin('com.android.application') && !proj.plugins.hasPlugin('com.android.library')) {
|
|
28
|
+
return
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
def variants = proj.android.hasProperty('applicationVariants') ? proj.android.applicationVariants : proj.android.libraryVariants
|
|
32
|
+
// Touch the prefab_config.json files to ensure that in ExternalNativeJsonGenerator.kt we will re-trigger the prefab CLI to
|
|
33
|
+
// generate a libnameConfig.cmake file that will contain our native library (.so).
|
|
34
|
+
// See this condition: https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:build-system/gradle-core/src/main/java/com/android/build/gradle/tasks/ExternalNativeJsonGenerator.kt;l=207-219?q=createPrefabBuildSystemGlue
|
|
35
|
+
variants.all { variant ->
|
|
36
|
+
def variantName = variant.name
|
|
37
|
+
abis.each { abi ->
|
|
38
|
+
def searchDir = new File(proj.projectDir, ".cxx/${variantName}")
|
|
39
|
+
if (!searchDir.exists()) return
|
|
40
|
+
def matches = []
|
|
41
|
+
searchDir.eachDir { randomDir ->
|
|
42
|
+
def prefabFile = new File(randomDir, "${abi}/prefab_config.json")
|
|
43
|
+
if (prefabFile.exists()) matches << prefabFile
|
|
44
|
+
}
|
|
45
|
+
matches.each { prefabConfig ->
|
|
46
|
+
prefabConfig.setLastModified(System.currentTimeMillis())
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
51
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
Ecr17_kotlinVersion=2.1.21
|
|
2
|
-
Ecr17_minSdkVersion=23
|
|
3
|
-
Ecr17_targetSdkVersion=36
|
|
4
|
-
Ecr17_compileSdkVersion=36
|
|
5
|
-
Ecr17_ndkVersion=29.0.14206865
|
|
1
|
+
Ecr17_kotlinVersion=2.1.21
|
|
2
|
+
Ecr17_minSdkVersion=23
|
|
3
|
+
Ecr17_targetSdkVersion=36
|
|
4
|
+
Ecr17_compileSdkVersion=36
|
|
5
|
+
Ecr17_ndkVersion=29.0.14206865
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
2
|
-
</manifest>
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
2
|
+
</manifest>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
#include <jni.h>
|
|
2
|
-
#include <fbjni/fbjni.h>
|
|
3
|
-
#include "Ecr17OnLoad.hpp"
|
|
4
|
-
|
|
5
|
-
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
|
|
6
|
-
return facebook::jni::initialize(vm, []() {
|
|
7
|
-
margelo::nitro::ecr17::registerAllNatives();
|
|
8
|
-
});
|
|
1
|
+
#include <jni.h>
|
|
2
|
+
#include <fbjni/fbjni.h>
|
|
3
|
+
#include "Ecr17OnLoad.hpp"
|
|
4
|
+
|
|
5
|
+
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
|
|
6
|
+
return facebook::jni::initialize(vm, []() {
|
|
7
|
+
margelo::nitro::ecr17::registerAllNatives();
|
|
8
|
+
});
|
|
9
9
|
}
|