Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate yarn to npm #22116

Open
wants to merge 36 commits into
base: main
Choose a base branch
from
Open
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
aa79d3b
Migrate yarn to npm
jchen351 Sep 17, 2024
53b3874
npm --prefix e2e install
jchen351 Sep 17, 2024
0b321d6
Update package.json
jchen351 Sep 17, 2024
116f431
Update update_version.py
jchen351 Sep 18, 2024
ce0c841
Update boostrap.js
jchen351 Sep 18, 2024
374d6ae
Update react-native-ci.yml
jchen351 Sep 18, 2024
e3a593b
Adding "e2e:start": "npm --prefix e2e run start"
jchen351 Sep 18, 2024
7a66218
use_react_native!(:path => '../node_modules/react-native')
jchen351 Sep 18, 2024
0a849ad
Trying to update to ios 15.0
jchen351 Sep 18, 2024
52a1723
Trying to update to ios 15.0
jchen351 Sep 18, 2024
108e35f
Adding debug info
jchen351 Sep 18, 2024
ed99966
Rearrange npm install
jchen351 Sep 18, 2024
b27a5f9
Remove reference to react.grale
jchen351 Sep 19, 2024
18d642b
Update react-native-ci.yml
jchen351 Sep 23, 2024
ad2c666
Update gradle settings
jchen351 Sep 24, 2024
4c3fcb9
Update react-native-ci.yml
jchen351 Sep 24, 2024
1d28223
update setting.gradle
jchen351 Sep 24, 2024
50981a1
Update gradle version to 8.10.2
jchen351 Sep 24, 2024
54cce11
update setting.gradle
jchen351 Sep 24, 2024
a7b1370
Update gradle-wrapper.properties in java project.
jchen351 Sep 24, 2024
6c28b62
update ndk version
jchen351 Sep 24, 2024
2d09024
com.android.tools.build:gradle:8.6.0
jchen351 Sep 24, 2024
70308f4
com.android.tools.build:gradle:8.6.1
jchen351 Sep 24, 2024
82ab4ee
com.android.tools.build:gradle:8.6.1
jchen351 Sep 24, 2024
876eb4a
com.android.tools.build:gradle:8.6.1
jchen351 Sep 24, 2024
7fb3dcf
update gradle to 8.7
jchen351 Sep 24, 2024
9b60ae7
com.android.tools.build:gradle:8.6.1
jchen351 Sep 24, 2024
aa613aa
com.android.tools.build:gradle:8.6.1
jchen351 Sep 25, 2024
a934b3f
Adding react-native-fs as dependency
jchen351 Sep 25, 2024
f6682c0
Merge branch 'Cjian/gradle' into Cjian/yarn2npm
jchen351 Sep 25, 2024
c5baa3b
Use JDK 17 for andriod-java-api-aar.yml
jchen351 Sep 25, 2024
45b08f6
Merge branch 'Cjian/gradle' into Cjian/yarn2npm
jchen351 Sep 25, 2024
963f379
Use JDK 17 for android-binary-size-check-stage.yml
jchen351 Sep 25, 2024
441cbc8
Merge branch 'Cjian/gradle' into Cjian/yarn2npm
jchen351 Sep 25, 2024
990cfe4
Downgradle AGP to 7.4.2
jchen351 Sep 25, 2024
cd18332
downgrade com.android.tools.build:gradle:8.6.1 to 7.4.2
jchen351 Sep 25, 2024
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
2 changes: 1 addition & 1 deletion java/build-android.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ allprojects {
}

