Skip to content

Commit 9aae246

Browse files
authored
Upgrade to RN 0.60.5 (#16)
2 parents 276c260 + e4bc4ce commit 9aae246

File tree

15 files changed

+7494
-1318
lines changed

15 files changed

+7494
-1318
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ DerivedData
2323
*.ipa
2424
*.xcuserstate
2525

26+
# CocoaPods
27+
ios/Pods/
28+
2629
# Android/IntelliJ
2730
#
2831
build/
@@ -52,3 +55,6 @@ buck-out/
5255
fastlane/report.xml
5356
fastlane/Preview.html
5457
fastlane/screenshots
58+
59+
# Visual Studio Code
60+
.vscode/

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The `TextInput` box appears only in the Android version. Since both platforms us
4343
`git clone https://github.com/petterh/react-native-android-activity.git`\
4444
(Alternatively, create your own fork and clone that instead.)
4545
* `cd react-native-android-activity`
46-
* Run `yarn` to download dependencies
46+
* Run `yarn` to download dependencies (or, if you wish, `npm install`)
4747
* For Android development (using Windows, Mac or Linux), install [Android Studio](https://developer.android.com/studio/install.html) (follow instructions [on this page](https://facebook.github.io/react-native/docs/getting-started.html)).
4848
* For iOS development (Mac only), install [Xcode](https://developer.apple.com/xcode/).
4949
* By default, the debug build of the app loads the JS bundle from your dev box, so start a bundler:
@@ -63,7 +63,8 @@ The `TextInput` box appears only in the Android version. Since both platforms us
6363

6464
### iOS
6565

66-
* Open the xOS project in Xcode and run it. This automatically starts a bundler.
66+
* Open the iOS project in Xcode: `open Activity.xcworkspace`.
67+
* Run the Activity application.
6768

6869
<!-- markdownlint-enable MD031 -->
6970

android/app/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ project.ext.react = [
3333
// Whether to bundle JS and assets in release mode
3434
bundleInRelease: true,
3535

36+
enableHermes: false,
37+
3638
// Whether to bundle JS and assets in another build variant (if configured).
3739
// See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
3840
// The configuration property can be in the following formats
@@ -164,4 +166,6 @@ android {
164166
dependencies {
165167
implementation fileTree(dir: 'libs', include: ['*.jar'])
166168
implementation("com.facebook.react:react-native:$rootProject.ext.reactNativeVersion")
169+
//noinspection GradleDynamicVersion
170+
implementation 'org.webkit:android-jsc:+'
167171
}

android/build.gradle

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ import groovy.json.JsonSlurper
44

55
buildscript {
66
repositories {
7-
jcenter()
87
google()
8+
jcenter()
99
}
10+
1011
dependencies {
1112
classpath 'com.android.tools.build:gradle:3.4.2'
1213

@@ -15,22 +16,29 @@ buildscript {
1516
}
1617
}
1718

19+
final reactNativePath = '/react-native/android'
20+
final jscAndroidPath = '/jsc-android/dist'
21+
1822
allprojects {
1923
repositories {
2024
maven {
2125
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
22-
url findReactNative()
26+
url findNodeModules() + reactNativePath
27+
}
28+
29+
maven {
30+
// Android JSC is installed from npm
31+
url findNodeModules() + jscAndroidPath
2332
}
2433

25-
mavenLocal()
26-
jcenter()
2734
google()
35+
jcenter()
2836
}
2937
}
3038

31-
final findReactNative() {
32-
final reactNativePath = 'node_modules/react-native/android'
33-
final notFoundMessage = 'Unable to find React Native. Have you run yarn from the root?'
39+
final findNodeModules() {
40+
final reactNativePath = 'node_modules'
41+
final notFoundMessage = 'Unable to find node_modules folder. Have you run yarn from the root?'
3442

3543
def root = file("$rootDir")
3644
if (root == null) {
@@ -101,9 +109,5 @@ final getProjectVersion() {
101109

102110
println "Project version: $version"
103111

104-
if (version.startsWith('^')) {
105-
version = version.substring(1)
106-
}
107-
108112
return version
109113
}

android/settings.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
rootProject.name = 'ReactNativeActivityDemo'
22

3+
// https://react-native-community.github.io/upgrade-helper/?from=0.59.10&to=0.60.0
4+
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle");
5+
applyNativeModulesSettingsGradle(settings)
6+
37
include ':app'

ios.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,16 @@ steps:
2020
command: 'install'
2121
displayName: 'npm install'
2222

23+
- task: CocoaPods@0
24+
inputs:
25+
workingDirectory: 'ios'
26+
forceRepoUpdate: false
2327
- task: Xcode@5
2428
inputs:
2529
actions: 'build'
2630
args: '-UseModernBuildSystem=NO'
2731
configuration: 'Debug'
2832
scheme: 'Activity'
2933
sdk: 'iphoneos'
30-
xcWorkspacePath: '**/Activity.xcodeproj/project.xcworkspace'
34+
xcWorkspacePath: '**/Activity.xcworkspace'
3135
xcodeVersion: 'default' # Options: 8, 9, 10, default, specifyPath

0 commit comments

Comments
 (0)