Skip to content

Commit

Permalink
Merge pull request #924 from guhungry/Fix/cant-compile-in-v1.7.0
Browse files Browse the repository at this point in the history
Fix/cant compile in v1.7.0
  • Loading branch information
guhungry authored Sep 9, 2024
2 parents 7fd2edb + ce1ec33 commit 6643d92
Show file tree
Hide file tree
Showing 46 changed files with 2,071 additions and 995 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/test-and-rebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ jobs:
- name: Build iOS Release
run: |
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"
cd example/ios && pod install --deployment && cd -
cd example/ios && pod repo update && pod update && cd -
yarn turbo run test:ios:build --cache-dir="${{ env.TURBO_CACHE_DIR }}"
env:
RCT_NEW_ARCH_ENABLED: 1
Expand All @@ -224,4 +224,6 @@ jobs:
- uses: dniHze/maestro-test-action@v1

- name: Run Tests
run: yarn example test:ios:run
run: yarn example test:ios:run
env:
MAESTRO_DRIVER_STARTUP_TIMEOUT: 60000
5 changes: 3 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ android {
if (isNewArchitectureEnabled()) {
java.srcDirs += [
"src/newarch",
// This is needed to build Kotlin project with NewArch enabled
"${project.buildDir}/generated/source/codegen/java"
// Codegen specs
"generated/java",
"generated/jni"
]
} else {
java.srcDirs += ["src/oldarch"]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@

/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateModuleJavaSpec.js
*
* @nolint
*/

package com.guhungry.rnphotomanipulator;

import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

public abstract class NativeRNPhotoManipulatorSpec extends ReactContextBaseJavaModule implements TurboModule {
public static final String NAME = "RNPhotoManipulator";

public NativeRNPhotoManipulatorSpec(ReactApplicationContext reactContext) {
super(reactContext);
}

@Override
public @Nonnull String getName() {
return NAME;
}

@ReactMethod
@DoNotStrip
public abstract void batch(String image, ReadableArray operations, ReadableMap cropRegion, @Nullable ReadableMap targetSize, @Nullable Double quality, @Nullable String mimeType, Promise promise);

@ReactMethod
@DoNotStrip
public abstract void crop(String image, ReadableMap cropRegion, @Nullable ReadableMap targetSize, @Nullable String mimeType, Promise promise);

@ReactMethod
@DoNotStrip
public abstract void flipImage(String image, String mode, @Nullable String mimeType, Promise promise);

@ReactMethod
@DoNotStrip
public abstract void rotateImage(String image, String mode, @Nullable String mimeType, Promise promise);

@ReactMethod
@DoNotStrip
public abstract void overlayImage(String image, String overlay, ReadableMap position, @Nullable String mimeType, Promise promise);

@ReactMethod
@DoNotStrip
public abstract void printText(String image, ReadableArray texts, @Nullable String mimeType, Promise promise);

@ReactMethod
@DoNotStrip
public abstract void optimize(String image, double quality, Promise promise);
}
49 changes: 49 additions & 0 deletions android/generated/jni/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

cmake_minimum_required(VERSION 3.13)
set(CMAKE_VERBOSE_MAKEFILE on)

file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/RNPhotoManipulatorSpec/*.cpp)

add_library(
react_codegen_RNPhotoManipulatorSpec
SHARED
${react_codegen_SRCS}
)

target_include_directories(react_codegen_RNPhotoManipulatorSpec PUBLIC . react/renderer/components/RNPhotoManipulatorSpec)

target_link_libraries(
react_codegen_RNPhotoManipulatorSpec
fbjni
folly_runtime
glog
jsi
react_codegen_rncore
react_debug
react_nativemodule_core
react_render_componentregistry
react_render_core
react_render_debug
react_render_graphics
react_render_imagemanager
react_render_mapbuffer
react_utils
rrc_image
rrc_view
turbomodulejsijni
yoga
)

target_compile_options(
react_codegen_RNPhotoManipulatorSpec
PRIVATE
-DLOG_TAG=\"ReactNative\"
-fexceptions
-frtti
-std=c++20
-Wall
)
68 changes: 68 additions & 0 deletions android/generated/jni/RNPhotoManipulatorSpec-generated.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@

/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateModuleJniCpp.js
*/

#include "RNPhotoManipulatorSpec.h"

namespace facebook::react {

static facebook::jsi::Value __hostFunction_NativeRNPhotoManipulatorSpecJSI_batch(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
static jmethodID cachedMethodId = nullptr;
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "batch", "(Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/ReadableMap;Ljava/lang/Double;Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
}

static facebook::jsi::Value __hostFunction_NativeRNPhotoManipulatorSpecJSI_crop(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
static jmethodID cachedMethodId = nullptr;
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "crop", "(Ljava/lang/String;Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/ReadableMap;Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
}

static facebook::jsi::Value __hostFunction_NativeRNPhotoManipulatorSpecJSI_flipImage(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
static jmethodID cachedMethodId = nullptr;
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "flipImage", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
}

static facebook::jsi::Value __hostFunction_NativeRNPhotoManipulatorSpecJSI_rotateImage(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
static jmethodID cachedMethodId = nullptr;
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "rotateImage", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
}

static facebook::jsi::Value __hostFunction_NativeRNPhotoManipulatorSpecJSI_overlayImage(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
static jmethodID cachedMethodId = nullptr;
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "overlayImage", "(Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/bridge/ReadableMap;Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
}

static facebook::jsi::Value __hostFunction_NativeRNPhotoManipulatorSpecJSI_printText(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
static jmethodID cachedMethodId = nullptr;
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "printText", "(Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
}

static facebook::jsi::Value __hostFunction_NativeRNPhotoManipulatorSpecJSI_optimize(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
static jmethodID cachedMethodId = nullptr;
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "optimize", "(Ljava/lang/String;DLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
}

NativeRNPhotoManipulatorSpecJSI::NativeRNPhotoManipulatorSpecJSI(const JavaTurboModule::InitParams &params)
: JavaTurboModule(params) {
methodMap_["batch"] = MethodMetadata {6, __hostFunction_NativeRNPhotoManipulatorSpecJSI_batch};
methodMap_["crop"] = MethodMetadata {4, __hostFunction_NativeRNPhotoManipulatorSpecJSI_crop};
methodMap_["flipImage"] = MethodMetadata {3, __hostFunction_NativeRNPhotoManipulatorSpecJSI_flipImage};
methodMap_["rotateImage"] = MethodMetadata {3, __hostFunction_NativeRNPhotoManipulatorSpecJSI_rotateImage};
methodMap_["overlayImage"] = MethodMetadata {4, __hostFunction_NativeRNPhotoManipulatorSpecJSI_overlayImage};
methodMap_["printText"] = MethodMetadata {3, __hostFunction_NativeRNPhotoManipulatorSpecJSI_printText};
methodMap_["optimize"] = MethodMetadata {2, __hostFunction_NativeRNPhotoManipulatorSpecJSI_optimize};
}

std::shared_ptr<TurboModule> RNPhotoManipulatorSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams &params) {
if (moduleName == "RNPhotoManipulator") {
return std::make_shared<NativeRNPhotoManipulatorSpecJSI>(params);
}
return nullptr;
}

} // namespace facebook::react
31 changes: 31 additions & 0 deletions android/generated/jni/RNPhotoManipulatorSpec.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateModuleJniH.js
*/

#pragma once

#include <ReactCommon/JavaTurboModule.h>
#include <ReactCommon/TurboModule.h>
#include <jsi/jsi.h>

namespace facebook::react {

/**
* JNI C++ class for module 'NativeRNPhotoManipulator'
*/
class JSI_EXPORT NativeRNPhotoManipulatorSpecJSI : public JavaTurboModule {
public:
NativeRNPhotoManipulatorSpecJSI(const JavaTurboModule::InitParams &params);
};


JSI_EXPORT
std::shared_ptr<TurboModule> RNPhotoManipulatorSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams &params);

} // namespace facebook::react
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateComponentDescriptorCpp.js
*/

