Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,5 @@ untyped-import
untyped-type-import

[version]
^0.170.0
^0.176.3

27 changes: 10 additions & 17 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ on:
pull_request:
branches: [ master ]

# Global envs
# env:
# ANDROID_NDK_HOME: /usr/local/lib/android/sdk/ndk/x.x.x
# ANDROID_NDK_ROOT: /usr/local/lib/android/sdk/ndk/x.x.x

# TODO: Avoid brutally editing/setting ndk.dir in local.properties

jobs:
Expand All @@ -38,20 +33,18 @@ jobs:
distribution: temurin
cache: 'gradle'

# (Standalone toolchains obsolete)
# Ubuntu 20.04: r21e, r22, r23b, Custom: r24+
- name: Set up NDK 25 Beta 2
uses: nttld/[email protected]
with:
ndk-version: r25-beta2

# - name: Or manually set NDK X env vars
# run: |
# export ANDROID_NDK_HOME=/usr/local/lib/android/sdk/ndk/x.x.x
# export ANDROID_NDK_ROOT=/usr/local/lib/android/sdk/ndk/x.x.x

- name: Install all project dependencies
run: yarn

- name: Get and extract cmake-3.23.1-linux-x86_64.tar.gz to /usr/local/lib/android/sdk
run: |
wget https://github.com/Kitware/CMake/releases/download/v3.23.1/cmake-3.23.1-linux-x86_64.tar.gz
tar xzf cmake-3.23.1-linux-x86_64.tar.gz
rm -rf cmake-3.23.1-linux-x86_64.tar.gz
mkdir -p /usr/local/lib/android/sdk/cmake/3.22.1
cp -rf cmake-3.23.1-linux-x86_64/* /usr/local/lib/android/sdk/cmake/3.22.1
cd cmake-3.23.1-linux-x86_64
./bin/cmake --version

# Avoid poisoned cache problems
- name: Delete Android build pre-computed outputs
Expand Down
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ DerivedData
*.hmap
*.ipa
*.xcuserstate
ios/.xcode.env.local
project.xcworkspace

# Android/IntelliJ
Expand Down Expand Up @@ -53,9 +54,10 @@ buck-out/
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/

*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots
**/fastlane/report.xml
**/fastlane/Preview.html
**/fastlane/screenshots
**/fastlane/test_output

# Bundle artifact
*.jsbundle
Expand Down
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.7.5
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/ora-npm-3.4.0-1c83c64050-f1f8e7f290.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/sax-npm-1.2.4-178f05f12f-d3df7d32b8.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/uuid-npm-7.0.3-2b088bd924-f5b7b5cc28.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby '2.7.5'

gem 'cocoapods', '~> 1.11', '>= 1.11.2'
100 changes: 0 additions & 100 deletions Gemfile.lock

This file was deleted.

33 changes: 14 additions & 19 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
apply plugin: "com.android.application"

import com.android.build.OutputFile
import org.apache.tools.ant.taskdefs.condition.Os

/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
Expand Down Expand Up @@ -79,7 +78,6 @@ import org.apache.tools.ant.taskdefs.condition.Os
*/

project.ext.react = [
entryFile: "index.ts",
enableHermes: true, // clean and rebuild if changing
]

Expand Down Expand Up @@ -153,18 +151,13 @@ android {
"GENERATED_SRC_DIR=$buildDir/generated/source",
"PROJECT_BUILD_DIR=$buildDir",
"REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid",
"REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build"
"REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build",
"NODE_MODULES_DIR=$rootDir/../node_modules"
cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
cppFlags "-std=c++17"
// Make sure this target name is the same you specify inside the
// src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.
targets "leotm_myapp_appmodules"

// Fix for windows limit on number of character in file paths and in command lines
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
arguments "NDK_OUT=${rootProject.projectDir.getParent()}\\.cxx",
"NDK_APP_SHORT_COMMANDS=true"
}
}
}
if (!enableSeparateBuildPerCPUArchitecture) {
Expand Down Expand Up @@ -265,13 +258,10 @@ android {
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])

