@pmishra0/react-native-aes-gcm 0.1.4 → 0.1.6

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 (29) hide show
  1. package/AesGcm.podspec +38 -11
  2. package/android/build.gradle +41 -31
  3. package/android/src/main/java/com/aesgcm/AesGcmModule.kt +4 -1
  4. package/android/src/newarch/AesGcmSpec.kt +6 -0
  5. package/android/src/oldarch/AesGcmSpec.kt +27 -0
  6. package/ios/AesGcm.h +7 -2
  7. package/ios/AesGcm.mm +10 -1
  8. package/package.json +3 -1
  9. package/android/generated/java/com/aesgcm/NativeAesGcmSpec.java +0 -42
  10. package/android/generated/jni/CMakeLists.txt +0 -28
  11. package/android/generated/jni/RNAesGcmSpec-generated.cpp +0 -38
  12. package/android/generated/jni/RNAesGcmSpec.h +0 -31
  13. package/android/generated/jni/react/renderer/components/RNAesGcmSpec/RNAesGcmSpecJSI.h +0 -55
  14. package/ios/generated/Package.swift +0 -59
  15. package/ios/generated/ReactAppDependencyProvider/RCTAppDependencyProvider.h +0 -25
  16. package/ios/generated/ReactAppDependencyProvider/RCTAppDependencyProvider.mm +0 -40
  17. package/ios/generated/ReactAppDependencyProvider/ReactAppDependencyProvider.podspec +0 -34
  18. package/ios/generated/ReactCodegen/RCTModuleProviders.h +0 -16
  19. package/ios/generated/ReactCodegen/RCTModuleProviders.mm +0 -51
  20. package/ios/generated/ReactCodegen/RCTModulesConformingToProtocolsProvider.h +0 -18
  21. package/ios/generated/ReactCodegen/RCTModulesConformingToProtocolsProvider.mm +0 -54
  22. package/ios/generated/ReactCodegen/RCTThirdPartyComponentsProvider.h +0 -16
  23. package/ios/generated/ReactCodegen/RCTThirdPartyComponentsProvider.mm +0 -30
  24. package/ios/generated/ReactCodegen/RCTUnstableModulesRequiringMainQueueSetupProvider.h +0 -14
  25. package/ios/generated/ReactCodegen/RCTUnstableModulesRequiringMainQueueSetupProvider.mm +0 -19
  26. package/ios/generated/ReactCodegen/RNAesGcmSpec/RNAesGcmSpec-generated.mm +0 -46
  27. package/ios/generated/ReactCodegen/RNAesGcmSpec/RNAesGcmSpec.h +0 -75
  28. package/ios/generated/ReactCodegen/RNAesGcmSpecJSI.h +0 -55
  29. package/ios/generated/ReactCodegen/ReactCodegen.podspec +0 -110
package/AesGcm.podspec CHANGED
@@ -11,10 +11,22 @@ Pod::Spec.new do |s|
11
11
  s.authors = package["author"]
12
12
 
13
13
  s.platforms = { :ios => min_ios_version_supported }
14
- s.source = { :git => "https://github.com/prashantkmishra/react-native-aes-gcm.git.git", :tag => "#{s.version}" }
14
+ s.source = {
15
+ :git => "https://github.com/prashantkmishra/react-native-aes-gcm.git",
16
+ :tag => "#{s.version}"
17
+ }
15
18
 
16
- s.source_files = "ios/**/*.{h,m,mm,swift}"
17
- s.exclude_files = [
19
+ # Build source file list safely
20
+ source_files = ["ios/**/*.{h,m,mm,swift}"]
21
+
22
+ if ENV['RCT_NEW_ARCH_ENABLED'] == '1'
23
+ source_files << "ios/generated/**/*.{h,mm}"
24
+ end
25
+
26
+ s.source_files = source_files
27
+
28
+ # ✅ Exclusions
29
+ exclusions = [
18
30
  "ios/**/RCTAppDependencyProvider.*",
19
31
  "ios/**/RCTModuleProviders.*",
20
32
  "ios/**/RCTThirdPartyComponentsProvider.*",
@@ -22,14 +34,29 @@ Pod::Spec.new do |s|
22
34
  "ios/**/RCTUnstableModulesRequiringMainQueueSetupProvider.*",
23
35
  "**/Package.swift"
24
36
  ]
37
+
38
+ if ENV['RCT_NEW_ARCH_ENABLED'] != '1'
39
+ exclusions << "ios/generated/**/*"
40
+ end
41
+
42
+ s.exclude_files = exclusions
25
43
  s.private_header_files = "ios/**/*.h"
44
+
45
+ # ✅ Dependencies
26
46
  s.dependency "CryptoSwift"
27
-
28
- # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
29
- # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
30
- if respond_to?(:install_modules_dependencies, true)
31
- install_modules_dependencies(s)
32
- else
33
- s.dependency "React-Core"
34
- end
47
+
48
+ if respond_to?(:install_modules_dependencies, true)
49
+ install_modules_dependencies(s)
50
+ else
51
+ s.dependency "React-Core"
52
+ end
53
+
54
+ # ✅ New Architecture flags
55
+ if ENV['RCT_NEW_ARCH_ENABLED'] == '1'
56
+ s.compiler_flags = "-DRCT_NEW_ARCH_ENABLED=1"
57
+ s.pod_target_xcconfig = {
58
+ "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
59
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
60
+ }
61
+ end
35
62
  end
@@ -1,6 +1,8 @@
1
1
  buildscript {
2
- ext.getExtOrDefault = {name ->
3
- return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['AesGcm_' + name]
2
+ ext.getExtOrDefault = { name ->
3
+ return rootProject.ext.has(name)
4
+ ? rootProject.ext.get(name)
5
+ : project.properties['AesGcm_' + name]
4
6
  }
5
7
 
6
8
  repositories {
@@ -10,27 +12,34 @@ buildscript {
10
12
 
11
13
  dependencies {
12
14
  classpath "com.android.tools.build:gradle:8.7.2"
13
- // noinspection DifferentKotlinGradleVersion
14
15
  classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
15
16
  }
16
17
  }
17
18
 
18
-
19
19
  apply plugin: "com.android.library"
20
20
  apply plugin: "kotlin-android"
21
21
 
22
- apply plugin: "com.facebook.react"
22
+ def isNewArchitectureEnabled() {
23
+ return rootProject.hasProperty("newArchEnabled") &&
24
+ rootProject.getProperty("newArchEnabled") == "true"
25
+ }
26
+
27
+ if (isNewArchitectureEnabled()) {
28
+ apply plugin: "com.facebook.react"
29
+ }
23
30
 
24
31
  def getExtOrIntegerDefault(name) {
25
- return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["AesGcm_" + name]).toInteger()
32
+ return rootProject.ext.has(name)
33
+ ? rootProject.ext.get(name)
34
+ : (project.properties["AesGcm_" + name]).toInteger()
26
35
  }
27
36
 
28
37
  def supportsNamespace() {
29
- def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
38
+ def agpVersion = com.android.builder.model.Version.ANDROID_GRADLE_PLUGIN_VERSION
39
+ def parsed = agpVersion.tokenize('.')
30
40
  def major = parsed[0].toInteger()
31
41
  def minor = parsed[1].toInteger()
32
42
 
33
- // Namespace support was added in 7.3.0
34
43
  return (major == 7 && minor >= 3) || major >= 8
35
44
  }
36
45
 
@@ -45,56 +54,57 @@ android {
45
54
  }
46
55
  }
47
56
 
48
- compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
57
+ compileSdk getExtOrIntegerDefault("compileSdkVersion")
49
58
 
50
59
  defaultConfig {
51
- minSdkVersion getExtOrIntegerDefault("minSdkVersion")
52
- targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
60
+ minSdk getExtOrIntegerDefault("minSdkVersion")
61
+ targetSdk getExtOrIntegerDefault("targetSdkVersion")
62
+
63
+ buildConfigField "boolean",
64
+ "IS_NEW_ARCHITECTURE_ENABLED",
65
+ isNewArchitectureEnabled().toString()
53
66
  }
54
67
 
55
68
  buildFeatures {
56
69
  buildConfig true
57
70
  }
58
71
 
59
- buildTypes {
60
- release {
61
- minifyEnabled false
62
- }
63
- }
64
-
65
- lintOptions {
66
- disable "GradleCompatible"
72
+ lint {
73
+ disable += ["GradleCompatible"]
67
74
  }
68
75
 
69
76
  compileOptions {
70
- sourceCompatibility JavaVersion.VERSION_1_8
71
- targetCompatibility JavaVersion.VERSION_1_8
77
+ sourceCompatibility JavaVersion.VERSION_11
78
+ targetCompatibility JavaVersion.VERSION_11
72
79
  }
73
80
 
74
81
  sourceSets {
75
82
  main {
76
- java.srcDirs += [
77
- "generated/java",
78
- "generated/jni"
79
- ]
83
+ java.srcDirs += isNewArchitectureEnabled()
84
+ ? ["src/newarch", "generated/java"]
85
+ : ["src/oldarch"]
86
+
87
+ jniLibs.srcDirs += ["generated/jni"]
80
88
  }
81
89
  }
82
90
  }
83
91
 
84
92
  repositories {
85
- mavenCentral()
86
93
  google()
94
+ mavenCentral()
87
95
  }
88
96
 
89
97
  def kotlin_version = getExtOrDefault("kotlinVersion")
90
98
 
91
99
  dependencies {
92
- implementation "com.facebook.react:react-android"
100
+ api "com.facebook.react:react-android"
93
101
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
94
102
  }
95
103
 
96
- react {
97
- jsRootDir = file("../src/")
98
- libraryName = "AesGcm"
99
- codegenJavaPackageName = "com.aesgcm"
104
+ if (isNewArchitectureEnabled()) {
105
+ react {
106
+ jsRootDir = file("../src/")
107
+ libraryName = "AesGcm"
108
+ codegenJavaPackageName = "com.aesgcm"
109
+ }
100
110
  }
@@ -3,6 +3,7 @@ package com.aesgcm
3
3
  import android.util.Base64
4
4
  import com.facebook.react.bridge.Promise
5
5
  import com.facebook.react.bridge.ReactApplicationContext
6
+ import com.facebook.react.bridge.ReactMethod
6
7
  import com.facebook.react.module.annotations.ReactModule
7
8
  import java.nio.ByteBuffer
8
9
  import java.nio.charset.StandardCharsets
@@ -22,12 +23,13 @@ import javax.crypto.spec.SecretKeySpec
22
23
 
23
24
 
24
25
  @ReactModule(name = AesGcmModule.NAME)
25
- class AesGcmModule(reactContext: ReactApplicationContext) : NativeAesGcmSpec(reactContext) {
26
+ class AesGcmModule(reactContext: ReactApplicationContext) : AesGcmSpec(reactContext) {
26
27
 
27
28
  override fun getName(): String {
28
29
  return NAME
29
30
  }
30
31
 
32
+ @ReactMethod
31
33
  override fun encrypt(
32
34
  plainText: String,
33
35
  key: String,
@@ -54,6 +56,7 @@ class AesGcmModule(reactContext: ReactApplicationContext) : NativeAesGcmSpec(rea
54
56
  }
55
57
  }
56
58
 
59
+ @ReactMethod
57
60
  override fun decrypt(
58
61
  encryptedText: String,
59
62
  key: String,
@@ -0,0 +1,6 @@
1
+ package com.aesgcm
2
+
3
+ import com.facebook.react.bridge.ReactApplicationContext;
4
+
5
+ abstract class AesGcmSpec(context: ReactApplicationContext?) :
6
+ NativeAesGcmSpec(context)
@@ -0,0 +1,27 @@
1
+ package com.aesgcm
2
+
3
+ import com.facebook.react.bridge.Promise
4
+ import com.facebook.react.bridge.ReactApplicationContext
5
+ import com.facebook.react.bridge.ReactContextBaseJavaModule
6
+
7
+ abstract class AesGcmSpec (context: ReactApplicationContext ) : ReactContextBaseJavaModule(context) {
8
+
9
+ abstract fun encrypt(
10
+ plainText: String,
11
+ key: String,
12
+ saltLength: Double,
13
+ ivLength: Double,
14
+ iterationCount: Double,
15
+ promise: Promise
16
+ )
17
+
18
+ abstract fun decrypt(
19
+ encryptedText: String,
20
+ key: String,
21
+ saltLength: Double,
22
+ ivLength: Double,
23
+ iterationCount: Double,
24
+ promise: Promise
25
+ )
26
+
27
+ }
package/ios/AesGcm.h CHANGED
@@ -1,6 +1,11 @@
1
+ #ifdef RCT_NEW_ARCH_ENABLED
2
+ #import <AesGcm/RNAesGcmSpec.h>
1
3
 
2
- #import <AesGcm/RNAesGcmSpec.h>
4
+ @interface AesGcm : NSObject <NativeAesGcmSpec>
5
+ #else
6
+ #import <React/RCTBridgeModule.h>
3
7
 
4
- @interface AesGcm : NSObject <NativeAesGcmSpec>
8
+ @interface AesGcm : NSObject <RCTBridgeModule>
9
+ #endif
5
10
 
6
11
  @end
package/ios/AesGcm.mm CHANGED
@@ -23,6 +23,12 @@ EncryptionManager *_manager;
23
23
  resolve:(RCTPromiseResolveBlock)resolve
24
24
  reject:(RCTPromiseRejectBlock)reject {
25
25
 
26
+ #ifdef RCT_NEW_ARCH_ENABLED
27
+ NSLog(@"New Arch");
28
+ #else
29
+ NSLog(@"Old Arch");
30
+ #endif
31
+
26
32
  NSError *error = nil;
27
33
  NSString *result = [_manager encrypt:plainText
28
34
  key:key
@@ -65,10 +71,13 @@ EncryptionManager *_manager;
65
71
  }
66
72
  }
67
73
 
74
+ // Don't compile this code when we build for the old architecture.
75
+ #ifdef RCT_NEW_ARCH_ENABLED
68
76
  - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
69
77
  (const facebook::react::ObjCTurboModule::InitParams &)params
70
78
  {
71
- return std::make_shared<facebook::react::NativeAesGcmSpecJSI>(params);
79
+ return std::make_shared<facebook::react::NativeAesGcmSpecJSI>(params);
72
80
  }
81
+ #endif
73
82
 
74
83
  @end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pmishra0/react-native-aes-gcm",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "AES-GCM encryption/decryption for React Native",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/module/index.js",
@@ -25,6 +25,8 @@
25
25
  "*.podspec",
26
26
  "react-native.config.js",
27
27
  "!ios/build",
28
+ "!ios/generated",
29
+ "!android/generated",
28
30
  "!android/build",
29
31
  "!android/gradle",
30
32
  "!android/gradlew",
@@ -1,42 +0,0 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by codegen project: GenerateModuleJavaSpec.js
9
- *
10
- * @nolint
11
- */
12
-
13
- package com.aesgcm;
14
-
15
- import com.facebook.proguard.annotations.DoNotStrip;
16
- import com.facebook.react.bridge.Promise;
17
- import com.facebook.react.bridge.ReactApplicationContext;
18
- import com.facebook.react.bridge.ReactContextBaseJavaModule;
19
- import com.facebook.react.bridge.ReactMethod;
20
- import com.facebook.react.turbomodule.core.interfaces.TurboModule;
21
- import javax.annotation.Nonnull;
22
-
23
- public abstract class NativeAesGcmSpec extends ReactContextBaseJavaModule implements TurboModule {
24
- public static final String NAME = "AesGcm";
25
-
26
- public NativeAesGcmSpec(ReactApplicationContext reactContext) {
27
- super(reactContext);
28
- }
29
-
30
- @Override
31
- public @Nonnull String getName() {
32
- return NAME;
33
- }
34
-
35
- @ReactMethod
36
- @DoNotStrip
37
- public abstract void encrypt(String plainText, String key, double saltLength, double ivLength, double iterationCount, Promise promise);
38
-
39
- @ReactMethod
40
- @DoNotStrip
41
- public abstract void decrypt(String encryptedText, String key, double saltLength, double ivLength, double iterationCount, Promise promise);
42
- }
@@ -1,28 +0,0 @@
1
- # Copyright (c) Meta Platforms, Inc. and 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
- cmake_minimum_required(VERSION 3.13)
7
- set(CMAKE_VERBOSE_MAKEFILE on)
8
-
9
- file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/RNAesGcmSpec/*.cpp)
10
-
11
- add_library(
12
- react_codegen_RNAesGcmSpec
13
- OBJECT
14
- ${react_codegen_SRCS}
15
- )
16
-
17
- target_include_directories(react_codegen_RNAesGcmSpec PUBLIC . react/renderer/components/RNAesGcmSpec)
18
-
19
- target_link_libraries(
20
- react_codegen_RNAesGcmSpec
21
- fbjni
22
- jsi
23
- # We need to link different libraries based on whether we are building rncore or not, that's necessary
24
- # because we want to break a circular dependency between react_codegen_rncore and reactnative
25
- reactnative
26
- )
27
-
28
- target_compile_reactnative_options(react_codegen_RNAesGcmSpec PRIVATE)
@@ -1,38 +0,0 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by codegen project: GenerateModuleJniCpp.js
9
- */
10
-
11
- #include "RNAesGcmSpec.h"
12
-
13
- namespace facebook::react {
14
-
15
- static facebook::jsi::Value __hostFunction_NativeAesGcmSpecJSI_encrypt(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
16
- static jmethodID cachedMethodId = nullptr;
17
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "encrypt", "(Ljava/lang/String;Ljava/lang/String;DDDLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
18
- }
19
-
20
- static facebook::jsi::Value __hostFunction_NativeAesGcmSpecJSI_decrypt(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
21
- static jmethodID cachedMethodId = nullptr;
22
- return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "decrypt", "(Ljava/lang/String;Ljava/lang/String;DDDLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
23
- }
24
-
25
- NativeAesGcmSpecJSI::NativeAesGcmSpecJSI(const JavaTurboModule::InitParams &params)
26
- : JavaTurboModule(params) {
27
- methodMap_["encrypt"] = MethodMetadata {5, __hostFunction_NativeAesGcmSpecJSI_encrypt};
28
- methodMap_["decrypt"] = MethodMetadata {5, __hostFunction_NativeAesGcmSpecJSI_decrypt};
29
- }
30
-
31
- std::shared_ptr<TurboModule> RNAesGcmSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams &params) {
32
- if (moduleName == "AesGcm") {
33
- return std::make_shared<NativeAesGcmSpecJSI>(params);
34
- }
35
- return nullptr;
36
- }
37
-
38
- } // namespace facebook::react
@@ -1,31 +0,0 @@
1
-
2
- /**
3
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
- *
5
- * Do not edit this file as changes may cause incorrect behavior and will be lost
6
- * once the code is regenerated.
7
- *
8
- * @generated by codegen project: GenerateModuleJniH.js
9
- */
10
-
11
- #pragma once
12
-
13
- #include <ReactCommon/JavaTurboModule.h>
14
- #include <ReactCommon/TurboModule.h>
15
- #include <jsi/jsi.h>
16
-
17
- namespace facebook::react {
18
-
19
- /**
20
- * JNI C++ class for module 'NativeAesGcm'
21
- */
22
- class JSI_EXPORT NativeAesGcmSpecJSI : public JavaTurboModule {
23
- public:
24
- NativeAesGcmSpecJSI(const JavaTurboModule::InitParams &params);
25
- };
26
-
27
-
28
- JSI_EXPORT
29
- std::shared_ptr<TurboModule> RNAesGcmSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams &params);
30
-
31
- } // namespace facebook::react
@@ -1,55 +0,0 @@
1
- /**
2
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be lost
5
- * once the code is regenerated.
6
- *
7
- * @generated by codegen project: GenerateModuleH.js
8
- */
9
-
10
- #pragma once
11
-
12
- #include <ReactCommon/TurboModule.h>
13
- #include <react/bridging/Bridging.h>
14
-
15
- namespace facebook::react {
16
-
17
-
18
- template <typename T>
19
- class JSI_EXPORT NativeAesGcmCxxSpec : public TurboModule {
20
- public:
21
- static constexpr std::string_view kModuleName = "AesGcm";
22
-
23
- protected:
24
- NativeAesGcmCxxSpec(std::shared_ptr<CallInvoker> jsInvoker) : TurboModule(std::string{NativeAesGcmCxxSpec::kModuleName}, jsInvoker) {
25
- methodMap_["encrypt"] = MethodMetadata {.argCount = 5, .invoker = __encrypt};
26
- methodMap_["decrypt"] = MethodMetadata {.argCount = 5, .invoker = __decrypt};
27
- }
28
-
29
- private:
30
- static jsi::Value __encrypt(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
31
- static_assert(
32
- bridging::getParameterCount(&T::encrypt) == 6,
33
- "Expected encrypt(...) to have 6 parameters");
34
- return bridging::callFromJs<jsi::Value>(rt, &T::encrypt, static_cast<NativeAesGcmCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
35
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
36
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
37
- count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(),
38
- count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asNumber(),
39
- count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asNumber());
40
- }
41
-
42
- static jsi::Value __decrypt(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
43
- static_assert(
44
- bridging::getParameterCount(&T::decrypt) == 6,
45
- "Expected decrypt(...) to have 6 parameters");
46
- return bridging::callFromJs<jsi::Value>(rt, &T::decrypt, static_cast<NativeAesGcmCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
47
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
48
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
49
- count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(),
50
- count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asNumber(),
51
- count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asNumber());
52
- }
53
- };
54
-
55
- } // namespace facebook::react
@@ -1,59 +0,0 @@
1
- // swift-tools-version: 6.1
2
- // The swift-tools-version declares the minimum version of Swift required to build this package.
3
-
4
- import PackageDescription
5
-
6
- let package = Package(
7
- name: "React-GeneratedCode",
8
- platforms: [.iOS(.v15), .macCatalyst(SupportedPlatform.MacCatalystVersion.v13)],
9
- products: [
10
- // Products define the executables and libraries a package produces, making them visible to other packages.
11
- .library(
12
- name: "ReactCodegen",
13
- targets: ["ReactCodegen"]),
14
- .library(
15
- name: "ReactAppDependencyProvider",
16
- targets: ["ReactAppDependencyProvider"]),
17
- ],
18
- dependencies: [
19
- .package(name: "React", path: "../../../../../../../../node_modules/react-native")
20
- ],
21
- targets: [
22
- // Targets are the basic building blocks of a package, defining a module or a test suite.
23
- // Targets can depend on other targets in this package and products from dependencies.
24
- .target(
25
- name: "ReactCodegen",
26
- dependencies: ["React"],
27
- path: "ReactCodegen",
28
- exclude: ["ReactCodegen.podspec"],
29
- publicHeadersPath: ".",
30
- cSettings: [
31
- .headerSearchPath("headers")
32
- ],
33
- cxxSettings: [
34
- .headerSearchPath("headers"),
35
- .unsafeFlags(["-std=c++20"]),
36
- ],
37
- linkerSettings: [
38
- .linkedFramework("Foundation")
39
- ]
40
- ),
41
- .target(
42
- name: "ReactAppDependencyProvider",
43
- dependencies: ["ReactCodegen"],
44
- path: "ReactAppDependencyProvider",
45
- exclude: ["ReactAppDependencyProvider.podspec"],
46
- publicHeadersPath: ".",
47
- cSettings: [
48
- .headerSearchPath("headers"),
49
- ],
50
- cxxSettings: [
51
- .headerSearchPath("headers"),
52
- .unsafeFlags(["-std=c++20"]),
53
- ],
54
- linkerSettings: [
55
- .linkedFramework("Foundation")
56
- ]
57
- )
58
- ]
59
- )
@@ -1,25 +0,0 @@
1
- /*
2
- * Copyright (c) Meta Platforms, Inc. and 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
-
9
- #import <Foundation/Foundation.h>
10
-
11
- #if __has_include(<React-RCTAppDelegate/RCTDependencyProvider.h>)
12
- #import <React-RCTAppDelegate/RCTDependencyProvider.h>
13
- #elif __has_include(<React_RCTAppDelegate/RCTDependencyProvider.h>)
14
- #import <React_RCTAppDelegate/RCTDependencyProvider.h>
15
- #else
16
- #import "RCTDependencyProvider.h"
17
- #endif
18
-
19
- NS_ASSUME_NONNULL_BEGIN
20
-
21
- @interface RCTAppDependencyProvider : NSObject <RCTDependencyProvider>
22
-
23
- @end
24
-
25
- NS_ASSUME_NONNULL_END
@@ -1,40 +0,0 @@
1
- /*
2
- * Copyright (c) Meta Platforms, Inc. and 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
- #import "RCTAppDependencyProvider.h"
9
- #import <ReactCodegen/RCTModulesConformingToProtocolsProvider.h>
10
- #import <ReactCodegen/RCTThirdPartyComponentsProvider.h>
11
- #import <ReactCodegen/RCTUnstableModulesRequiringMainQueueSetupProvider.h>
12
- #import <ReactCodegen/RCTModuleProviders.h>
13
-
14
- @implementation RCTAppDependencyProvider
15
-
16
- - (nonnull NSArray<NSString *> *)URLRequestHandlerClassNames {
17
- return RCTModulesConformingToProtocolsProvider.URLRequestHandlerClassNames;
18
- }
19
-
20
- - (nonnull NSArray<NSString *> *)imageDataDecoderClassNames {
21
- return RCTModulesConformingToProtocolsProvider.imageDataDecoderClassNames;
22
- }
23
-
24
- - (nonnull NSArray<NSString *> *)imageURLLoaderClassNames {
25
- return RCTModulesConformingToProtocolsProvider.imageURLLoaderClassNames;
26
- }
27
-
28
- - (nonnull NSArray<NSString *> *)unstableModulesRequiringMainQueueSetup {
29
- return RCTUnstableModulesRequiringMainQueueSetupProvider.modules;
30
- }
31
-
32
- - (nonnull NSDictionary<NSString *,Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents {
33
- return RCTThirdPartyComponentsProvider.thirdPartyFabricComponents;
34
- }
35
-
36
- - (nonnull NSDictionary<NSString *, id<RCTModuleProvider>> *)moduleProviders {
37
- return RCTModuleProviders.moduleProviders;
38
- }
39
-
40
- @end
@@ -1,34 +0,0 @@
1
- # Copyright (c) Meta Platforms, Inc. and 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
- version = "0.84.0"
7
- source = { :git => 'https://github.com/facebook/react-native.git' }
8
- if version == '1000.0.0'
9
- # This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
10
- source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
11
- else
12
- source[:tag] = "v#{version}"
13
- end
14
-
15
- Pod::Spec.new do |s|
16
- s.name = "ReactAppDependencyProvider"
17
- s.version = version
18
- s.summary = "The third party dependency provider for the app"
19
- s.homepage = "https://reactnative.dev/"
20
- s.documentation_url = "https://reactnative.dev/"
21
- s.license = "MIT"
22
- s.author = "Meta Platforms, Inc. and its affiliates"
23
- s.platforms = min_supported_versions
24
- s.source = source
25
- s.source_files = "**/RCTAppDependencyProvider.{h,mm}"
26
-
27
- # This guard prevent to install the dependencies when we run `pod install` in the old architecture.
28
- s.pod_target_xcconfig = {
29
- "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
30
- "DEFINES_MODULE" => "YES"
31
- }
32
-
33
- s.dependency "ReactCodegen"
34
- end
@@ -1,16 +0,0 @@
1
- /*
2
- * Copyright (c) Meta Platforms, Inc. and 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
- #import <Foundation/Foundation.h>
9
-
10
- @protocol RCTModuleProvider;
11
-
12
- @interface RCTModuleProviders: NSObject
13
-
14
- + (NSDictionary<NSString *, id<RCTModuleProvider>> *)moduleProviders;
15
-
16
- @end
@@ -1,51 +0,0 @@
1
- /*
2
- * Copyright (c) Meta Platforms, Inc. and 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
- #import <Foundation/Foundation.h>
9
-
10
- #import "RCTModuleProviders.h"
11
- #import <ReactCommon/RCTTurboModule.h>
12
- #import <React/RCTLog.h>
13
-
14
- @implementation RCTModuleProviders
15
-
16
- + (NSDictionary<NSString *, id<RCTModuleProvider>> *)moduleProviders
17
- {
18
- static NSDictionary<NSString *, id<RCTModuleProvider>> *providers = nil;
19
- static dispatch_once_t onceToken;
20
-
21
- dispatch_once(&onceToken, ^{
22
- NSDictionary<NSString *, NSString *> * moduleMapping = @{
23
-
24
- };
25
-
26
- NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithCapacity:moduleMapping.count];
27
-
28
- for (NSString *key in moduleMapping) {
29
- NSString * moduleProviderName = moduleMapping[key];
30
- Class klass = NSClassFromString(moduleProviderName);
31
- if (!klass) {
32
- RCTLogError(@"Module provider %@ cannot be found in the runtime", moduleProviderName);
33
- continue;
34
- }
35
-
36
- id instance = [klass new];
37
- if (![instance respondsToSelector:@selector(getTurboModule:)]) {
38
- RCTLogError(@"Module provider %@ does not conform to RCTModuleProvider", moduleProviderName);
39
- continue;
40
- }
41
-
42
- [dict setObject:instance forKey:key];
43
- }
44
-
45
- providers = dict;
46
- });
47
-
48
- return providers;
49
- }
50
-
51
- @end
@@ -1,18 +0,0 @@
1
- /*
2
- * Copyright (c) Meta Platforms, Inc. and 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
- #import <Foundation/Foundation.h>
9
-
10
- @interface RCTModulesConformingToProtocolsProvider: NSObject
11
-
12
- +(NSArray<NSString *> *)imageURLLoaderClassNames;
13
-
14
- +(NSArray<NSString *> *)imageDataDecoderClassNames;
15
-
16
- +(NSArray<NSString *> *)URLRequestHandlerClassNames;
17
-
18
- @end
@@ -1,54 +0,0 @@
1
- /*
2
- * Copyright (c) Meta Platforms, Inc. and 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
- #import "RCTModulesConformingToProtocolsProvider.h"
9
-
10
- @implementation RCTModulesConformingToProtocolsProvider
11
-
12
- +(NSArray<NSString *> *)imageURLLoaderClassNames
13
- {
14
- static NSArray<NSString *> *classNames = nil;
15
- static dispatch_once_t onceToken;
16
-
17
- dispatch_once(&onceToken, ^{
18
- classNames = @[
19
-
20
- ];
21
- });
22
-
23
- return classNames;
24
- }
25
-
26
- +(NSArray<NSString *> *)imageDataDecoderClassNames
27
- {
28
- static NSArray<NSString *> *classNames = nil;
29
- static dispatch_once_t onceToken;
30
-
31
- dispatch_once(&onceToken, ^{
32
- classNames = @[
33
-
34
- ];
35
- });
36
-
37
- return classNames;
38
- }
39
-
40
- +(NSArray<NSString *> *)URLRequestHandlerClassNames
41
- {
42
- static NSArray<NSString *> *classNames = nil;
43
- static dispatch_once_t onceToken;
44
-
45
- dispatch_once(&onceToken, ^{
46
- classNames = @[
47
-
48
- ];
49
- });
50
-
51
- return classNames;
52
- }
53
-
54
- @end
@@ -1,16 +0,0 @@
1
- /*
2
- * Copyright (c) Meta Platforms, Inc. and 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
- #import <Foundation/Foundation.h>
9
-
10
- @protocol RCTComponentViewProtocol;
11
-
12
- @interface RCTThirdPartyComponentsProvider: NSObject
13
-
14
- + (NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents;
15
-
16
- @end
@@ -1,30 +0,0 @@
1
- /*
2
- * Copyright (c) Meta Platforms, Inc. and 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
-
9
- #import <Foundation/Foundation.h>
10
-
11
- #import "RCTThirdPartyComponentsProvider.h"
12
- #import <React/RCTComponentViewProtocol.h>
13
-
14
- @implementation RCTThirdPartyComponentsProvider
15
-
16
- + (NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents
17
- {
18
- static NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *thirdPartyComponents = nil;
19
- static dispatch_once_t nativeComponentsToken;
20
-
21
- dispatch_once(&nativeComponentsToken, ^{
22
- thirdPartyComponents = @{
23
-
24
- };
25
- });
26
-
27
- return thirdPartyComponents;
28
- }
29
-
30
- @end
@@ -1,14 +0,0 @@
1
- /*
2
- * Copyright (c) Meta Platforms, Inc. and 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
- #import <Foundation/Foundation.h>
9
-
10
- @interface RCTUnstableModulesRequiringMainQueueSetupProvider: NSObject
11
-
12
- +(NSArray<NSString *> *)modules;
13
-
14
- @end
@@ -1,19 +0,0 @@
1
- /*
2
- * Copyright (c) Meta Platforms, Inc. and 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
- #import "RCTUnstableModulesRequiringMainQueueSetupProvider.h"
9
-
10
- @implementation RCTUnstableModulesRequiringMainQueueSetupProvider
11
-
12
- +(NSArray<NSString *> *)modules
13
- {
14
- return @[
15
-
16
- ];
17
- }
18
-
19
- @end
@@ -1,46 +0,0 @@
1
- /**
2
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be lost
5
- * once the code is regenerated.
6
- *
7
- * @generated by codegen project: GenerateModuleObjCpp
8
- *
9
- * We create an umbrella header (and corresponding implementation) here since
10
- * Cxx compilation in BUCK has a limitation: source-code producing genrule()s
11
- * must have a single output. More files => more genrule()s => slower builds.
12
- */
13
-
14
- #import "RNAesGcmSpec.h"
15
-
16
-
17
- @implementation NativeAesGcmSpecBase
18
-
19
-
20
- - (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper
21
- {
22
- _eventEmitterCallback = std::move(eventEmitterCallbackWrapper->_eventEmitterCallback);
23
- }
24
- @end
25
-
26
-
27
- namespace facebook::react {
28
-
29
- static facebook::jsi::Value __hostFunction_NativeAesGcmSpecJSI_encrypt(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
30
- return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "encrypt", @selector(encrypt:key:saltLength:ivLength:iterationCount:resolve:reject:), args, count);
31
- }
32
-
33
- static facebook::jsi::Value __hostFunction_NativeAesGcmSpecJSI_decrypt(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
34
- return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "decrypt", @selector(decrypt:key:saltLength:ivLength:iterationCount:resolve:reject:), args, count);
35
- }
36
-
37
- NativeAesGcmSpecJSI::NativeAesGcmSpecJSI(const ObjCTurboModule::InitParams &params)
38
- : ObjCTurboModule(params) {
39
-
40
- methodMap_["encrypt"] = MethodMetadata {5, __hostFunction_NativeAesGcmSpecJSI_encrypt};
41
-
42
-
43
- methodMap_["decrypt"] = MethodMetadata {5, __hostFunction_NativeAesGcmSpecJSI_decrypt};
44
-
45
- }
46
- } // namespace facebook::react
@@ -1,75 +0,0 @@
1
- /**
2
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be lost
5
- * once the code is regenerated.
6
- *
7
- * @generated by codegen project: GenerateModuleObjCpp
8
- *
9
- * We create an umbrella header (and corresponding implementation) here since
10
- * Cxx compilation in BUCK has a limitation: source-code producing genrule()s
11
- * must have a single output. More files => more genrule()s => slower builds.
12
- */
13
-
14
- #ifndef __cplusplus
15
- #error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm.
16
- #endif
17
-
18
- // Avoid multiple includes of RNAesGcmSpec symbols
19
- #ifndef RNAesGcmSpec_H
20
- #define RNAesGcmSpec_H
21
-
22
- #import <Foundation/Foundation.h>
23
- #import <RCTRequired/RCTRequired.h>
24
- #import <RCTTypeSafety/RCTConvertHelpers.h>
25
- #import <RCTTypeSafety/RCTTypedModuleConstants.h>
26
- #import <React/RCTBridgeModule.h>
27
- #import <React/RCTCxxConvert.h>
28
- #import <React/RCTManagedPointer.h>
29
- #import <ReactCommon/RCTTurboModule.h>
30
- #import <optional>
31
- #import <vector>
32
-
33
-
34
- NS_ASSUME_NONNULL_BEGIN
35
-
36
- @protocol NativeAesGcmSpec <RCTBridgeModule, RCTTurboModule>
37
-
38
- - (void)encrypt:(NSString *)plainText
39
- key:(NSString *)key
40
- saltLength:(double)saltLength
41
- ivLength:(double)ivLength
42
- iterationCount:(double)iterationCount
43
- resolve:(RCTPromiseResolveBlock)resolve
44
- reject:(RCTPromiseRejectBlock)reject;
45
- - (void)decrypt:(NSString *)encryptedText
46
- key:(NSString *)key
47
- saltLength:(double)saltLength
48
- ivLength:(double)ivLength
49
- iterationCount:(double)iterationCount
50
- resolve:(RCTPromiseResolveBlock)resolve
51
- reject:(RCTPromiseRejectBlock)reject;
52
-
53
- @end
54
-
55
- @interface NativeAesGcmSpecBase : NSObject {
56
- @protected
57
- facebook::react::EventEmitterCallback _eventEmitterCallback;
58
- }
59
- - (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper;
60
-
61
-
62
- @end
63
-
64
- namespace facebook::react {
65
- /**
66
- * ObjC++ class for module 'NativeAesGcm'
67
- */
68
- class JSI_EXPORT NativeAesGcmSpecJSI : public ObjCTurboModule {
69
- public:
70
- NativeAesGcmSpecJSI(const ObjCTurboModule::InitParams &params);
71
- };
72
- } // namespace facebook::react
73
-
74
- NS_ASSUME_NONNULL_END
75
- #endif // RNAesGcmSpec_H
@@ -1,55 +0,0 @@
1
- /**
2
- * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3
- *
4
- * Do not edit this file as changes may cause incorrect behavior and will be lost
5
- * once the code is regenerated.
6
- *
7
- * @generated by codegen project: GenerateModuleH.js
8
- */
9
-
10
- #pragma once
11
-
12
- #include <ReactCommon/TurboModule.h>
13
- #include <react/bridging/Bridging.h>
14
-
15
- namespace facebook::react {
16
-
17
-
18
- template <typename T>
19
- class JSI_EXPORT NativeAesGcmCxxSpec : public TurboModule {
20
- public:
21
- static constexpr std::string_view kModuleName = "AesGcm";
22
-
23
- protected:
24
- NativeAesGcmCxxSpec(std::shared_ptr<CallInvoker> jsInvoker) : TurboModule(std::string{NativeAesGcmCxxSpec::kModuleName}, jsInvoker) {
25
- methodMap_["encrypt"] = MethodMetadata {.argCount = 5, .invoker = __encrypt};
26
- methodMap_["decrypt"] = MethodMetadata {.argCount = 5, .invoker = __decrypt};
27
- }
28
-
29
- private:
30
- static jsi::Value __encrypt(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
31
- static_assert(
32
- bridging::getParameterCount(&T::encrypt) == 6,
33
- "Expected encrypt(...) to have 6 parameters");
34
- return bridging::callFromJs<jsi::Value>(rt, &T::encrypt, static_cast<NativeAesGcmCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
35
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
36
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
37
- count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(),
38
- count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asNumber(),
39
- count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asNumber());
40
- }
41
-
42
- static jsi::Value __decrypt(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
43
- static_assert(
44
- bridging::getParameterCount(&T::decrypt) == 6,
45
- "Expected decrypt(...) to have 6 parameters");
46
- return bridging::callFromJs<jsi::Value>(rt, &T::decrypt, static_cast<NativeAesGcmCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
47
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
48
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
49
- count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(),
50
- count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asNumber(),
51
- count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asNumber());
52
- }
53
- };
54
-
55
- } // namespace facebook::react
@@ -1,110 +0,0 @@
1
- # Copyright (c) Meta Platforms, Inc. and 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
- version = "0.84.0"
7
- source = { :git => 'https://github.com/facebook/react-native.git' }
8
- if version == '1000.0.0'
9
- # This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
10
- source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
11
- else
12
- source[:tag] = "v#{version}"
13
- end
14
-
15
- use_frameworks = ENV['USE_FRAMEWORKS'] != nil
16
- folly_compiler_flags = Helpers::Constants.folly_config[:compiler_flags]
17
- boost_compiler_flags = Helpers::Constants.boost_config[:compiler_flags]
18
-
19
- header_search_paths = []
20
- framework_search_paths = []
21
-
22
- header_search_paths = [
23
- "\"$(PODS_ROOT)/ReactNativeDependencies\"",
24
- "\"${PODS_ROOT}/Headers/Public/ReactCodegen/react/renderer/components\"",
25
- "\"$(PODS_ROOT)/Headers/Private/React-Fabric\"",
26
- "\"$(PODS_ROOT)/Headers/Private/React-RCTFabric\"",
27
- "\"$(PODS_ROOT)/Headers/Private/Yoga\"",
28
- "\"$(PODS_TARGET_SRCROOT)\"",
29
- ]
30
-
31
- if use_frameworks
32
- ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-Fabric", "React_Fabric", ["react/renderer/components/view/platform/cxx"])
33
- .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-FabricImage", "React_FabricImage", []))
34
- .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-graphics", "React_graphics", ["react/renderer/graphics/platform/ios"]))
35
- .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "ReactCommon", "ReactCommon", ["react/nativemodule/core"]))
36
- .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-runtimeexecutor", "React_runtimeexecutor", ["platform/ios"]))
37
- .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-NativeModulesApple", "React_NativeModulesApple", []))
38
- .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-RCTFabric", "RCTFabric", []))
39
- .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-debug", "React_debug", []))
40
- .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-rendererdebug", "React_rendererdebug", []))
41
- .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-utils", "React_utils", []))
42
- .concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-featureflags", "React_featureflags", []))
43
- .each { |search_path|
44
- header_search_paths << "\"#{search_path}\""
45
- }
46
- end
47
-
48
- Pod::Spec.new do |s|
49
- s.name = "ReactCodegen"
50
- s.version = version
51
- s.summary = 'Temp pod for generated files for React Native'
52
- s.homepage = 'https://facebook.com/'
53
- s.license = 'Unlicense'
54
- s.authors = 'Facebook'
55
- s.compiler_flags = "#{folly_compiler_flags} #{boost_compiler_flags} -Wno-nullability-completeness -std=c++20"
56
- s.source = { :git => '' }
57
- s.header_mappings_dir = './'
58
- s.platforms = min_supported_versions
59
- s.source_files = "**/*.{h,mm,cpp}"
60
- s.exclude_files = "RCTAppDependencyProvider.{h,mm}" # these files are generated in the same codegen path but needs to belong to a different pod
61
- s.pod_target_xcconfig = {
62
- "HEADER_SEARCH_PATHS" => header_search_paths.join(' '),
63
- "FRAMEWORK_SEARCH_PATHS" => framework_search_paths,
64
- "OTHER_CPLUSPLUSFLAGS" => "$(inherited) #{folly_compiler_flags} #{boost_compiler_flags}"
65
- }
66
-
67
- s.dependency "React-jsiexecutor"
68
- s.dependency "RCTRequired"
69
- s.dependency "RCTTypeSafety"
70
- s.dependency "React-Core"
71
- s.dependency "React-jsi"
72
- s.dependency "ReactCommon/turbomodule/bridging"
73
- s.dependency "ReactCommon/turbomodule/core"
74
- s.dependency "React-NativeModulesApple"
75
- s.dependency 'React-graphics'
76
- s.dependency 'React-rendererdebug'
77
- s.dependency 'React-Fabric'
78
- s.dependency 'React-FabricImage'
79
- s.dependency 'React-debug'
80
- s.dependency 'React-utils'
81
- s.dependency 'React-featureflags'
82
- s.dependency 'React-RCTAppDelegate'
83
-
84
- depend_on_js_engine(s)
85
- add_rn_third_party_dependencies(s)
86
- add_rncore_dependency(s)
87
-
88
- s.script_phases = {
89
- 'name' => 'Generate Specs',
90
- 'execution_position' => :before_compile,
91
- 'input_files' => ["${PODS_ROOT}/../../../src/NativeAesGcm.ts"],
92
- 'show_env_vars_in_log' => true,
93
- 'output_files' => ["${DERIVED_FILE_DIR}/react-codegen.log"],
94
- 'script': <<-SCRIPT
95
- pushd "$PODS_ROOT/../" > /dev/null
96
- RCT_SCRIPT_POD_INSTALLATION_ROOT=$(pwd)
97
- popd >/dev/null
98
-
99
- export RCT_SCRIPT_RN_DIR="$RCT_SCRIPT_POD_INSTALLATION_ROOT/../../node_modules/react-native"
100
- export RCT_SCRIPT_APP_PATH="$RCT_SCRIPT_POD_INSTALLATION_ROOT/../.."
101
- export RCT_SCRIPT_OUTPUT_DIR="$RCT_SCRIPT_POD_INSTALLATION_ROOT"
102
- export RCT_SCRIPT_TYPE="withCodegenDiscovery"
103
-
104
- export SCRIPT_PHASES_SCRIPT="$RCT_SCRIPT_RN_DIR/scripts/react_native_pods_utils/script_phases.sh"
105
- export WITH_ENVIRONMENT="$RCT_SCRIPT_RN_DIR/scripts/xcode/with-environment.sh"
106
- /bin/sh -c '"$WITH_ENVIRONMENT" "$SCRIPT_PHASES_SCRIPT"'
107
- SCRIPT
108
- }
109
-
110
- end