#include "ComponentDescriptors.h"
#include <react/renderer/core/ConcreteComponentDescriptor.h>
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>

namespace facebook::react {

void RNPhotoManipulatorSpec_registerComponentDescriptorsFromCodegen(
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {

}

} // namespace facebook::react
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateComponentDescriptorH.js
*/

#pragma once

#include "ShadowNodes.h"
#include <react/renderer/core/ConcreteComponentDescriptor.h>
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>

namespace facebook::react {



void RNPhotoManipulatorSpec_registerComponentDescriptorsFromCodegen(
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);

} // namespace facebook::react
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateEventEmitterCpp.js
*/

#include "EventEmitters.h"


namespace facebook::react {

} // namespace facebook::react
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateEventEmitterH.js
*/
#pragma once

#include <react/renderer/components/view/ViewEventEmitter.h>


namespace facebook::react {

} // namespace facebook::react
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GeneratePropsCpp.js
*/

#include "Props.h"
#include <react/renderer/core/PropsParserContext.h>
#include <react/renderer/core/propsConversions.h>

namespace facebook::react {



} // namespace facebook::react
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GeneratePropsH.js
*/
#pragma once



namespace facebook::react {



} // namespace facebook::react
Loading

0 comments on commit 6643d92

Please sign in to comment.