From b969377db76abce9ae0109f8a67b55023ee455c4 Mon Sep 17 00:00:00 2001 From: David Govea Date: Sun, 2 Jun 2019 16:55:59 -0700 Subject: [PATCH] Add react-native-gesture-handler config for ios and android --- .../GestureHandlerPlugin.java | 23 +++++++++ .../config.json | 49 +++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 plugins/ern_v0.14.0+/react-native-gesture-handler_v1.0.15+/GestureHandlerPlugin.java create mode 100644 plugins/ern_v0.14.0+/react-native-gesture-handler_v1.0.15+/config.json diff --git a/plugins/ern_v0.14.0+/react-native-gesture-handler_v1.0.15+/GestureHandlerPlugin.java b/plugins/ern_v0.14.0+/react-native-gesture-handler_v1.0.15+/GestureHandlerPlugin.java new file mode 100644 index 0000000..0351d6e --- /dev/null +++ b/plugins/ern_v0.14.0+/react-native-gesture-handler_v1.0.15+/GestureHandlerPlugin.java @@ -0,0 +1,23 @@ +package com.walmartlabs.ern.container.plugins; + +import android.app.Application; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; + +import com.facebook.react.ReactInstanceManagerBuilder; +import com.facebook.react.ReactPackage; +import com.swmansion.gesturehandler.react.RNGestureHandlerPackage; + +public class GestureHandlerPlugin implements ReactPlugin { + + public ReactPackage hook( + @NonNull + Application application, + @Nullable + ReactPluginConfig config + ) { + return new RNGestureHandlerPackage(); + } + +} + diff --git a/plugins/ern_v0.14.0+/react-native-gesture-handler_v1.0.15+/config.json b/plugins/ern_v0.14.0+/react-native-gesture-handler_v1.0.15+/config.json new file mode 100644 index 0000000..87d3f4f --- /dev/null +++ b/plugins/ern_v0.14.0+/react-native-gesture-handler_v1.0.15+/config.json @@ -0,0 +1,49 @@ +{ + "android": { + "root": "", + "moduleName": "android", + "copy": [ + { + "source": "android/lib/src/main/java/**", + "dest": "lib/src/main/java" + } + ], + "replaceInFile": [ + { + "path": "lib/src/main/java/com/walmartlabs/ern/container/ElectrodeReactActivityDelegate.java", + "string": "import com.facebook.react.ReactRootView;", + "replaceWith": "import com.facebook.react.ReactRootView;\nimport com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;" + }, + { + "path": "lib/src/main/java/com/walmartlabs/ern/container/ElectrodeReactActivityDelegate.java", + "string": " }\n}", + "replaceWith": " }\n\n @Override\n protected ReactRootView createRootView() {\n return new RNGestureHandlerEnabledRootView(getContext());\n }\n}" + } + ] + }, + "ios": { + "copy": [ + { + "source": "ios/**", + "dest": "{{{projectName}}}/Libraries/RNGestureHandler" + } + ], + "pbxproj": { + "addProject": [ + { + "path": "RNGestureHandler/RNGestureHandler.xcodeproj", + "group": "Libraries", + "staticLibs": [ + { + "name": "libRNGestureHandler.a", + "target": "RNGestureHandler" + } + ] + } + ], + "addHeaderSearchPath": [ + "\"$(SRCROOT)/{{{projectName}}}/Libraries/RNGestureHandler/**\"" + ] + } + } +}