implementation project(":ReactAndroid") // From node_modules
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules

// https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout
// https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/package-summary
// https://android.googlesource.com/platform/frameworks/support/+/refs/heads/androidx-main/swiperefreshlayout/swiperefreshlayout
// https://github.com/android/views-widgets-samples
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.2.0-alpha01"
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
Expand All @@ -287,9 +277,10 @@ dependencies {
}

if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/"
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
//noinspection GradleDynamicVersion
implementation("com.facebook.react:hermes-engine:+") { // From node_modules
exclude group:'com.facebook.fbjni'
}
} else {
implementation jscFlavor
}
Expand All @@ -302,7 +293,11 @@ if (isNewArchitectureEnabled()) {
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute(module("com.facebook.react:react-native"))
.using(project(":ReactAndroid")).because("On New Architecture we're building React Native from source")
.using(project(":ReactAndroid"))
.because("On New Architecture we're building React Native from source")
substitute(module("com.facebook.react:hermes-engine"))
.using(project(":ReactAndroid:hermes-engine"))
.because("On New Architecture we're building Hermes from source")
}
}
}
Expand Down
7 changes: 7 additions & 0 deletions android/app/src/main/java/com/leotm/myapp/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,12 @@ protected ReactRootView createRootView() {
reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);
return reactRootView;
}

@Override
protected boolean isConcurrentRootEnabled() {
// If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).
// More on this on https://reactjs.org/blog/2022/03/29/react-v18.html
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import com.facebook.react.bridge.UIManager;
import com.facebook.react.fabric.ComponentFactory;
import com.facebook.react.fabric.CoreComponentsRegistry;
import com.facebook.react.fabric.EmptyReactNativeConfig;
import com.facebook.react.fabric.FabricJSIModuleProvider;
import com.facebook.react.fabric.ReactNativeConfig;
import com.facebook.react.uimanager.ViewManagerRegistry;
import com.leotm.myapp.BuildConfig;
import com.leotm.myapp.newarchitecture.components.MainComponentsRegistry;
Expand Down Expand Up @@ -105,7 +105,7 @@ public JSIModuleProvider<UIManager> getJSIModuleProvider() {
return new FabricJSIModuleProvider(
reactApplicationContext,
componentFactory,
new EmptyReactNativeConfig(),
ReactNativeConfig.DEFAULT_CONFIG,
viewManagerRegistry);
}
});
Expand Down
3 changes: 1 addition & 2 deletions android/app/src/main/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
LOCAL_SHARED_LIBRARIES := \
libfabricjni \
libfbjni \
libfolly_futures \
libfolly_json \
libfolly_runtime \
libglog \
libjsi \
libreact_codegen_rncore \
Expand Down
15 changes: 1 addition & 14 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,7 @@ buildscript {
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31

if (System.properties['os.arch'] == "aarch64") {
// For M1 Users we need to use the NDK 24+ which added support for aarch64
ndkVersion = "25.0.8221429 rc2"
} else if (Os.isFamily(Os.FAMILY_WINDOWS)) {
// For Android Users, we need to use NDK 23, otherwise the build will
// fail due to paths longer than the OS limit
ndkVersion = "23.1.7779620"
} else {
// Otherwise we default to the side-by-side NDK version from AGP.
ndkVersion = "21.4.7075529"
}
// Also create/update android/local.properties ndk.dir=/Users/<user>/Library/Android/sdk/ndk/<ver>
// Some versions like 24.0.7956693-beta2 not listed in Android Studio Preview
ndkVersion = "23.1.7779620"
}
repositories {
google()
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
# https://services.gradle.org/distributions
# https://gradle.org/nightly
distributionUrl=https\://services.gradle.org/distributions-snapshots/gradle-7.5-20220331233901+0000-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 2 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ includeBuild('../node_modules/react-native-gradle-plugin')
if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") {
include(":ReactAndroid")
project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid')
include(":ReactAndroid:hermes-engine")
project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine')
}
Loading