diff --git a/.github/workflows/build-android-fabric-windows.yml b/.github/workflows/build-android-fabric-windows.yml new file mode 100644 index 0000000000..38ad9ee4e9 --- /dev/null +++ b/.github/workflows/build-android-fabric-windows.yml @@ -0,0 +1,69 @@ +name: 🤖 Build Android Fabric + +on: + push: + branches: + - main + paths: + - ".github/workflows/build-android-fabric-windows.yml" + - "android/**" + - "yarn.lock" + - "src/specs/**" + - "common/**" + pull_request: + paths: + - ".github/workflows/build-android-fabric-windows.yml" + - "android/**" + - "yarn.lock" + - "src/specs/**" + - "common/**" + +jobs: + build: + name: 💠 Build Android on Windows + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup JDK 17 + uses: actions/setup-java@v4 + with: + distribution: "microsoft" + java-version: "17" + - name: Create sample app + run: cd ..\..\ && npx @react-native-community/cli@latest init WindowsWithUnbelievablyHugeAndReallyLongPathName --version 0.83.1 + - name: Get yarn cache directory path + id: fabric-windows-yarn-cache-dir-path + shell: pwsh + run: | + $dir = yarn cache dir + echo "dir=$dir" >> $env:GITHUB_OUTPUT + - name: Restore node_modules from cache + uses: actions/cache@v4 + id: yarn-cache + with: + path: ${{ steps.fabric-windows-yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-fabric-windows-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-fabric-windows-yarn- + - name: Install node_modules for windows/ + shell: pwsh + run: | + cd ..\..\ && yarn install --frozen-lockfile --cwd WindowsWithUnbelievablyHugeAndReallyLongPathName + - name: Link keyboard controller + shell: pwsh + run: cd ..\..\WindowsWithUnbelievablyHugeAndReallyLongPathName && yarn add react-native-keyboard-controller@link:../react-native-keyboard-controller/react-native-keyboard-controller + - name: Restore Gradle cache + uses: actions/cache@v4 + with: + path: | + C:\Users\runneradmin\.gradle\caches + C:\Users\runneradmin\.gradle\wrapper + key: ${{ runner.os }}-fabric-windows-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-fabric-windows-gradle- + - name: Run Gradle Build for windows/android/ + shell: pwsh + run: | + cd ..\..\WindowsWithUnbelievablyHugeAndReallyLongPathName\android + .\gradlew.bat assembleDebug --build-cache -PreactNativeArchitectures=arm64-v8a diff --git a/.github/workflows/build-android-fabric.yml b/.github/workflows/build-android-fabric.yml index 55bf1df4c9..5bd6ab1d4a 100644 --- a/.github/workflows/build-android-fabric.yml +++ b/.github/workflows/build-android-fabric.yml @@ -26,7 +26,7 @@ on: jobs: build: - name: Build Android Fabric Example App + name: 🖥️ Build Android Fabric Example App runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/FabricExample/ios/Podfile.lock b/FabricExample/ios/Podfile.lock index 0a5a53acbb..11be07da67 100644 --- a/FabricExample/ios/Podfile.lock +++ b/FabricExample/ios/Podfile.lock @@ -3117,7 +3117,7 @@ SPEC CHECKSUMS: React-microtasksnativemodule: 44b44a4d3cd6ffb85d928abf741acdc26722de2e react-native-advanced-input-mask: 7e8cb58287774c4447485387661abe946d0e0bb2 react-native-blur: ba0e9ad6274783c8d45f42da82acae02e25784ad - react-native-keyboard-controller: d07a35e49d478d26b2eb44b10aedc4e1d35354d6 + react-native-keyboard-controller: 0bf45b0ab9c8f2caf632832e80abfd33978d212c react-native-safe-area-context: 6d8a7b750e496e37bda47c938320bf2c734d441f React-NativeModulesApple: b5d18bc109c45c9a1c6b71664991b5cc3adc4e48 React-oscompat: 93b5535ea7f7dff46aaee4f78309a70979bdde9d diff --git a/android/src/main/jni/CMakeLists.txt b/android/src/main/jni/CMakeLists.txt index e1a19eeb15..5302222385 100644 --- a/android/src/main/jni/CMakeLists.txt +++ b/android/src/main/jni/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE ON) -set(LIB_LITERAL keyboardcontroller) +set(LIB_LITERAL RNKC) set(LIB_TARGET_NAME react_codegen_${LIB_LITERAL}) set(LIB_ANDROID_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../..) diff --git a/android/src/main/jni/RNKC.h b/android/src/main/jni/RNKC.h new file mode 100644 index 0000000000..b8a0c49e99 --- /dev/null +++ b/android/src/main/jni/RNKC.h @@ -0,0 +1,24 @@ +#pragma once + +#include +#include +#include + +/** + * Note this import and that it is not present in autogenerated header file + * under android/build/generated/source/codegen/jni/RNKC.h + * + * Here we are overriding autogenerated component descriptors by prioritizing our custom headers via include path setup. + */ +#include +#include +#include +#include + +#include +#include + +namespace facebook::react { + JSI_EXPORT + std::shared_ptr RNKC_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms); +} // namespace facebook::react diff --git a/android/src/main/jni/keyboardcontroller.h b/android/src/main/jni/keyboardcontroller.h deleted file mode 100644 index 499f624b52..0000000000 --- a/android/src/main/jni/keyboardcontroller.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include -#include -#include - -/** - * Note this import and that it is not present in autogenerated header file - * under android/build/generated/source/codegen/jni/keyboardcontroller.h - * - * Here we are overriding autogenerated component descriptors by prioritizing our custom headers via include path setup. - */ -#include -#include -#include -#include - -#include -#include - -namespace facebook::react { - JSI_EXPORT - std::shared_ptr keyboardcontroller_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms); -} // namespace facebook::react diff --git a/common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardBackgroundViewComponentDescriptor.h b/common/cpp/react/renderer/components/RNKC/RNKCKeyboardBackgroundViewComponentDescriptor.h similarity index 92% rename from common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardBackgroundViewComponentDescriptor.h rename to common/cpp/react/renderer/components/RNKC/RNKCKeyboardBackgroundViewComponentDescriptor.h index f30b2cf7a9..0c20ce601c 100644 --- a/common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardBackgroundViewComponentDescriptor.h +++ b/common/cpp/react/renderer/components/RNKC/RNKCKeyboardBackgroundViewComponentDescriptor.h @@ -10,7 +10,7 @@ #include "RNKCKeyboardBackgroundViewShadowNode.h" #include -#include +#include #include namespace facebook::react { diff --git a/common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardBackgroundViewShadowNode.cpp b/common/cpp/react/renderer/components/RNKC/RNKCKeyboardBackgroundViewShadowNode.cpp similarity index 100% rename from common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardBackgroundViewShadowNode.cpp rename to common/cpp/react/renderer/components/RNKC/RNKCKeyboardBackgroundViewShadowNode.cpp diff --git a/common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardBackgroundViewShadowNode.h b/common/cpp/react/renderer/components/RNKC/RNKCKeyboardBackgroundViewShadowNode.h similarity index 82% rename from common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardBackgroundViewShadowNode.h rename to common/cpp/react/renderer/components/RNKC/RNKCKeyboardBackgroundViewShadowNode.h index 7f8cb7e0e3..651f7651a5 100644 --- a/common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardBackgroundViewShadowNode.h +++ b/common/cpp/react/renderer/components/RNKC/RNKCKeyboardBackgroundViewShadowNode.h @@ -9,8 +9,8 @@ #include "RNKCKeyboardBackgroundViewState.h" -#include -#include +#include +#include #include #include diff --git a/common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardBackgroundViewState.h b/common/cpp/react/renderer/components/RNKC/RNKCKeyboardBackgroundViewState.h similarity index 100% rename from common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardBackgroundViewState.h rename to common/cpp/react/renderer/components/RNKC/RNKCKeyboardBackgroundViewState.h diff --git a/common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardControllerViewComponentDescriptor.h b/common/cpp/react/renderer/components/RNKC/RNKCKeyboardControllerViewComponentDescriptor.h similarity index 90% rename from common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardControllerViewComponentDescriptor.h rename to common/cpp/react/renderer/components/RNKC/RNKCKeyboardControllerViewComponentDescriptor.h index 130298f4c3..ba7576d9a8 100644 --- a/common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardControllerViewComponentDescriptor.h +++ b/common/cpp/react/renderer/components/RNKC/RNKCKeyboardControllerViewComponentDescriptor.h @@ -3,7 +3,7 @@ #include "RNKCKeyboardControllerViewShadowNode.h" #include -#include +#include #include namespace facebook::react { diff --git a/common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardControllerViewShadowNode.cpp b/common/cpp/react/renderer/components/RNKC/RNKCKeyboardControllerViewShadowNode.cpp similarity index 100% rename from common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardControllerViewShadowNode.cpp rename to common/cpp/react/renderer/components/RNKC/RNKCKeyboardControllerViewShadowNode.cpp diff --git a/common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardControllerViewShadowNode.h b/common/cpp/react/renderer/components/RNKC/RNKCKeyboardControllerViewShadowNode.h similarity index 80% rename from common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardControllerViewShadowNode.h rename to common/cpp/react/renderer/components/RNKC/RNKCKeyboardControllerViewShadowNode.h index 2723a66059..1f4b739c52 100644 --- a/common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardControllerViewShadowNode.h +++ b/common/cpp/react/renderer/components/RNKC/RNKCKeyboardControllerViewShadowNode.h @@ -2,8 +2,8 @@ #include "RNKCKeyboardControllerViewState.h" -#include -#include +#include +#include #include #include diff --git a/common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardControllerViewState.h b/common/cpp/react/renderer/components/RNKC/RNKCKeyboardControllerViewState.h similarity index 100% rename from common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardControllerViewState.h rename to common/cpp/react/renderer/components/RNKC/RNKCKeyboardControllerViewState.h diff --git a/common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardExtenderComponentDescriptor.h b/common/cpp/react/renderer/components/RNKC/RNKCKeyboardExtenderComponentDescriptor.h similarity index 91% rename from common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardExtenderComponentDescriptor.h rename to common/cpp/react/renderer/components/RNKC/RNKCKeyboardExtenderComponentDescriptor.h index 0f0a9214f3..cbdd5fc3d1 100644 --- a/common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardExtenderComponentDescriptor.h +++ b/common/cpp/react/renderer/components/RNKC/RNKCKeyboardExtenderComponentDescriptor.h @@ -10,7 +10,7 @@ #include "RNKCKeyboardExtenderShadowNode.h" #include -#include +#include #include namespace facebook::react { diff --git a/common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardExtenderShadowNode.cpp b/common/cpp/react/renderer/components/RNKC/RNKCKeyboardExtenderShadowNode.cpp similarity index 100% rename from common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardExtenderShadowNode.cpp rename to common/cpp/react/renderer/components/RNKC/RNKCKeyboardExtenderShadowNode.cpp diff --git a/common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardExtenderShadowNode.h b/common/cpp/react/renderer/components/RNKC/RNKCKeyboardExtenderShadowNode.h similarity index 81% rename from common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardExtenderShadowNode.h rename to common/cpp/react/renderer/components/RNKC/RNKCKeyboardExtenderShadowNode.h index 394296ab7c..ac4a534767 100644 --- a/common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardExtenderShadowNode.h +++ b/common/cpp/react/renderer/components/RNKC/RNKCKeyboardExtenderShadowNode.h @@ -9,8 +9,8 @@ #include "RNKCKeyboardExtenderState.h" -#include -#include +#include +#include #include #include diff --git a/common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardExtenderState.h b/common/cpp/react/renderer/components/RNKC/RNKCKeyboardExtenderState.h similarity index 100% rename from common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardExtenderState.h rename to common/cpp/react/renderer/components/RNKC/RNKCKeyboardExtenderState.h diff --git a/common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardGestureAreaComponentDescriptor.h b/common/cpp/react/renderer/components/RNKC/RNKCKeyboardGestureAreaComponentDescriptor.h similarity index 90% rename from common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardGestureAreaComponentDescriptor.h rename to common/cpp/react/renderer/components/RNKC/RNKCKeyboardGestureAreaComponentDescriptor.h index 53e139246f..2614649718 100644 --- a/common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardGestureAreaComponentDescriptor.h +++ b/common/cpp/react/renderer/components/RNKC/RNKCKeyboardGestureAreaComponentDescriptor.h @@ -3,7 +3,7 @@ #include "RNKCKeyboardGestureAreaShadowNode.h" #include -#include +#include #include namespace facebook::react { diff --git a/common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardGestureAreaShadowNode.cpp b/common/cpp/react/renderer/components/RNKC/RNKCKeyboardGestureAreaShadowNode.cpp similarity index 100% rename from common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardGestureAreaShadowNode.cpp rename to common/cpp/react/renderer/components/RNKC/RNKCKeyboardGestureAreaShadowNode.cpp diff --git a/common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardGestureAreaShadowNode.h b/common/cpp/react/renderer/components/RNKC/RNKCKeyboardGestureAreaShadowNode.h similarity index 79% rename from common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardGestureAreaShadowNode.h rename to common/cpp/react/renderer/components/RNKC/RNKCKeyboardGestureAreaShadowNode.h index c59f5a2846..bed04475e9 100644 --- a/common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardGestureAreaShadowNode.h +++ b/common/cpp/react/renderer/components/RNKC/RNKCKeyboardGestureAreaShadowNode.h @@ -2,8 +2,8 @@ #include "RNKCKeyboardGestureAreaState.h" -#include -#include +#include +#include #include #include diff --git a/common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardGestureAreaState.h b/common/cpp/react/renderer/components/RNKC/RNKCKeyboardGestureAreaState.h similarity index 100% rename from common/cpp/react/renderer/components/keyboardcontroller/RNKCKeyboardGestureAreaState.h rename to common/cpp/react/renderer/components/RNKC/RNKCKeyboardGestureAreaState.h diff --git a/common/cpp/react/renderer/components/keyboardcontroller/RNKCOverKeyboardViewComponentDescriptor.h b/common/cpp/react/renderer/components/RNKC/RNKCOverKeyboardViewComponentDescriptor.h similarity index 93% rename from common/cpp/react/renderer/components/keyboardcontroller/RNKCOverKeyboardViewComponentDescriptor.h rename to common/cpp/react/renderer/components/RNKC/RNKCOverKeyboardViewComponentDescriptor.h index bac6e07fbd..4a9994cc2d 100644 --- a/common/cpp/react/renderer/components/keyboardcontroller/RNKCOverKeyboardViewComponentDescriptor.h +++ b/common/cpp/react/renderer/components/RNKC/RNKCOverKeyboardViewComponentDescriptor.h @@ -3,7 +3,7 @@ #include "RNKCOverKeyboardViewShadowNode.h" #include -#include +#include #include namespace facebook::react { diff --git a/common/cpp/react/renderer/components/keyboardcontroller/RNKCOverKeyboardViewShadowNode.cpp b/common/cpp/react/renderer/components/RNKC/RNKCOverKeyboardViewShadowNode.cpp similarity index 100% rename from common/cpp/react/renderer/components/keyboardcontroller/RNKCOverKeyboardViewShadowNode.cpp rename to common/cpp/react/renderer/components/RNKC/RNKCOverKeyboardViewShadowNode.cpp diff --git a/common/cpp/react/renderer/components/keyboardcontroller/RNKCOverKeyboardViewShadowNode.h b/common/cpp/react/renderer/components/RNKC/RNKCOverKeyboardViewShadowNode.h similarity index 78% rename from common/cpp/react/renderer/components/keyboardcontroller/RNKCOverKeyboardViewShadowNode.h rename to common/cpp/react/renderer/components/RNKC/RNKCOverKeyboardViewShadowNode.h index 7fdcc9d86a..f827957ddc 100644 --- a/common/cpp/react/renderer/components/keyboardcontroller/RNKCOverKeyboardViewShadowNode.h +++ b/common/cpp/react/renderer/components/RNKC/RNKCOverKeyboardViewShadowNode.h @@ -2,8 +2,8 @@ #include "RNKCOverKeyboardViewState.h" -#include -#include +#include +#include #include #include diff --git a/common/cpp/react/renderer/components/keyboardcontroller/RNKCOverKeyboardViewState.cpp b/common/cpp/react/renderer/components/RNKC/RNKCOverKeyboardViewState.cpp similarity index 100% rename from common/cpp/react/renderer/components/keyboardcontroller/RNKCOverKeyboardViewState.cpp rename to common/cpp/react/renderer/components/RNKC/RNKCOverKeyboardViewState.cpp diff --git a/common/cpp/react/renderer/components/keyboardcontroller/RNKCOverKeyboardViewState.h b/common/cpp/react/renderer/components/RNKC/RNKCOverKeyboardViewState.h similarity index 100% rename from common/cpp/react/renderer/components/keyboardcontroller/RNKCOverKeyboardViewState.h rename to common/cpp/react/renderer/components/RNKC/RNKCOverKeyboardViewState.h diff --git a/ios/KeyboardControllerModule.mm b/ios/KeyboardControllerModule.mm index 43033a2a56..60ca396b27 100644 --- a/ios/KeyboardControllerModule.mm +++ b/ios/KeyboardControllerModule.mm @@ -11,7 +11,7 @@ // Thanks to this guard, we won't import this header when we build for the old architecture. #ifdef RCT_NEW_ARCH_ENABLED -#import +#import #endif #import "KeyboardControllerModule-Header.h" diff --git a/ios/views/KeyboardBackgroundViewManager.mm b/ios/views/KeyboardBackgroundViewManager.mm index 0b83b4c4a6..d4072144b3 100644 --- a/ios/views/KeyboardBackgroundViewManager.mm +++ b/ios/views/KeyboardBackgroundViewManager.mm @@ -14,10 +14,10 @@ #endif #ifdef RCT_NEW_ARCH_ENABLED -#import -#import -#import -#import +#import +#import +#import +#import #import "RCTFabricComponentsPlugins.h" #endif diff --git a/ios/views/KeyboardControllerView.mm b/ios/views/KeyboardControllerView.mm index 110dee8b7e..51b3e32aca 100644 --- a/ios/views/KeyboardControllerView.mm +++ b/ios/views/KeyboardControllerView.mm @@ -20,10 +20,10 @@ #import #endif -#import -#import -#import -#import +#import +#import +#import +#import #import "KeyboardControllerModule-Header.h" #import "RCTFabricComponentsPlugins.h" diff --git a/ios/views/KeyboardExtenderManager.mm b/ios/views/KeyboardExtenderManager.mm index 69e61e05e9..18a504c664 100644 --- a/ios/views/KeyboardExtenderManager.mm +++ b/ios/views/KeyboardExtenderManager.mm @@ -16,10 +16,10 @@ #ifdef RCT_NEW_ARCH_ENABLED #import -#import -#import -#import -#import +#import +#import +#import +#import #import "RCTFabricComponentsPlugins.h" #endif diff --git a/ios/views/KeyboardGestureAreaManager.mm b/ios/views/KeyboardGestureAreaManager.mm index e095eb0bf9..e582d3c99e 100644 --- a/ios/views/KeyboardGestureAreaManager.mm +++ b/ios/views/KeyboardGestureAreaManager.mm @@ -14,10 +14,10 @@ #endif #ifdef RCT_NEW_ARCH_ENABLED -#import -#import -#import -#import +#import +#import +#import +#import #import "RCTFabricComponentsPlugins.h" #endif diff --git a/ios/views/OverKeyboardViewManager.mm b/ios/views/OverKeyboardViewManager.mm index 4d29b34ad7..7388deef12 100644 --- a/ios/views/OverKeyboardViewManager.mm +++ b/ios/views/OverKeyboardViewManager.mm @@ -16,10 +16,10 @@ #ifdef RCT_NEW_ARCH_ENABLED #import -#import -#import -#import -#import +#import +#import +#import +#import #import "RCTFabricComponentsPlugins.h" #endif diff --git a/package.json b/package.json index 50ace5001b..f840bd8e93 100644 --- a/package.json +++ b/package.json @@ -172,7 +172,7 @@ ] }, "codegenConfig": { - "name": "keyboardcontroller", + "name": "RNKC", "type": "all", "jsSrcsDir": "./src/specs", "android": { diff --git a/react-native-keyboard-controller.podspec b/react-native-keyboard-controller.podspec index d45023fc36..2a0b7dce40 100644 --- a/react-native-keyboard-controller.podspec +++ b/react-native-keyboard-controller.podspec @@ -61,7 +61,7 @@ Pod::Spec.new do |s| if new_arch_enabled s.subspec "common" do |ss| ss.source_files = ["common/cpp/**/*.{cpp,h}"] - ss.header_dir = "react/renderer/components/keyboardcontroller" + ss.header_dir = "react/renderer/components/RNKC" ss.private_header_files = "common/cpp/**/*.{h}" ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/common/cpp\"" } end