android {
compileSdkVersion 32
compileSdkVersion 33

defaultConfig {
minSdkVersion minSdkVer
Expand Down
Binary file modified java/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions java/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=9631d53cf3e74bfa726893aee1f8994fee4e060c401335946dba2156f440f24c
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionSha256Sum=544c35d6bd849ae8a5ed0bcea39ba677dc40f49df7d1835561582da2009b961d
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
20 changes: 10 additions & 10 deletions java/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
2 changes: 1 addition & 1 deletion java/src/test/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
def minSdkVer = System.properties.get("minSdkVer")?:24

android {
compileSdkVersion 32
compileSdkVersion 33

defaultConfig {
applicationId "ai.onnxruntime.example.javavalidator"
Expand Down
12 changes: 6 additions & 6 deletions js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ From ORT v1.19 onwards, the ONNX Runtime Mobile packages are no longer published
From `<ORT_ROOT>/js/react_native,

```sh
yarn bootstrap
npm run bootstrap
```

When testing with a custom built ONNX Runtime Android package, copy `<BUILD_DIRECTORY>/aar_out/MinSizeRel/com/microsoft/onnxruntime/onnxruntime-android/<version>/onnxruntime-android-<version>.aar` into the `<ORT_ROOT>/js/react_native/e2e/android/app/libs` directory.
Expand All @@ -377,7 +377,7 @@ From ORT v1.19 onwards, the ONNX Runtime Mobile packages are no longer published
Install detox command line tools:

```
yarn global add detox-cli
npm install -g detox-cli
```

Install applesimutils which is required by Detox to work with iOS simulators. (Requires a MacOS device)
Expand Down Expand Up @@ -439,13 +439,13 @@ From ORT v1.19 onwards, the ONNX Runtime Mobile packages are no longer published
To record logs for testing results, add `--record-logs`. Output logs and test results will be produced in the `e2e/artifacts/` folder.
See: [Detox/logger#artifacts](https://wix.github.io/Detox/docs/api/logger#artifacts)

**_`yarn bootstrap` changes `packages.json` and `yarn.lock` files. Once testing is done, restore changes to avoid unwanted commit._**
**_`npm run bootstrap` changes `packages.json` and `pacakge-lock.json` files. Once testing is done, restore changes to avoid unwanted commit._**

5. Run Android and iOS apps.

```sh
yarn e2e android
yarn e2e ios
npm run e2e:android
npm run e2e:ios
```

### NPM Packaging
Expand All @@ -460,4 +460,4 @@ From ORT v1.19 onwards, the ONNX Runtime Mobile packages are no longer published

### Distribution

It should be able to consumed by React Native projects that uses Yarn packages through `yarn add onnxruntime-react-native`.
It should be able to consumed by React Native projects that uses npm packages through `npm install onnxruntime-react-native`.
2 changes: 1 addition & 1 deletion js/react_native/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ With ONNX Runtime React Native, React Native developers can score pre-trained ON
### Installation

```sh
yarn add onnxruntime-react-native
npm install onnxruntime-react-native
```

### Usage
Expand Down
4 changes: 3 additions & 1 deletion js/react_native/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath 'com.android.tools.build:gradle:7.4.2'
// noinspection DifferentKotlinGradleVersion
}
}
Expand Down Expand Up @@ -70,6 +70,7 @@ def REACT_NATIVE_VERSION = ['node', '--print', "JSON.parse(require('fs').readFil
def REACT_NATIVE_MINOR_VERSION = REACT_NATIVE_VERSION.split("\\.")[1].toInteger()

android {
namespace 'ai.onnxruntime.reactnative'
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
buildToolsVersion getExtOrDefault('buildToolsVersion')
defaultConfig {
Expand Down Expand Up @@ -141,6 +142,7 @@ android {
}
}
}
ndkVersion '27.0.12077973'
}

repositories {
Expand Down
6 changes: 3 additions & 3 deletions js/react_native/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
android.enableJetifier=true
android.useAndroidX=true
OnnxruntimeModule_buildToolsVersion=29.0.2
OnnxruntimeModule_compileSdkVersion=31
OnnxruntimeModule_minSdkVersion=21
OnnxruntimeModule_targetSdkVersion=31
OnnxruntimeModule_compileSdkVersion=33
OnnxruntimeModule_minSdkVersion=23
OnnxruntimeModule_targetSdkVersion=33
Binary file modified js/react_native/android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#Tue Sep 24 11:35:00 PDT 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=7faa7198769f872826c8ef4f1450f839ec27f0b4d5d1e51bade63667cbccd205
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
distributionSha256Sum=544c35d6bd849ae8a5ed0bcea39ba677dc40f49df7d1835561582da2009b961d
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading