react-native-tvos 0.64.2-1 → 0.64.2-5

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.
Files changed (66) hide show
  1. package/Libraries/Components/AppleTV/TVFocusGuideView.js +24 -1
  2. package/Libraries/Components/Pressable/Pressable.js +4 -4
  3. package/Libraries/Components/StatusBar/NativeStatusBarManagerIOS.js +14 -8
  4. package/Libraries/Components/Touchable/TouchableHighlight.js +1 -1
  5. package/Libraries/NewAppScreen/components/HermesBadge.js +39 -12
  6. package/README.md +8 -2
  7. package/React/Base/RCTRootView.m +5 -35
  8. package/React/Base/RCTTVRemoteHandler.h +5 -2
  9. package/React/Base/RCTTVRemoteHandler.m +173 -70
  10. package/React/Modules/RCTTVMenuBridge.m +3 -0
  11. package/React/Views/RCTModalHostView.m +6 -9
  12. package/React/Views/RCTTVFocusGuideView.m +1 -1
  13. package/ReactAndroid/gradle.properties +1 -1
  14. package/ReactAndroid/src/androidTest/assets/AndroidTestBundle.js +47 -24
  15. package/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +10 -9
  16. package/ReactAndroid/src/main/java/com/facebook/react/modules/core/ReactAndroidHWInputDeviceHelper.java +133 -0
  17. package/ReactAndroid/src/main/java/com/facebook/react/views/modal/BUCK +1 -0
  18. package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.java +21 -0
  19. package/ReactCommon/hermes/inspector/tools/msggen/yarn.lock +3 -3
  20. package/ReactCommon/react/renderer/components/rncore/ComponentDescriptors.h +32 -0
  21. package/ReactCommon/react/renderer/components/rncore/ComponentDescriptors.h.bak +32 -0
  22. package/ReactCommon/react/renderer/components/rncore/EventEmitters.cpp +149 -0
  23. package/ReactCommon/react/renderer/components/rncore/EventEmitters.cpp.bak +149 -0
  24. package/ReactCommon/react/renderer/components/rncore/EventEmitters.h +237 -0
  25. package/ReactCommon/react/renderer/components/rncore/EventEmitters.h.bak +237 -0
  26. package/ReactCommon/react/renderer/components/rncore/Props.cpp +218 -0
  27. package/ReactCommon/react/renderer/components/rncore/Props.cpp.bak +218 -0
  28. package/ReactCommon/react/renderer/components/rncore/Props.h +576 -0
  29. package/ReactCommon/react/renderer/components/rncore/Props.h.bak +576 -0
  30. package/ReactCommon/react/renderer/components/rncore/RCTComponentViewHelpers.h +273 -0
  31. package/ReactCommon/react/renderer/components/rncore/RCTComponentViewHelpers.h.bak +273 -0
  32. package/ReactCommon/react/renderer/components/rncore/ShadowNodes.cpp +29 -0
  33. package/ReactCommon/react/renderer/components/rncore/ShadowNodes.cpp.bak +29 -0
  34. package/ReactCommon/react/renderer/components/rncore/ShadowNodes.h +126 -0
  35. package/ReactCommon/react/renderer/components/rncore/ShadowNodes.h.bak +126 -0
  36. package/android/com/facebook/react/react-native/{0.64.2-1/react-native-0.64.2-1-sources.jar → 0.64.2-5/react-native-0.64.2-5-sources.jar} +0 -0
  37. package/android/com/facebook/react/react-native/0.64.2-5/react-native-0.64.2-5-sources.jar.md5 +1 -0
  38. package/android/com/facebook/react/react-native/0.64.2-5/react-native-0.64.2-5-sources.jar.sha1 +1 -0
  39. package/android/com/facebook/react/react-native/0.64.2-5/react-native-0.64.2-5.aar +0 -0
  40. package/android/com/facebook/react/react-native/0.64.2-5/react-native-0.64.2-5.aar.md5 +1 -0
  41. package/android/com/facebook/react/react-native/0.64.2-5/react-native-0.64.2-5.aar.sha1 +1 -0
  42. package/android/com/facebook/react/react-native/{0.64.2-1/react-native-0.64.2-1.pom → 0.64.2-5/react-native-0.64.2-5.pom} +1 -1
  43. package/android/com/facebook/react/react-native/0.64.2-5/react-native-0.64.2-5.pom.md5 +1 -0
  44. package/android/com/facebook/react/react-native/0.64.2-5/react-native-0.64.2-5.pom.sha1 +1 -0
  45. package/android/com/facebook/react/react-native/maven-metadata.xml +3 -3
  46. package/android/com/facebook/react/react-native/maven-metadata.xml.md5 +1 -1
  47. package/android/com/facebook/react/react-native/maven-metadata.xml.sha1 +1 -1
  48. package/local-cli/cli.js +0 -0
  49. package/package.json +1 -1
  50. package/template/App.js +1 -2
  51. package/template/ios/HelloWorld.xcodeproj/project.pbxproj.rej +1034 -0
  52. package/template/package.json +1 -1
  53. package/Libraries/.npmignore +0 -1
  54. package/ReactAndroid/.npmignore +0 -3
  55. package/ReactAndroid/build.gradle.orig +0 -479
  56. package/ReactAndroid/src/main/java/com/facebook/react/ReactAndroidHWInputDeviceHelper.java +0 -98
  57. package/ReactAndroid/src/main/jni/first-party/fbjni/.gitignore +0 -2
  58. package/ReactCommon/hermes/inspector/tools/msggen/.gitignore +0 -3
  59. package/android/com/facebook/react/react-native/0.64.2-1/react-native-0.64.2-1-sources.jar.md5 +0 -1
  60. package/android/com/facebook/react/react-native/0.64.2-1/react-native-0.64.2-1-sources.jar.sha1 +0 -1
  61. package/android/com/facebook/react/react-native/0.64.2-1/react-native-0.64.2-1.aar +0 -0
  62. package/android/com/facebook/react/react-native/0.64.2-1/react-native-0.64.2-1.aar.md5 +0 -1
  63. package/android/com/facebook/react/react-native/0.64.2-1/react-native-0.64.2-1.aar.sha1 +0 -1
  64. package/android/com/facebook/react/react-native/0.64.2-1/react-native-0.64.2-1.pom.md5 +0 -1
  65. package/android/com/facebook/react/react-native/0.64.2-1/react-native-0.64.2-1.pom.sha1 +0 -1
  66. package/third-party-podspecs/hermes-engine.podspec +0 -45
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "react": "17.0.1",
14
- "react-native": "npm:react-native-tvos@0.64.2-1"
14
+ "react-native": "npm:react-native-tvos@0.64.2-5"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@babel/core": "^7.12.9",
@@ -1 +0,0 @@
1
- __tests__
@@ -1,3 +0,0 @@
1
- # Make sure we never publish ReactAndroid/build (Gradle output) to npm.
2
- # The folder is huge (> 100MB)!
3
- build/
@@ -1,479 +0,0 @@
1
- /*
2
- * Copyright (c) Facebook, Inc. and its affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- plugins {
9
- id("com.android.library")
10
- id("com.facebook.react.codegen")
11
- id("maven")
12
- id("de.undercouch.download")
13
- }
14
-
15
- import java.nio.file.Paths
16
-
17
- import de.undercouch.gradle.tasks.download.Download
18
- import org.apache.tools.ant.taskdefs.condition.Os
19
- import org.apache.tools.ant.filters.ReplaceTokens
20
-
21
- // We download various C++ open-source dependencies into downloads.
22
- // We then copy both the downloaded code and our custom makefiles and headers into third-party-ndk.
23
- // After that we build native code from src/main/jni with module path pointing at third-party-ndk.
24
-
25
- def customDownloadsDir = System.getenv("REACT_NATIVE_DOWNLOADS_DIR")
26
- def downloadsDir = customDownloadsDir ? new File(customDownloadsDir) : new File("$buildDir/downloads")
27
- def thirdPartyNdkDir = new File("$buildDir/third-party-ndk")
28
-
29
- // You need to have following folders in this directory:
30
- // - boost_1_63_0
31
- // - double-conversion-1.1.6
32
- // - folly-deprecate-dynamic-initializer
33
- // - glog-0.3.5
34
- def dependenciesPath = System.getenv("REACT_NATIVE_DEPENDENCIES")
35
-
36
- // The 'USE_FABRIC' environment variable will build Fabric C++ code into the bundle
37
- // USE_FABRIC=0 will build RN excluding fabric
38
- // USE_FABRIC=1 will build RN including fabric
39
- def enableFabric = (System.getenv('USE_FABRIC') ?: '0').toBoolean()
40
-
41
- // The Boost library is a very large download (>100MB).
42
- // If Boost is already present on your system, define the REACT_NATIVE_BOOST_PATH env variable
43
- // and the build will use that.
44
- def boostPath = dependenciesPath ?: System.getenv("REACT_NATIVE_BOOST_PATH")
45
-
46
- // Setup build type for NDK, supported values: {debug, release}
47
- def nativeBuildType = System.getenv("NATIVE_BUILD_TYPE") ?: "release"
48
-
49
- task createNativeDepsDirectories {
50
- downloadsDir.mkdirs()
51
- thirdPartyNdkDir.mkdirs()
52
- }
53
-
54
- task downloadBoost(dependsOn: createNativeDepsDirectories, type: Download) {
55
- src("https://github.com/react-native-community/boost-for-react-native/releases/download/v${BOOST_VERSION.replace("_", ".")}-0/boost_${BOOST_VERSION}.tar.gz")
56
- onlyIfNewer(true)
57
- overwrite(false)
58
- dest(new File(downloadsDir, "boost_${BOOST_VERSION}.tar.gz"))
59
- }
60
-
61
- task prepareBoost(dependsOn: boostPath ? [] : [downloadBoost], type: Copy) {
62
- from(boostPath ?: tarTree(resources.gzip(downloadBoost.dest)))
63
- from("src/main/jni/third-party/boost/Android.mk")
64
- include("Android.mk", "boost_${BOOST_VERSION}/boost/**/*.hpp", "boost/boost/**/*.hpp")
65
- includeEmptyDirs = false
66
- into("$thirdPartyNdkDir/boost")
67
- doLast {
68
- file("$thirdPartyNdkDir/boost/boost").renameTo("$thirdPartyNdkDir/boost/boost_${BOOST_VERSION}")
69
- }
70
- }
71
-
72
- task downloadDoubleConversion(dependsOn: createNativeDepsDirectories, type: Download) {
73
- src("https://github.com/google/double-conversion/archive/v${DOUBLE_CONVERSION_VERSION}.tar.gz")
74
- onlyIfNewer(true)
75
- overwrite(false)
76
- dest(new File(downloadsDir, "double-conversion-${DOUBLE_CONVERSION_VERSION}.tar.gz"))
77
- }
78
-
79
- task prepareDoubleConversion(dependsOn: dependenciesPath ? [] : [downloadDoubleConversion], type: Copy) {
80
- from(dependenciesPath ?: tarTree(downloadDoubleConversion.dest))
81
- from("src/main/jni/third-party/double-conversion/Android.mk")
82
- include("double-conversion-${DOUBLE_CONVERSION_VERSION}/src/**/*", "Android.mk")
83
- filesMatching("*/src/**/*", { fname -> fname.path = "double-conversion/${fname.name}" })
84
- includeEmptyDirs = false
85
- into("$thirdPartyNdkDir/double-conversion")
86
- }
87
-
88
- task downloadFolly(dependsOn: createNativeDepsDirectories, type: Download) {
89
- src("https://github.com/facebook/folly/archive/v${FOLLY_VERSION}.tar.gz")
90
- onlyIfNewer(true)
91
- overwrite(false)
92
- dest(new File(downloadsDir, "folly-${FOLLY_VERSION}.tar.gz"))
93
- }
94
-
95
- task prepareFolly(dependsOn: dependenciesPath ? [] : [downloadFolly], type: Copy) {
96
- from(dependenciesPath ?: tarTree(downloadFolly.dest))
97
- from("src/main/jni/third-party/folly/Android.mk")
98
- include("folly-${FOLLY_VERSION}/folly/**/*", "Android.mk")
99
- eachFile { fname -> fname.path = (fname.path - "folly-${FOLLY_VERSION}/") }
100
- includeEmptyDirs = false
101
- into("$thirdPartyNdkDir/folly")
102
- }
103
-
104
- task prepareHermes(dependsOn: createNativeDepsDirectories, type: Copy) {
105
- def hermesPackagePath = findNodeModulePath(projectDir, "hermes-engine")
106
- if (!hermesPackagePath) {
107
- throw new GradleScriptException("Could not find the hermes-engine npm package", null)
108
- }
109
-
110
- def hermesAAR = file("$hermesPackagePath/android/hermes-debug.aar")
111
- if (!hermesAAR.exists()) {
112
- throw new GradleScriptException("The hermes-engine npm package is missing \"android/hermes-debug.aar\"", null)
113
- }
114
-
115
- def soFiles = zipTree(hermesAAR).matching({ it.include "**/*.so" })
116
-
117
- from soFiles
118
- from "src/main/jni/first-party/hermes/Android.mk"
119
- into "$thirdPartyNdkDir/hermes"
120
- }
121
-
122
- task downloadGlog(dependsOn: createNativeDepsDirectories, type: Download) {
123
- src("https://github.com/google/glog/archive/v${GLOG_VERSION}.tar.gz")
124
- onlyIfNewer(true)
125
- overwrite(false)
126
- dest(new File(downloadsDir, "glog-${GLOG_VERSION}.tar.gz"))
127
- }
128
-
129
- // Prepare glog sources to be compiled, this task will perform steps that normally should've been
130
- // executed by automake. This way we can avoid dependencies on make/automake
131
- task prepareGlog(dependsOn: dependenciesPath ? [] : [downloadGlog], type: Copy) {
132
- from(dependenciesPath ?: tarTree(downloadGlog.dest))
133
- from("src/main/jni/third-party/glog/")
134
- include("glog-${GLOG_VERSION}/src/**/*", "Android.mk", "config.h")
135
- includeEmptyDirs = false
136
- filesMatching("**/*.h.in") {
137
- filter(ReplaceTokens, tokens: [
138
- ac_cv_have_unistd_h : "1",
139
- ac_cv_have_stdint_h : "1",
140
- ac_cv_have_systypes_h : "1",
141
- ac_cv_have_inttypes_h : "1",
142
- ac_cv_have_libgflags : "0",
143
- ac_google_start_namespace : "namespace google {",
144
- ac_cv_have_uint16_t : "1",
145
- ac_cv_have_u_int16_t : "1",
146
- ac_cv_have___uint16 : "0",
147
- ac_google_end_namespace : "}",
148
- ac_cv_have___builtin_expect : "1",
149
- ac_google_namespace : "google",
150
- ac_cv___attribute___noinline : "__attribute__ ((noinline))",
151
- ac_cv___attribute___noreturn : "__attribute__ ((noreturn))",
152
- ac_cv___attribute___printf_4_5: "__attribute__((__format__ (__printf__, 4, 5)))"
153
- ])
154
- it.path = (it.name - ".in")
155
- }
156
- into("$thirdPartyNdkDir/glog")
157
-
158
- doLast {
159
- copy {
160
- from(fileTree(dir: "$thirdPartyNdkDir/glog", includes: ["stl_logging.h", "logging.h", "raw_logging.h", "vlog_is_on.h", "**/src/glog/log_severity.h"]).files)
161
- includeEmptyDirs = false
162
- into("$thirdPartyNdkDir/glog/exported/glog")
163
- }
164
- }
165
- }
166
-
167
- // Create Android.mk library module based on jsc from npm
168
- task prepareJSC {
169
- doLast {
170
- def jscPackagePath = findNodeModulePath(projectDir, "jsc-android")
171
- if (!jscPackagePath) {
172
- throw new GradleScriptException("Could not find the jsc-android npm package", null)
173
- }
174
-
175
- def jscDist = file("$jscPackagePath/dist")
176
- if (!jscDist.exists()) {
177
- throw new GradleScriptException("The jsc-android npm package is missing its \"dist\" directory", null)
178
- }
179
-
180
- def jscAAR = fileTree(jscDist).matching({ it.include "**/android-jsc/**/*.aar" }).singleFile
181
- def soFiles = zipTree(jscAAR).matching({ it.include "**/*.so" })
182
-
183
- def headerFiles = fileTree(jscDist).matching({ it.include "**/include/*.h" })
184
-
185
- copy {
186
- from(soFiles)
187
- from(headerFiles)
188
- from("src/main/jni/third-party/jsc/Android.mk")
189
-
190
- filesMatching("**/*.h", { it.path = "JavaScriptCore/${it.name}" })
191
-
192
- includeEmptyDirs(false)
193
- into("$thirdPartyNdkDir/jsc")
194
- }
195
- }
196
- }
197
- task downloadNdkBuildDependencies {
198
- if (!boostPath) {
199
- dependsOn(downloadBoost)
200
- }
201
- dependsOn(downloadDoubleConversion)
202
- dependsOn(downloadFolly)
203
- dependsOn(downloadGlog)
204
- }
205
-
206
- /**
207
- * Finds the path of the installed npm package with the given name using Node's
208
- * module resolution algorithm, which searches "node_modules" directories up to
209
- * the file system root. This handles various cases, including:
210
- *
211
- * - Working in the open-source RN repo:
212
- * Gradle: /path/to/react-native/ReactAndroid
213
- * Node module: /path/to/react-native/node_modules/[package]
214
- *
215
- * - Installing RN as a dependency of an app and searching for hoisted
216
- * dependencies:
217
- * Gradle: /path/to/app/node_modules/react-native/ReactAndroid
218
- * Node module: /path/to/app/node_modules/[package]
219
- *
220
- * - Working in a larger repo (e.g., Facebook) that contains RN:
221
- * Gradle: /path/to/repo/path/to/react-native/ReactAndroid
222
- * Node module: /path/to/repo/node_modules/[package]
223
- *
224
- * The search begins at the given base directory (a File object). The returned
225
- * path is a string.
226
- */
227
- def findNodeModulePath(baseDir, packageName) {
228
- def basePath = baseDir.toPath().normalize()
229
- // Node's module resolution algorithm searches up to the root directory,
230
- // after which the base path will be null
231
- while (basePath) {
232
- def candidatePath = Paths.get(basePath.toString(), "node_modules", packageName)
233
- if (candidatePath.toFile().exists()) {
234
- return candidatePath.toString()
235
- }
236
- basePath = basePath.getParent()
237
- }
238
- return null
239
- }
240
-
241
- def getNdkBuildName() {
242
- if (Os.isFamily(Os.FAMILY_WINDOWS)) {
243
- return "ndk-build.cmd"
244
- } else {
245
- return "ndk-build"
246
- }
247
- }
248
-
249
- def findNdkBuildFullPath() {
250
- // we allow to provide full path to ndk-build tool
251
- if (hasProperty("ndk.command")) {
252
- return property("ndk.command")
253
- }
254
- // or just a path to the containing directory
255
- if (hasProperty("ndk.path")) {
256
- def ndkDir = property("ndk.path")
257
- return new File(ndkDir, getNdkBuildName()).getAbsolutePath()
258
- }
259
-
260
- if (System.getenv("ANDROID_NDK") != null) {
261
- def ndkDir = System.getenv("ANDROID_NDK")
262
- return new File(ndkDir, getNdkBuildName()).getAbsolutePath()
263
- }
264
-
265
- def ndkDir = android.ndkDirectory ? android.ndkDirectory.absolutePath : null
266
-
267
- if (ndkDir) {
268
- return new File(ndkDir, getNdkBuildName()).getAbsolutePath()
269
- }
270
- return null
271
- }
272
-
273
- def reactNativeDevServerPort() {
274
- def value = project.getProperties().get("reactNativeDevServerPort")
275
- return value != null ? value : "8081"
276
- }
277
-
278
- def reactNativeInspectorProxyPort() {
279
- def value = project.getProperties().get("reactNativeInspectorProxyPort")
280
- return value != null ? value : reactNativeDevServerPort()
281
- }
282
-
283
- def getNdkBuildFullPath() {
284
- def ndkBuildFullPath = findNdkBuildFullPath()
285
- if (ndkBuildFullPath == null) {
286
- throw new GradleScriptException(
287
- "ndk-build binary cannot be found, check if you've set " +
288
- "\$ANDROID_NDK environment variable correctly or if ndk.dir is " +
289
- "setup in local.properties",
290
- null)
291
- }
292
- if (!new File(ndkBuildFullPath).canExecute()) {
293
- throw new GradleScriptException(
294
- "ndk-build binary " + ndkBuildFullPath + " doesn't exist or isn't executable.\n" +
295
- "Check that the \$ANDROID_NDK environment variable, or ndk.dir in local.properties, is set correctly.\n" +
296
- "(On Windows, make sure you escape backslashes in local.properties or use forward slashes, e.g. C:\\\\ndk or C:/ndk rather than C:\\ndk)",
297
- null)
298
- }
299
- return ndkBuildFullPath
300
- }
301
-
302
- def buildReactNdkLib = tasks.register("buildReactNdkLib", Exec) {
303
- dependsOn(prepareJSC, prepareHermes, prepareBoost, prepareDoubleConversion, prepareFolly, prepareGlog, extractAARHeaders, extractJNIFiles)
304
- dependsOn("generateCodegenArtifactsFromSchema");
305
-
306
- inputs.dir("$projectDir/../ReactCommon")
307
- inputs.dir("src/main/jni")
308
- inputs.dir("src/main/java/com/facebook/react/modules/blob")
309
- outputs.dir("$buildDir/react-ndk/all")
310
- commandLine(getNdkBuildFullPath(),
311
- "NDK_DEBUG=" + (nativeBuildType.equalsIgnoreCase("debug") ? "1" : "0"),
312
- "NDK_PROJECT_PATH=null",
313
- "NDK_APPLICATION_MK=$projectDir/src/main/jni/Application.mk",
314
- "NDK_OUT=" + temporaryDir,
315
- "NDK_LIBS_OUT=$buildDir/react-ndk/all",
316
- "THIRD_PARTY_NDK_DIR=$thirdPartyNdkDir",
317
- "REACT_COMMON_DIR=$projectDir/../ReactCommon",
318
- "REACT_GENERATED_SRC_DIR=$buildDir/generated/source",
319
- "REACT_SRC_DIR=$projectDir/src/main/java/com/facebook/react",
320
- "BUILD_FABRIC=$enableFabric",
321
- "-C", file("src/main/jni/react/jni").absolutePath,
322
- "--jobs", project.findProperty("jobs") ?: Runtime.runtime.availableProcessors()
323
- )
324
- }
325
-
326
- def cleanReactNdkLib = tasks.register("cleanReactNdkLib", Exec) {
327
- ignoreExitValue(true)
328
- errorOutput(new ByteArrayOutputStream())
329
- commandLine(getNdkBuildFullPath(),
330
- "NDK_APPLICATION_MK=$projectDir/src/main/jni/Application.mk",
331
- "THIRD_PARTY_NDK_DIR=$thirdPartyNdkDir",
332
- "REACT_COMMON_DIR=$projectDir/../ReactCommon",
333
- "-C", file("src/main/jni/react/jni").absolutePath,
334
- "clean")
335
- doLast {
336
- file(AAR_OUTPUT_URL).delete()
337
- println("Deleted aar output dir at ${file(AAR_OUTPUT_URL)}")
338
- }
339
- }
340
-
341
- def packageReactNdkLibs = tasks.register("packageReactNdkLibs", Copy) {
342
- dependsOn(buildReactNdkLib)
343
- from("$buildDir/react-ndk/all")
344
- into("$buildDir/react-ndk/exported")
345
- exclude("**/libjsc.so")
346
- exclude("**/libhermes.so")
347
- }
348
-
349
- def packageReactNdkLibsForBuck = tasks.register("packageReactNdkLibsForBuck", Copy) {
350
- dependsOn(packageReactNdkLibs)
351
- from("$buildDir/react-ndk/exported")
352
- into("src/main/jni/prebuilt/lib")
353
- }
354
-
355
- task extractAARHeaders {
356
- doLast {
357
- configurations.extractHeaders.files.each {
358
- def file = it.absoluteFile
359
- def packageName = file.name.tokenize('-')[0]
360
- copy {
361
- from zipTree(file)
362
- into "$projectDir/src/main/jni/first-party/$packageName/headers"
363
- include "**/*.h"
364
- }
365
- }
366
- }
367
- }
368
-
369
- task extractJNIFiles {
370
- doLast {
371
- configurations.extractJNI.files.each {
372
- def file = it.absoluteFile
373
- def packageName = file.name.tokenize('-')[0]
374
- copy {
375
- from zipTree(file)
376
- into "$projectDir/src/main/jni/first-party/$packageName/"
377
- include "jni/**/*"
378
- }
379
- }
380
- }
381
- }
382
-
383
- android {
384
- compileSdkVersion 29
385
-
386
- compileOptions {
387
- sourceCompatibility(JavaVersion.VERSION_1_8)
388
- targetCompatibility(JavaVersion.VERSION_1_8)
389
- }
390
-
391
- defaultConfig {
392
- minSdkVersion(21)
393
- targetSdkVersion(28)
394
- versionCode(1)
395
- versionName("1.0")
396
-
397
- consumerProguardFiles("proguard-rules.pro")
398
-
399
- buildConfigField("boolean", "IS_INTERNAL_BUILD", "false")
400
- buildConfigField("int", "EXOPACKAGE_FLAGS", "0")
401
-
402
- resValue "integer", "react_native_dev_server_port", reactNativeDevServerPort()
403
- resValue "integer", "react_native_inspector_proxy_port", reactNativeInspectorProxyPort()
404
-
405
- testApplicationId("com.facebook.react.tests.gradle")
406
- testInstrumentationRunner("androidx.test.runner.AndroidJUnitRunner")
407
- }
408
-
409
- sourceSets.main {
410
- jni.srcDirs = []
411
- jniLibs.srcDir("$buildDir/react-ndk/exported")
412
- res.srcDirs = ["src/main/res/devsupport", "src/main/res/shell", "src/main/res/views/modal", "src/main/res/views/uimanager"]
413
- java {
414
- srcDirs = ["src/main/java", "src/main/libraries/soloader/java", "src/main/jni/first-party/fb/jni/java"]
415
- exclude("com/facebook/react/processing")
416
- exclude("com/facebook/react/module/processing")
417
- }
418
- }
419
-
420
- tasks.withType(JavaCompile) {
421
- compileTask ->
422
- compileTask.dependsOn(packageReactNdkLibs)
423
- }
424
-
425
- clean.dependsOn(cleanReactNdkLib)
426
-
427
- lintOptions {
428
- abortOnError(false)
429
- }
430
-
431
- packagingOptions {
432
- exclude("META-INF/NOTICE")
433
- exclude("META-INF/LICENSE")
434
- }
435
-
436
- configurations {
437
- extractHeaders
438
- extractJNI
439
- }
440
- }
441
-
442
- dependencies {
443
- api("com.facebook.infer.annotation:infer-annotation:0.11.2")
444
- api("com.facebook.yoga:proguard-annotations:1.14.1")
445
- api("javax.inject:javax.inject:1")
446
- api("androidx.appcompat:appcompat:1.0.2")
447
- api("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
448
- api("com.facebook.fresco:fresco:${FRESCO_VERSION}")
449
- api("com.facebook.fresco:imagepipeline-okhttp3:${FRESCO_VERSION}")
450
- api("com.facebook.soloader:soloader:${SO_LOADER_VERSION}")
451
- api("com.google.code.findbugs:jsr305:3.0.2")
452
- api("com.squareup.okhttp3:okhttp:${OKHTTP_VERSION}")
453
- api("com.squareup.okhttp3:okhttp-urlconnection:${OKHTTP_VERSION}")
454
- api("com.squareup.okio:okio:1.17.5")
455
- api("com.facebook.fbjni:fbjni-java-only:0.0.3")
456
- extractHeaders("com.facebook.fbjni:fbjni:0.0.2:headers")
457
- extractJNI("com.facebook.fbjni:fbjni:0.0.2")
458
-
459
- testImplementation("junit:junit:${JUNIT_VERSION}")
460
- testImplementation("org.powermock:powermock-api-mockito2:${POWERMOCK_VERSION}")
461
- testImplementation("org.powermock:powermock-module-junit4-rule:${POWERMOCK_VERSION}")
462
- testImplementation("org.powermock:powermock-classloading-xstream:${POWERMOCK_VERSION}")
463
- testImplementation("org.mockito:mockito-core:${MOCKITO_CORE_VERSION}")
464
- testImplementation("org.easytesting:fest-assert-core:2.0M10")
465
- testImplementation("org.robolectric:robolectric:${ROBOLECTRIC_VERSION}")
466
-
467
- androidTestImplementation(fileTree(dir: "src/main/third-party/java/buck-android-support/", include: ["*.jar"]))
468
- androidTestImplementation("androidx.test:runner:${ANDROIDX_TEST_VERSION}")
469
- androidTestImplementation("androidx.test:rules:${ANDROIDX_TEST_VERSION}")
470
- androidTestImplementation("org.mockito:mockito-core:${MOCKITO_CORE_VERSION}")
471
- }
472
-
473
- apply(from: "release.gradle")
474
-
475
- react {
476
- jsRootDir = file("../Libraries")
477
- reactNativeRootDir = file("$projectDir/..")
478
- useJavaGenerator = System.getenv("USE_CODEGEN_JAVAPOET") ?: false
479
- }
@@ -1,98 +0,0 @@
1
- /*
2
- * Copyright (c) Facebook, Inc. and its affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- package com.facebook.react;
9
-
10
- import android.view.KeyEvent;
11
- import android.view.View;
12
- import com.facebook.react.bridge.WritableMap;
13
- import com.facebook.react.bridge.WritableNativeMap;
14
- import com.facebook.react.common.MapBuilder;
15
- import java.util.Map;
16
-
17
- /** Responsible for dispatching events specific for hardware inputs. */
18
- public class ReactAndroidHWInputDeviceHelper {
19
-
20
- /**
21
- * Contains a mapping between handled KeyEvents and the corresponding navigation event that should
22
- * be fired when the KeyEvent is received.
23
- */
24
- private static final Map<Integer, String> KEY_EVENTS_ACTIONS =
25
- MapBuilder.<Integer, String>builder()
26
- .put(KeyEvent.KEYCODE_DPAD_CENTER, "select")
27
- .put(KeyEvent.KEYCODE_ENTER, "select")
28
- .put(KeyEvent.KEYCODE_SPACE, "select")
29
- .put(KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE, "playPause")
30
- .put(KeyEvent.KEYCODE_MEDIA_PLAY, "play")
31
- .put(KeyEvent.KEYCODE_MEDIA_PAUSE, "pause")
32
- .put(KeyEvent.KEYCODE_MEDIA_NEXT, "next")
33
- .put(KeyEvent.KEYCODE_MEDIA_PREVIOUS, "previous")
34
- .put(KeyEvent.KEYCODE_MEDIA_REWIND, "rewind")
35
- .put(KeyEvent.KEYCODE_MEDIA_FAST_FORWARD, "fastForward")
36
- .put(KeyEvent.KEYCODE_DPAD_UP, "up")
37
- .put(KeyEvent.KEYCODE_DPAD_RIGHT, "right")
38
- .put(KeyEvent.KEYCODE_DPAD_DOWN, "down")
39
- .put(KeyEvent.KEYCODE_DPAD_LEFT, "left")
40
- .build();
41
-
42
- /**
43
- * We keep a reference to the last focused view id so that we can send it as a target for key
44
- * events and be able to send a blur event when focus changes.
45
- */
46
- private int mLastFocusedViewId = View.NO_ID;
47
-
48
- private final ReactRootView mReactRootView;
49
-
50
- ReactAndroidHWInputDeviceHelper(ReactRootView mReactRootView) {
51
- this.mReactRootView = mReactRootView;
52
- }
53
-
54
- /** Called from {@link ReactRootView}. This is the main place the key events are handled. */
55
- public void handleKeyEvent(KeyEvent ev) {
56
- int eventKeyCode = ev.getKeyCode();
57
- int eventKeyAction = ev.getAction();
58
- if ((eventKeyAction == KeyEvent.ACTION_UP || eventKeyAction == KeyEvent.ACTION_DOWN)
59
- && KEY_EVENTS_ACTIONS.containsKey(eventKeyCode)) {
60
- dispatchEvent(KEY_EVENTS_ACTIONS.get(eventKeyCode), mLastFocusedViewId, eventKeyAction);
61
- }
62
- }
63
-
64
- /** Called from {@link ReactRootView} when focused view changes. */
65
- public void onFocusChanged(View newFocusedView) {
66
- if (mLastFocusedViewId == newFocusedView.getId()) {
67
- return;
68
- }
69
- if (mLastFocusedViewId != View.NO_ID) {
70
- dispatchEvent("blur", mLastFocusedViewId);
71
- }
72
- mLastFocusedViewId = newFocusedView.getId();
73
- dispatchEvent("focus", newFocusedView.getId());
74
- }
75
-
76
- /** Called from {@link ReactRootView} when the whole view hierarchy looses focus. */
77
- public void clearFocus() {
78
- if (mLastFocusedViewId != View.NO_ID) {
79
- dispatchEvent("blur", mLastFocusedViewId);
80
- }
81
- mLastFocusedViewId = View.NO_ID;
82
- }
83
-
84
- private void dispatchEvent(String eventType, int targetViewId) {
85
- dispatchEvent(eventType, targetViewId, -1);
86
- }
87
-
88
- private void dispatchEvent(String eventType, int targetViewId, int eventKeyAction) {
89
- WritableMap event = new WritableNativeMap();
90
- event.putString("eventType", eventType);
91
- event.putInt("eventKeyAction", eventKeyAction);
92
- if (targetViewId != View.NO_ID) {
93
- event.putInt("tag", targetViewId);
94
- event.putInt("target", targetViewId);
95
- }
96
- mReactRootView.sendEvent("onHWKeyEvent", event);
97
- }
98
- }
@@ -1,2 +0,0 @@
1
- /headers/
2
- /jni/
@@ -1,3 +0,0 @@
1
- .DS_Store
2
- bin/
3
- node_modules/
@@ -1 +0,0 @@
1
- 4235de64b6f02de8475f4d39b490eb4c
@@ -1 +0,0 @@
1
- 60600e3f3fa5f5129ddc0f21d46aaaf03c6cce27
@@ -1 +0,0 @@
1
- c486df4ced42ebb7c09a357e59db13f1
@@ -1 +0,0 @@
1
- e895be6a3328d63725d04c72be9c1d62a8394f7b
@@ -1 +0,0 @@
1
- ec4a0fabf4cc1a7af36ebd05e8b28577
@@ -1 +0,0 @@
1
- ccfad14aefb41af4fe878417c7512925db133bec
@@ -1,45 +0,0 @@
1
- # Copyright (c) Facebook, Inc. and its affiliates.
2
- #
3
- # This source code is licensed under the MIT license found in the
4
- # LICENSE file in the root directory of this source tree.
5
-
6
- module HermesHelper
7
- # BUILD_TYPE = :debug
8
- BUILD_TYPE = :release
9
- end
10
-
11
- Pod::Spec.new do |spec|
12
- spec.name = "hermes-engine"
13
- spec.version = "0.8.0"
14
- spec.summary = "Hermes is a small and lightweight JavaScript engine optimized for running React Native."
15
- spec.description = "Hermes is a JavaScript engine optimized for fast start-up of React Native apps. It features ahead-of-time static optimization and compact bytecode."
16
- spec.homepage = "https://hermesengine.dev"
17
- spec.license = { type: "MIT", file: "LICENSE" }
18
- spec.author = "Facebook"
19
- # This env var should be supplied with a CDN URL of the "hermes-runtime-darwin.tgz" on the Github releases before pod push.
20
- # The podspec would be serialized to JSON and people will download prebuilt binaries instead of the source.
21
- # TODO(use the hash field as a validation mechanism when the process is stable)
22
- spec.source = ENV['hermes-artifact-url'] ? { http: ENV['hermes-artifact-url'] } : { git: "https://github.com/facebook/hermes.git", tag: "v#{spec.version}" }
23
- spec.platforms = { :osx => "10.13", :ios => "10.0" , :tvos => "12.0" }
24
-
25
- spec.preserve_paths = ["destroot/bin/*"].concat(HermesHelper::BUILD_TYPE == :debug ? ["**/*.{h,c,cpp}"] : [])
26
- spec.source_files = "destroot/include/**/*.h"
27
- spec.header_mappings_dir = "destroot/include"
28
-
29
- spec.ios.vendored_frameworks = "destroot/Library/Frameworks/iphoneos/hermes.framework"
30
- spec.osx.vendored_frameworks = "destroot/Library/Frameworks/macosx/hermes.framework"
31
-
32
- spec.xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => "c++14", "CLANG_CXX_LIBRARY" => "compiler-default", "GCC_PREPROCESSOR_DEFINITIONS" => "HERMES_ENABLE_DEBUGGER=1" }
33
-
34
- unless ENV['hermes-artifact-url']
35
- spec.prepare_command = <<-EOS
36
- # When true, debug build will be used.
37
- # See `build-apple-framework.sh` for details
38
- DEBUG=#{HermesHelper::BUILD_TYPE == :debug}
39
- # Build iOS framework
40
- ./utils/build-ios-framework.sh
41
- # Build Mac framework
42
- ./utils/build-mac-framework.sh
43
- EOS
44
- end
45
- end