Skip to content

Commit 3a93643

Browse files
authored
Moving the android specific changes to patch files and reverting them… (#254)
* Moving the android specific changes to patch files and reverting them from the repo. * Apply patches immediately after cloning * Fixing the webpack config for the bundle to run correctly * Removing an unwanted hunk from folly makefile hwich might be causing a build failure * Reverting src/main/jni/third-party/folly/Android.mk hoping for the best. If this doesn't work then will look deeper * Fixing the patch scripts * Fixing a patch file with integrity failure.. and tightening the error handling. * Adding more diagnostics * More diagnostics * Fixing line splitting of patch and source files while patching * Cleaning up the diagnostics.. Patching should work this time. * Reverting the change needed for MAC/iOS * More diagnostics printed out .. * Fixing MAC/iOS build * yarn test -u * Update .eslintignore Update .eslintignore to ignore patching code and patch files. * Fixing a couple of linking errors in JS' * Adding prettierignore and making some fixes to the patches * More fixes to the path * Making required changes in Apple PR/Publish build pipelines to valiate/publish patched as well as unpatched code * A fix in the patch application condition * More fixes in the patch application condition * Another attempt to fix the patching condition * Yet Another attempt to fix the patching condition * Yet Another attempt to fix the patching condition.. forcing the parameter to be strings * Yet Another attempt to fix the patching condition.. forcing the parameter to be strings * Making patches work on non-windows.. and more fixes for the condition in yaml * Diagnostics for debugging conditions * Diagnostics for debugging conditions 2 * Diagnostics for debugging conditions 3 * Diagnostics for debugging conditions 3 * Diagnostics for debugging conditions 3 * Diagnostics for debugging conditions 3 * Diagnostics for debugging conditions 3 * Diagnostics for debugging conditions 3 * Diagnostics for debugging conditions 3 * Diagnostics for debugging conditions 3 * Diagnostics for debugging conditions 3 * Diagnostics for debugging conditions 3 * Diagnostics for debugging conditions 3 * Diagnostics for debugging conditions 3 * Diagnostics for debugging conditions 3 * Diagnostics for debugging conditions 3 * Diagnostics for debugging conditions 3 * Workaround * Workaround * Workaround * Workaround * Fixing Apple build failure with patch applied .. * Refactoring the patch application to template * Fixing the template file relative URL when referenced from another template * Fixing a mistake introduced while refactoring the patch creating steps. * Fixing some formatting * Fixing some formatting Co-authored-by: Anandraj <[email protected]>
1 parent bcd9983 commit 3a93643

File tree

226 files changed

+9563
-4351
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

226 files changed

+9563
-4351
lines changed

.ado/android-pr.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@ jobs:
2222
submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules
2323
persistCredentials: false # set to 'true' to leave the OAuth token in the Git config after the initial fetch
2424

25+
- template: templates/apple-droid-node-patching.yml
26+
parameters:
27+
apply_office_patches: true
28+
2529
- task: UseNode@1
2630
inputs:
2731
version: '10.x'
28-
32+
2933
# Install NuGet v4.6.4+
3034
- task: NuGetToolInstaller@1
3135
inputs:

.ado/apple-pr.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,19 @@ pr:
1010
jobs:
1111
- job: JavaScriptRNPR
1212
displayName: JavaScript React Native PR
13+
strategy:
14+
matrix:
15+
office:
16+
apply_office_patches: 'true'
17+
public:
18+
apply_office_patches: 'false'
1319
pool:
1420
vmImage: macOS-10.14
1521
demands: ['xcode', 'sh', 'npm']
1622
steps:
1723
- template: templates/apple-job-javascript.yml
24+
parameters:
25+
apply_office_patches: $(apply_office_patches)
1826

1927
- job: AppleRNPR
2028
displayName: Apple React Native PR
@@ -27,6 +35,7 @@ jobs:
2735
xcode_destination: 'platform=iOS Simulator,OS=latest,name=iPhone 8'
2836
xcode_actions_debug: 'build test'
2937
xcode_actions_release: 'build'
38+
apply_office_patches: 'false'
3039
# Microsoft- We don't use tvOS, so don't bother maintaining the infra
3140
# tvos:
3241
# packager_platform: 'ios'
@@ -40,6 +49,23 @@ jobs:
4049
xcode_destination: 'platform=macOS,arch=x86_64'
4150
xcode_actions_debug: 'build test'
4251
xcode_actions_release: 'build'
52+
apply_office_patches: 'false'
53+
ios-office:
54+
packager_platform: 'ios'
55+
xcode_sdk: iphonesimulator
56+
xcode_scheme: 'RNTester'
57+
xcode_destination: 'platform=iOS Simulator,OS=latest,name=iPhone 8'
58+
xcode_actions_debug: 'build test'
59+
xcode_actions_release: 'build'
60+
apply_office_patches: 'true'
61+
macos-office:
62+
packager_platform: 'macos'
63+
xcode_sdk: macosx
64+
xcode_scheme: 'RNTester-macOS'
65+
xcode_destination: 'platform=macOS,arch=x86_64'
66+
xcode_actions_debug: 'build test'
67+
xcode_actions_release: 'build'
68+
apply_office_patches: 'true'
4369
pool:
4470
vmImage: macOS-10.14
4571
demands: ['xcode', 'sh', 'npm']
@@ -55,3 +81,4 @@ jobs:
5581
xcode_actions_debug: $(xcode_actions_debug)
5682
xcode_actions_release: $(xcode_actions_release)
5783
xcode_destination: $(xcode_destination)
84+
apply_office_patches: $(apply_office_patches)

.ado/publish-npmjs.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# This file defines the build steps to publish a release
2+
name: $(Date:yyyyMMdd).$(Rev:.r)
3+
4+
trigger:
5+
batch: true
6+
branches:
7+
include:
8+
- master
9+
- fabric
10+
paths:
11+
exclude:
12+
- package.json
13+
14+
pr: none
15+
16+
jobs:
17+
- job: RNGithubPublish
18+
displayName: React-Native GitHub Publish
19+
pool:
20+
vmImage: vs2017-win2016
21+
timeoutInMinutes: 90 # how long to run the job before automatically cancelling
22+
cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them
23+
steps:
24+
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
25+
clean: true # whether to fetch clean each time
26+
# fetchDepth: 2 # the depth of commits to ask Git to fetch
27+
lfs: false # whether to download Git-LFS files
28+
submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules
29+
persistCredentials: true # set to 'true' to leave the OAuth token in the Git config after the initial fetch
30+
31+
- task: CmdLine@2
32+
displayName: npm install
33+
inputs:
34+
script: npm install
35+
36+
- task: CmdLine@2
37+
displayName: Bump package version
38+
inputs:
39+
script: node .ado/bumpFileVersions.js
40+
41+
- task: CmdLine@2
42+
displayName: "Prepare package.json for npm publishing as react-native-macos"
43+
inputs:
44+
script: node .ado/renamePackageToMac.js
45+
46+
- task: Npm@1
47+
displayName: "Publish react-native-macos to npmjs.org"
48+
inputs:
49+
command: 'publish'
50+
publishEndpoint: 'npmjs'

.ado/publish.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ jobs:
2828
submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules
2929
persistCredentials: true # set to 'true' to leave the OAuth token in the Git config after the initial fetch
3030

31+
- template: templates/apple-droid-node-patching.yml
32+
parameters:
33+
apply_office_patches: true
34+
3135
# Install NuGet v4.6.4+
3236
- task: NuGetToolInstaller@1
3337
inputs:
@@ -139,14 +143,3 @@ jobs:
139143
inputs:
140144
PathtoPublish: '$(Build.StagingDirectory)\final'
141145
ArtifactName: 'ReactNative-Final'
142-
143-
- task: CmdLine@2
144-
displayName: "Prepare package.json for npm publishing as react-native-macos"
145-
inputs:
146-
script: node .ado/renamePackageToMac.js
147-
148-
- task: Npm@1
149-
displayName: "Publish react-native-macos to npmjs.org"
150-
inputs:
151-
command: 'publish'
152-
publishEndpoint: 'npmjs'
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
parameters:
2+
apply_office_patches: ''
3+
4+
steps:
5+
- task: CmdLine@2
6+
displayName: Apply Android specific patches for Office consumption
7+
inputs:
8+
script: node $(System.DefaultWorkingDirectory)/android-patches/bundle/bundle.js patch $(System.DefaultWorkingDirectory) BuildAndThirdPartyFixes DialogModule UIEditText UIScroll UITextFont Accessibility OfficeRNHost SecurityFixes V8Integration AnnotationProcessing --patch-store $(System.DefaultWorkingDirectory)/android-patches/patches-droid-office-grouped --log-folder $(System.DefaultWorkingDirectory)/android-patches/logs --confirm ${{ parameters.apply_office_patches }}

.ado/templates/apple-job-javascript.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
parameters:
2+
apply_office_patches: ''
3+
14
steps:
25
- script: 'brew bundle'
36
displayName: 'brew bundle'
@@ -7,6 +10,10 @@ steps:
710

811
- template: apple-xcode-select.yml
912

13+
- template: apple-droid-node-patching.yml
14+
parameters:
15+
apply_office_patches: $(apply_office_patches)
16+
1017
- script: 'yarn install'
1118
displayName: 'yarn install'
1219

.ado/templates/apple-job-react-native.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ parameters:
66
xcode_actions_debug: ''
77
xcode_actions_release: ''
88
xcode_destination: ''
9+
apply_office_patches: ''
910

1011
steps:
1112
# Clean DerivedData
@@ -22,6 +23,10 @@ steps:
2223
# Task Group: XCode select proper version
2324
- template: apple-xcode-select.yml
2425

26+
- template: apple-droid-node-patching.yml
27+
parameters:
28+
apply_office_patches: $(apply_office_patches)
29+
2530
- task: CmdLine@2
2631
displayName: yarn install
2732
inputs:

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ packages/*/node_modules
88
pr-inactivity-bookmarklet.js
99
question-bookmarklet.js
1010
flow/
11-
bots/node_modules
11+
bots/node_modules
12+
android-patches/

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ project.xcworkspace/*
3131
/RNTester/android/app/gradlew
3232
/RNTester/android/app/gradlew.bat
3333
/ReactAndroid/build/
34+
/build_deps/
35+
/ReactAndroid/packages/
3436

3537
# Buck
3638
.buckd

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
android-patches/

0 commit comments

Comments
 (0)