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
2 changes: 1 addition & 1 deletion .ado/android-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- task: CmdLine@2
displayName: gradlew installArchives
inputs:
script: REACT_NATIVE_DEPENDENCIES=$(System.DefaultWorkingDirectory)/build_deps ./gradlew installArchives -Pparam="excludeLibs"
script: REACT_NATIVE_BOOST_PATH=$(System.DefaultWorkingDirectory)/build_deps ./gradlew installArchives -Pparam="excludeLibs"

- template: templates\prep-android-nuget.yml

Expand Down
2 changes: 1 addition & 1 deletion .ado/npmOfficePack.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function doPublish(fakeMode) {
const onlyTagSource = !!branchVersionSuffix;
if (!onlyTagSource) {
// -------- Generating Android Artifacts with JavaDoc
const depsEnvPrefix = "REACT_NATIVE_DEPENDENCIES=" + path.join(process.env.BUILD_SOURCESDIRECTORY, "build_deps");
const depsEnvPrefix = "REACT_NATIVE_BOOST_PATH=" + path.join(process.env.BUILD_SOURCESDIRECTORY, "build_deps");
const gradleCommand = path.join(process.env.BUILD_SOURCESDIRECTORY, "gradlew") + " installArchives";
exec( depsEnvPrefix + " " + gradleCommand );

Expand Down
2 changes: 1 addition & 1 deletion .ado/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ jobs:
- task: CmdLine@2
displayName: gradlew installArchives
inputs:
script: REACT_NATIVE_DEPENDENCIES=$(System.DefaultWorkingDirectory)/build_deps ./gradlew installArchives -Pparam="excludeLibs"
script: REACT_NATIVE_BOOST_PATH=$(System.DefaultWorkingDirectory)/build_deps ./gradlew installArchives -Pparam="excludeLibs"

- template: templates\prep-android-nuget.yml

Expand Down
11 changes: 3 additions & 8 deletions .ado/setup_droid_deps.bat
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,8 @@ IF EXIST %BUILD_DEPS_DIR% (

mkdir %BUILD_DEPS_DIR%

mkdir %BUILD_DEPS_DIR%\boost_1_63_0
mklink /D /J %BUILD_DEPS_DIR%\boost_1_63_0\boost ReactAndroid\packages\boost.1.68.0.0\lib\native\include\boost

mkdir %BUILD_DEPS_DIR%\double-conversion-1.1.6
mklink /D /J %BUILD_DEPS_DIR%\double-conversion-1.1.6\src double-conversion\double-conversion
mklink /D /J %BUILD_DEPS_DIR%\folly-2018.10.22.00 Folly\
mklink /D /J %BUILD_DEPS_DIR%\glog-0.3.5 glog
mkdir %BUILD_DEPS_DIR%\boost_1_68_0
mklink /D /J %BUILD_DEPS_DIR%\boost_1_68_0\boost ReactAndroid\packages\boost.1.68.0.0\lib\native\include\boost

REM When setting up locally, set the environement variable as follows.
REM set REACT_NATIVE_DEPENDENCIES=%CD%\%BUILD_DEPS_DIR%
REM set REACT_NATIVE_BOOST_PATH=%CD%\%BUILD_DEPS_DIR%
8 changes: 0 additions & 8 deletions .ado/setup_droid_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,4 @@ mkdir $BUILD_DEPS_DIR

mkdir $BUILD_DEPS_DIR/boost_1_68_0
ln -s "$PWD/ReactAndroid/packages/boost.1.68.0.0/lib/native/include/boost" "$BUILD_DEPS_DIR/boost_1_68_0/boost"

ln -s "$PWD/Folly" "$BUILD_DEPS_DIR/folly-2018.10.22.00"

mkdir $BUILD_DEPS_DIR/double-conversion-1.1.6
ln -s "$PWD/double-conversion/double-conversion" "$BUILD_DEPS_DIR/double-conversion-1.1.6/src"

ln -s "$PWD/glog" "$BUILD_DEPS_DIR/glog-0.3.5"

# export REACT_NATIVE_BOOST_PATH=$BUILD_DEPS_DIR
2 changes: 1 addition & 1 deletion .ado/templates/apple-droid-node-patching.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ steps:
- task: CmdLine@2
displayName: Apply Android specific patches for Office consumption
inputs:
script: node $(System.DefaultWorkingDirectory)/android-patches/bundle/bundle.js patch $(System.DefaultWorkingDirectory) BasicBuild RNHostBase V8Integration Focus --patch-store $(System.DefaultWorkingDirectory)/android-patches/patches --log-folder $(System.DefaultWorkingDirectory)/android-patches/logs --confirm ${{ parameters.apply_office_patches }}
script: node $(System.DefaultWorkingDirectory)/android-patches/bundle/bundle.js patch $(System.DefaultWorkingDirectory) Build OfficeRNHost V8 Focus --patch-store $(System.DefaultWorkingDirectory)/android-patches/patches --log-folder $(System.DefaultWorkingDirectory)/android-patches/logs --confirm ${{ parameters.apply_office_patches }}
4 changes: 4 additions & 0 deletions .ado/templates/apple-job-javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ steps:

- template: apple-xcode-select.yml

- template: apple-droid-node-patching.yml
parameters:
apply_office_patches: $(apply_office_patches)

- script: 'yarn install'
displayName: 'yarn install'

Expand Down
4 changes: 4 additions & 0 deletions .ado/templates/apple-job-react-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ steps:
# Task Group: Xcode select proper version
- template: apple-xcode-select.yml

- template: apple-droid-node-patching.yml
parameters:
apply_office_patches: $(apply_office_patches)

- task: CmdLine@2
displayName: yarn install
inputs:
Expand Down
23 changes: 0 additions & 23 deletions android-patches/patches/BasicBuild/ReactAndroid/build.gradle

This file was deleted.

11 changes: 0 additions & 11 deletions android-patches/patches/BasicBuild/ReactAndroid/gradle.properties

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- "D:\\code\\work\\react-native-v0.61.5\\ReactAndroid\\NuGet.Config" 1969-12-31 16:00:00.000000000 -0800
+++ "D:\\code\\work\\react-native-fb61merge\\ReactAndroid\\NuGet.Config" 2020-03-30 20:53:05.825371700 -0700
--- "E:\\github\\rnm-63-fresh\\ReactAndroid\\NuGet.Config" 1969-12-31 16:00:00.000000000 -0800
+++ "E:\\github\\rnm-63\\ReactAndroid\\NuGet.Config" 2020-10-13 21:24:33.415491000 -0700
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
--- "E:\\github\\react-native-v62.2\\ReactAndroid\\ReactAndroid.nuspec" 1969-12-31 16:00:00.000000000 -0800
+++ "E:\\github\\msrn-62\\ReactAndroid\\ReactAndroid.nuspec" 2020-05-20 21:13:29.624582800 -0700
@@ -0,0 +1,140 @@
--- "E:\\github\\rnm-63-fresh\\ReactAndroid\\ReactAndroid.nuspec" 1969-12-31 16:00:00.000000000 -0800
+++ "E:\\github\\rnm-63\\ReactAndroid\\ReactAndroid.nuspec" 2020-10-27 20:20:54.071789900 -0700
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="utf-8"?>
+<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
+ <metadata>
+ <id>OfficeReact.Android</id>
+ <version>$buildNumber$</version>
+ <version>0.63</version>
+ <description>Contains Android Implementation of React-Native</description>
+ <authors>Microsoft</authors>
+ <projectUrl>https://github.com/microsoft/react-native</projectUrl>
Expand Down Expand Up @@ -131,13 +132,13 @@
+ <file src="..\android\com\facebook\react\react-native\*\react-native-*.pom" target="lib"/>
+
+ <!-- Headers, ideally we'd only exported the needed headers, not the complete list -->
+ <file src="..\double-conversion\double-conversion\*.h" target="inc\double-conversion"/>
+ <file src=".\build\third-party-ndk\double-conversion\double-conversion\*.h" target="inc\double-conversion"/>
+ <file src=".\build\third-party-ndk\folly\**\*.*" target="inc" />
+ <file src=".\build\third-party-ndk\glog\exported\glog\*.h" target="inc\glog" />
+ <file src=".\build\third-party-ndk\jsc\JavaScriptCore\*.h" target="inc\jsc"/>
+ <file src="..\ReactCommon\cxxreact\**\*.h" target="inc\cxxreact"/>
+ <file src="..\ReactCommon\jsi\**\*.h" target="inc\jsi"/>
+ <file src="..\ReactCommon\yoga\yoga\**\*.h" target="inc\Yoga"/>
+ <file src="..\Folly\**\*.*" target="inc" />
+ <file src="..\glog\src\glog\*.h" target="inc\glog" />
+ <file src="..\jsc\jsc-headers\*.h" target="inc\jsc"/>
+ </files>
+</package>
+
95 changes: 95 additions & 0 deletions android-patches/patches/Build/ReactAndroid/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
--- "E:\\github\\rnm-63-fresh\\ReactAndroid\\build.gradle" 2020-10-27 20:26:16.652167500 -0700
+++ "E:\\github\\rnm-63\\ReactAndroid\\build.gradle" 2020-10-13 22:03:22.833541000 -0700
@@ -37,6 +37,8 @@
// and the build will use that.
def boostPath = dependenciesPath ?: System.getenv("REACT_NATIVE_BOOST_PATH")

+def V8Path = 'packages/ReactNative.V8JSI.Android.7.0.276.32-v1'
+
// Setup build type for NDK, supported values: {debug, release}
def nativeBuildType = System.getenv("NATIVE_BUILD_TYPE") ?: "release"

@@ -86,11 +88,22 @@
dest(new File(downloadsDir, "folly-${FOLLY_VERSION}.tar.gz"))
}

+def follyReplaceContent = '''
+ ssize_t r;
+ do {
+ r = open(name, flags, mode);
+ } while (r == -1 && errno == EINTR);
+ return r;
+'''
+
task prepareFolly(dependsOn: dependenciesPath ? [] : [downloadFolly], type: Copy) {
from(dependenciesPath ?: tarTree(downloadFolly.dest))
from("src/main/jni/third-party/folly/Android.mk")
include("folly-${FOLLY_VERSION}/folly/**/*", "Android.mk")
eachFile { fname -> fname.path = (fname.path - "folly-${FOLLY_VERSION}/") }
+ // Fixes problem with Folly failing to build on certain systems. See
+ // https://github.com/facebook/react-native/issues/28298
+ filter { line -> line.replaceAll('return int\\(wrapNoInt\\(open, name, flags, mode\\)\\);', follyReplaceContent) }
includeEmptyDirs = false
into("$thirdPartyNdkDir/folly")
}
@@ -115,6 +128,14 @@
}
}

+task prepareV8() {
+ copy {
+ from "src/main/jni/third-party/v8jsi/"
+ include("*.mk")
+ into "$thirdPartyNdkDir/v8jsi"
+ }
+}
+
task downloadGlog(dependsOn: createNativeDepsDirectories, type: Download) {
src("https://github.com/google/glog/archive/v${GLOG_VERSION}.tar.gz")
onlyIfNewer(true)
@@ -296,7 +317,7 @@
}

def buildReactNdkLib = tasks.register("buildReactNdkLib", Exec) {
- dependsOn(prepareJSC, prepareHermes, prepareBoost, prepareDoubleConversion, prepareFolly, prepareGlog, extractAARHeaders, extractJNIFiles)
+ dependsOn(prepareJSC, prepareHermes, prepareV8, prepareBoost, prepareDoubleConversion, prepareFolly, prepareGlog, extractAARHeaders, extractJNIFiles)

inputs.dir("$projectDir/../ReactCommon")
inputs.dir("src/main/jni")
@@ -309,6 +330,7 @@
"NDK_OUT=" + temporaryDir,
"NDK_LIBS_OUT=$buildDir/react-ndk/all",
"THIRD_PARTY_NDK_DIR=$buildDir/third-party-ndk",
+ "V8_NUGET_DIR=$projectDir/$V8Path",
"REACT_COMMON_DIR=$projectDir/../ReactCommon",
"REACT_SRC_DIR=$projectDir/src/main/java/com/facebook/react",
"-C", file("src/main/jni/react/jni").absolutePath,
@@ -322,6 +344,7 @@
commandLine(getNdkBuildFullPath(),
"NDK_APPLICATION_MK=$projectDir/src/main/jni/Application.mk",
"THIRD_PARTY_NDK_DIR=$buildDir/third-party-ndk",
+ "V8_NUGET_DIR=$projectDir/$V8Path",
"REACT_COMMON_DIR=$projectDir/../ReactCommon",
"-C", file("src/main/jni/react/jni").absolutePath,
"clean")
@@ -333,10 +356,16 @@

def packageReactNdkLibs = tasks.register("packageReactNdkLibs", Copy) {
dependsOn(buildReactNdkLib)
- from("$buildDir/react-ndk/all")
- into("$buildDir/react-ndk/exported")
- exclude("**/libjsc.so")
- exclude("**/libhermes.so")
+ from "$buildDir/react-ndk/all"
+ from("$thirdPartyNdkDir/jsc/jni")
+ into "$buildDir/react-ndk/exported"
+
+ if(project.hasProperty('param') ? project.property('param').equals("excludeLibs") : false) {
+ exclude '**/*.so'
+ } else {
+ exclude '**/libjsc.so'
+ exclude("**/libhermes.so")
+ }
}

def packageReactNdkLibsForBuck = tasks.register("packageReactNdkLibsForBuck", Copy) {
11 changes: 11 additions & 0 deletions android-patches/patches/Build/ReactAndroid/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- "E:\\github\\rnm-63-fresh\\ReactAndroid\\gradle.properties" 2020-10-27 20:26:16.652167500 -0700
+++ "E:\\github\\rnm-63\\ReactAndroid\\gradle.properties" 2020-10-13 21:23:43.852166500 -0700
@@ -17,7 +17,7 @@
OKHTTP_VERSION=3.12.1
SO_LOADER_VERSION=0.8.2

-BOOST_VERSION=1_63_0
+BOOST_VERSION=1_68_0
DOUBLE_CONVERSION_VERSION=1.1.6
FOLLY_VERSION=2020.01.13.00
GLOG_VERSION=0.3.5
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- "D:\\code\\work\\react-native-v0.61.5\\ReactAndroid\\packages.config" 1969-12-31 16:00:00.000000000 -0800
+++ "D:\\code\\work\\react-native-fb61merge\\ReactAndroid\\packages.config" 2020-03-30 20:53:05.829342700 -0700
--- "E:\\github\\rnm-63-fresh\\ReactAndroid\\packages.config" 1969-12-31 16:00:00.000000000 -0800
+++ "E:\\github\\rnm-63\\ReactAndroid\\packages.config" 2020-10-13 21:24:33.373490200 -0700
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- /home/mganandraj/code/rn-macos-fb62merge-fresh/ReactAndroid/src/main/jni/third-party/boost/Android.mk 2020-08-17 18:02:35.490031483 -0700
+++ /home/mganandraj/code/rn-macos-fb62merge/ReactAndroid/src/main/jni/third-party/boost/Android.mk 2020-08-17 15:12:14.706279608 -0700
--- "E:\\github\\rnm-63-fresh\\ReactAndroid\\src\\main\\jni\\third-party\\boost\\Android.mk" 2020-10-27 20:26:17.038172200 -0700
+++ "E:\\github\\rnm-63\\ReactAndroid\\src\\main\\jni\\third-party\\boost\\Android.mk" 2020-10-13 21:52:15.163202200 -0700
@@ -1,8 +1,8 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
Expand Down
Loading