Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
9bac578
comiit tools/ci_build/github/azure-pipelines/stages/jobs/react-natvie…
jchen351 Jan 28, 2025
c7243ce
Merge with Cjian/RN-71
jchen351 Jan 28, 2025
b48a810
First changes applies to RN-72
jchen351 Jan 28, 2025
1004ee6
updating ios e2e
jchen351 Jan 28, 2025
e64f2f0
Merge remote-tracking branch 'origin/main' into Cjian/RN-72
jchen351 Feb 3, 2025
38c4d85
Update metro.config.js
jchen351 Feb 3, 2025
b5f14fd
Update project.pbxproj
jchen351 Feb 3, 2025
1c45f9d
Update android projects
jchen351 Feb 3, 2025
db4528f
Rolling back build.gradle
jchen351 Feb 3, 2025
141f06c
Rolling back build.gradle
jchen351 Feb 3, 2025
c840b29
Rolling back build.gradle
jchen351 Feb 3, 2025
4569d65
Rolling back tools/ci_build/github/azure-pipelines/stages/jobs/react-…
jchen351 Feb 3, 2025
c464777
Reformat metro.config.js
jchen351 Feb 3, 2025
75f394c
update yarn.lock
jchen351 Feb 3, 2025
8cdceb2
Updating package.json files and lock files
jchen351 Feb 3, 2025
e2fdb22
Testing RN-73
jchen351 Feb 4, 2025
9fa5538
Merge branch 'main' into Cjian/RN-73
jchen351 Feb 4, 2025
e07b2a0
package com.reactnativeonnxruntimemodule
jchen351 Feb 4, 2025
cbd517c
Update package.json
jchen351 Feb 4, 2025
ae1bee1
Rolling back eslint
jchen351 Feb 4, 2025
c950194
Rolling back js/rea
jchen351 Feb 4, 2025
f2ab0d8
Update Info.plist
jchen351 Feb 12, 2025
65031cc
update com.example.reactnativeonnxruntimemodule
jchen351 Feb 14, 2025
572b9a5
Update excludsion
jchen351 Feb 15, 2025
044da54
remove unused package
jchen351 Feb 15, 2025
2b7d512
Update build.gradle
jchen351 Feb 17, 2025
03c0752
update yarn.lock
jchen351 Feb 17, 2025
efb207a
Fix andriod e2e build
jchen351 Feb 18, 2025
c233183
fix libjsi.so
jchen351 Feb 18, 2025
9d738ac
move reactnativeonnxruntimemodule
jchen351 Feb 18, 2025
ac698bc
change MainApplication.Companion.getAppContext().getContentResolver()…
jchen351 Feb 18, 2025
c1d682b
change MainApplication.Companion.getAppContext().getContentResolver()…
jchen351 Feb 18, 2025
53c9ec8
Adding MNISTPackage.java
jchen351 Feb 18, 2025
4ead59a
Update heap size
jchen351 Feb 18, 2025
2efc2b5
Merge branch 'main' into Cjian/RN-73
jchen351 Feb 21, 2025
d77a01e
Merge branch 'main' into Cjian/RN-73
jchen351 Feb 24, 2025
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
4 changes: 2 additions & 2 deletions js/react_native/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx1024m -XX:MaxPermSize=256m
org.gradle.jvmargs=-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -Djavax.xml.accessExternalSchema=all -Djavax.xml.accessExternalDTD=all
org.gradle.jvmargs=-Xmx8192m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -Djavax.xml.accessExternalSchema=all -Djavax.xml.accessExternalDTD=all
#
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
Expand All @@ -13,7 +13,7 @@ org.gradle.jvmargs=-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF
#Tue Jan 26 17:36:02 PST 2021
android.enableJetifier=true
android.useAndroidX=true
OnnxruntimeModule_buildToolsVersion=33.0.0
OnnxruntimeModule_buildToolsVersion=34.0.0
OnnxruntimeModule_compileSdkVersion=34
OnnxruntimeModule_minSdkVersion=24
OnnxruntimeModule_targetSdkVersion=34
Expand Down
5 changes: 0 additions & 5 deletions js/react_native/babel.config.js

This file was deleted.

70 changes: 12 additions & 58 deletions js/react_native/e2e/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"

import com.android.build.OutputFile

/**
* This is the configuration block to customize your React Native Android app.
* By default you don't need to apply any configuration, just uncomment the lines you need.
Expand All @@ -13,8 +12,8 @@ react {
// root = file("../")
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
// reactNativeDir = file("../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen
// codegenDir = file("../node_modules/react-native-codegen")
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
// codegenDir = file("../node_modules/@react-native/codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
// cliFile = file("../node_modules/react-native/cli.js")

Expand Down Expand Up @@ -52,14 +51,6 @@ react {
// hermesFlags = ["-O", "-output-source-map"]
}

/**
* Set this to true to create four separate APKs instead of one,
* one for each native architecture. This is useful if you don't
* use App Bundles (https://developer.android.com/guide/app-bundle/)
* and want to have separate APKs to upload to the Play Store.
*/
def enableSeparateBuildPerCPUArchitecture = false

/**
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
*/
Expand All @@ -78,45 +69,33 @@ def enableProguardInReleaseBuilds = false
*/
def jscFlavor = 'org.webkit:android-jsc:+'

/**
* Private function to get the list of Native Architectures you want to build.
* This reads the value from reactNativeArchitectures in your gradle.properties
* file and works together with the --active-arch-only flag of react-native run-android.
*/
def reactNativeArchitectures() {
def value = project.getProperties().get("reactNativeArchitectures")
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
}

android {

buildToolsVersion rootProject.ext.buildToolsVersion
compileSdkVersion rootProject.ext.compileSdkVersion
namespace "com.example.reactnativeonnxruntimemodule"
namespace "com.reactnativeonnxruntimemodule"
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
packagingOptions {
pickFirst '**/libc++_shared.so'
pickFirst '**/libfbjni.so'
excludes = [
"META-INF",
"META-INF/**",
]
}
defaultConfig {
applicationId "com.example.reactnativeonnxruntimemodule"
applicationId "com.reactnativeonnxruntimemodule"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
testBuildType System.getProperty('testBuildType', 'debug')
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}
signingConfigs {
debug {
storeFile rootProject.file('debug.keystore')
Expand All @@ -135,20 +114,6 @@ android {
proguardFile "${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro"
}
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// https://developer.android.com/studio/build/configure-apk-splits.html
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}

}
}
}

repositories {
Expand All @@ -164,19 +129,8 @@ dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")

implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
implementation("com.facebook.react:flipper-integration")
implementation 'androidx.test.ext:junit:1.1.5'
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
}
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
exclude group:'com.squareup.okhttp3', module:'okhttp'
}
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
}

if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
Expand All @@ -188,7 +142,7 @@ dependencies {
androidTestImplementation "androidx.test:runner:1.5.2"
androidTestImplementation "androidx.test:rules:1.5.0"

implementation project(':onnxruntime-react-native')
implementation (project(':onnxruntime-react-native'))
// specify ORT dependency here so it can be found in libs flatDir repository
implementation "com.microsoft.onnxruntime:onnxruntime-android:latest.integration@aar"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Detox requires the project to have a single dummy native Android Test with some special content,
// which will be picked up by the testRunner.

package com.example.reactnativeonnxruntimemodule;
package com.reactnativeonnxruntimemodule;

import android.content.Intent;

Expand Down
8 changes: 0 additions & 8 deletions js/react_native/e2e/android/app/src/debug/AndroidManifest.xml

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>

</manifest>

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.example.reactnativeonnxruntimemodule;
package com.reactnativeonnxruntimemodule;

import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.example.reactnativeonnxruntimemodule;
package com.reactnativeonnxruntimemodule;

import static java.util.stream.Collectors.joining;

Expand Down Expand Up @@ -114,7 +114,7 @@ private WritableMap preprocess(String uri) throws Exception {
final int imageHeight = 28;
final int imageWidth = 28;

InputStream is = MainApplication.getAppContext().getContentResolver().openInputStream(Uri.parse(uri));
InputStream is = reactContext.getContentResolver().openInputStream(Uri.parse(uri));
BufferedInputStream bis = new BufferedInputStream(is);
byte[] imageArray = new byte[bis.available()];
bis.read(imageArray);
Expand Down
Loading
Loading