Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
42 changes: 2 additions & 40 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ on:
- '**/nitro.json'

jobs:
build_new:
name: Build Android Example App (new architecture)
build:
name: Build Android Example App
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
Expand Down Expand Up @@ -60,41 +60,3 @@ jobs:
- name: Stop Gradle Daemon
working-directory: example/android
run: ./gradlew --stop

build_old:
name: Build Android Example App (old architecture)
needs: build_new
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: oven-sh/setup-bun@v2

- name: Install npm dependencies (bun)
run: bun install

- name: Disable new architecture in gradle.properties
run: sed -i "s/newArchEnabled=true/newArchEnabled=false/g" example/android/gradle.properties

- name: Setup JDK 17
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: 17
java-package: jdk

- name: Restore Gradle cache
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Run Gradle Build for example/android/
working-directory: example/android
run: ./gradlew assembleDebug --no-daemon --build-cache

# Gradle cache doesn't like daemons
- name: Stop Gradle Daemon
working-directory: example/android
run: ./gradlew --stop
56 changes: 2 additions & 54 deletions .github/workflows/build-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ env:
USE_CCACHE: 1

jobs:
build_new:
name: Build iOS Example App (new architecture)
build:
name: Build iOS Example App
runs-on: macOS-15
steps:
- uses: actions/checkout@v5
Expand Down Expand Up @@ -78,55 +78,3 @@ jobs:
-destination 'platform=iOS Simulator,name=iPhone 16' \
build \
CODE_SIGNING_ALLOWED=NO"

build_old:
name: Build iOS Example App (old architecture)
needs: build_new
runs-on: macOS-15
steps:
- uses: actions/checkout@v5
- uses: oven-sh/setup-bun@v2

- name: Install npm dependencies (bun)
run: bun install

- name: Disable new architecture in Podfile
run: sed -i "" "s/ENV\['RCT_NEW_ARCH_ENABLED'\] = '1'/ENV['RCT_NEW_ARCH_ENABLED'] = '0'/g" example/ios/Podfile

- name: Restore buildcache
uses: mikehardy/buildcache-action@v2
continue-on-error: true

- name: Setup Ruby (bundle)
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.2
bundler-cache: true
working-directory: example/ios

- name: Select Xcode 16.4
run: sudo xcode-select -s "/Applications/Xcode_16.4.app/Contents/Developer"

- name: Restore Pods cache
uses: actions/cache@v4
with:
path: example/ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock', '**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Install Pods
working-directory: example/ios
run: pod install

- name: Build App
working-directory: example/ios
run: "set -o pipefail && xcodebuild \
CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \
-derivedDataPath build -UseModernBuildSystem=YES \
-workspace MmkvExample.xcworkspace \
-scheme MmkvExample \
-sdk iphonesimulator \
-configuration Debug \
-destination 'platform=iOS Simulator,name=iPhone 16' \
build \
CODE_SIGNING_ALLOWED=NO"
146 changes: 68 additions & 78 deletions bun.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions example/__tests__/MMKV.harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ describe('MMKV Configuration & Multiple Instances', () => {
createMMKV({ id: 'test-instance-1' }).clearAll();
createMMKV({ id: 'test-instance-2' }).clearAll();
createMMKV({ id: 'encrypted-instance' }).clearAll();
} catch (e) {
} catch {
// Instances might not exist, that's okay
}
});
Expand Down Expand Up @@ -425,7 +425,7 @@ describe('MMKV Encryption & Security', () => {
try {
createMMKV({ id: 'encrypted-test' }).clearAll();
createMMKV({ id: 'recrypt-test' }).clearAll();
} catch (e) {
} catch {
// Instances might not exist, that's okay
}
});
Expand Down
9 changes: 0 additions & 9 deletions example/android/app/src/debug/AndroidManifest.xml

This file was deleted.

1 change: 1 addition & 0 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="${usesCleartextTraffic}"
android:supportsRtl="true">
<activity
android:name=".MainActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,19 @@ import com.facebook.react.PackageList
import com.facebook.react.ReactApplication
import com.facebook.react.ReactHost
import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
import com.facebook.react.ReactNativeHost
import com.facebook.react.ReactPackage
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost

class MainApplication : Application(), ReactApplication {

override val reactNativeHost: ReactNativeHost =
object : DefaultReactNativeHost(this) {
override fun getPackages(): List<ReactPackage> =
PackageList(this).packages.apply {
// Packages that cannot be autolinked yet can be added manually here, for example:
// add(MyReactNativePackage())
}

override fun getJSMainModuleName(): String = "index"

override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG

override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
}

override val reactHost: ReactHost
get() = getDefaultReactHost(applicationContext, reactNativeHost)
override val reactHost: ReactHost by lazy {
getDefaultReactHost(
context = applicationContext,
packageList =
PackageList(this).packages.apply {
// no extra packages
},
)
}

override fun onCreate() {
super.onCreate()
Expand Down
Binary file modified example/android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 2 additions & 0 deletions example/ios/MmkvExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@
REACT_NATIVE_PATH = "${PODS_ROOT}/../../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
SWIFT_ENABLE_EXPLICIT_MODULES = NO;
USE_HERMES = true;
};
name = Debug;
Expand Down Expand Up @@ -450,6 +451,7 @@
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../../node_modules/react-native";
SDKROOT = iphoneos;
SWIFT_ENABLE_EXPLICIT_MODULES = NO;
USE_HERMES = true;
VALIDATE_PRODUCT = YES;
};
Expand Down
2 changes: 2 additions & 0 deletions example/ios/MmkvExample/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
Expand Down
3 changes: 0 additions & 3 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ if linkage != nil
use_frameworks! :linkage => linkage.to_sym
end

ENV['RCT_USE_PREBUILT_RNCORE'] = '1'
ENV['RCT_USE_RN_DEP'] = '1'

target 'MmkvExample' do
config = use_native_modules!

Expand Down
Loading