Permalink
Browse files

Upgrade to React Native 0.28

  • Loading branch information...
1 parent 7e39d97 commit d1cafab6bb290e53a633e3db16c0c9961480fd8d @frantic frantic committed Jun 24, 2016
@@ -57,7 +57,7 @@ import com.android.build.OutputFile
* ]
*/
-apply from: "react.gradle"
+apply from: "../../node_modules/react-native/react.gradle"
/**
* Set this to true to create two separate APKs instead of one:
@@ -1,96 +0,0 @@
-import org.apache.tools.ant.taskdefs.condition.Os
-
-def config = project.hasProperty("react") ? project.react : [];
-
-def bundleAssetName = config.bundleAssetName ?: "index.android.bundle"
-def entryFile = config.entryFile ?: "index.android.js"
-
-// because elvis operator
-def elvisFile(thing) {
- return thing ? file(thing) : null;
-}
-
-def reactRoot = elvisFile(config.root) ?: file("../../")
-def inputExcludes = config.inputExcludes ?: ["android/**", "ios/**"]
-
-void runBefore(String dependentTaskName, Task task) {
- Task dependentTask = tasks.findByPath(dependentTaskName);
- if (dependentTask != null) {
- dependentTask.dependsOn task
- }
-}
-
-gradle.projectsEvaluated {
- // Grab all build types and product flavors
- def buildTypes = android.buildTypes.collect { type -> type.name }
- def productFlavors = android.productFlavors.collect { flavor -> flavor.name }
-
- // When no product flavors defined, use empty
- if (!productFlavors) productFlavors.add('')
-
- productFlavors.each { productFlavorName ->
- buildTypes.each { buildTypeName ->
- // Create variant and source names
- def sourceName = "${buildTypeName}"
- def targetName = "${sourceName.capitalize()}"
- if (productFlavorName) {
- sourceName = "${productFlavorName}${targetName}"
- }
-
- // React js bundle directories
- def jsBundleDirConfigName = "jsBundleDir${targetName}"
- def jsBundleDir = elvisFile(config."$jsBundleDirConfigName") ?:
- file("$buildDir/intermediates/assets/${sourceName}")
-
- def resourcesDirConfigName = "jsBundleDir${targetName}"
- def resourcesDir = elvisFile(config."${resourcesDirConfigName}") ?:
- file("$buildDir/intermediates/res/merged/${sourceName}")
- def jsBundleFile = file("$jsBundleDir/$bundleAssetName")
-
- // Bundle task name for variant
- def bundleJsAndAssetsTaskName = "bundle${targetName}JsAndAssets"
-
- def currentBundleTask = tasks.create(
- name: bundleJsAndAssetsTaskName,
- type: Exec) {
- group = "react"
- description = "bundle JS and assets for ${targetName}."
-
- // Create dirs if they are not there (e.g. the "clean" task just ran)
- doFirst {
- jsBundleDir.mkdirs()
- resourcesDir.mkdirs()
- }
-
- // Set up inputs and outputs so gradle can cache the result
- inputs.files fileTree(dir: reactRoot, excludes: inputExcludes)
- outputs.dir jsBundleDir
- outputs.dir resourcesDir
-
- // Set up the call to the react-native cli
- workingDir reactRoot
-
- // Set up dev mode
- def devEnabled = !targetName.toLowerCase().contains("release")
- if (Os.isFamily(Os.FAMILY_WINDOWS)) {
- commandLine "cmd", "/c", "react-native", "bundle", "--platform", "android", "--dev", "${devEnabled}",
- "--entry-file", entryFile, "--bundle-output", jsBundleFile, "--assets-dest", resourcesDir
- } else {
- commandLine "react-native", "bundle", "--platform", "android", "--dev", "${devEnabled}",
- "--entry-file", entryFile, "--bundle-output", jsBundleFile, "--assets-dest", resourcesDir
- }
-
- enabled config."bundleIn${targetName}" ?: targetName.toLowerCase().contains("release")
- }
-
- // Hook bundle${productFlavor}${buildType}JsAndAssets into the android build process
- currentBundleTask.dependsOn("merge${targetName}Resources")
- currentBundleTask.dependsOn("merge${targetName}Assets")
-
- runBefore("processArmeabi-v7a${targetName}Resources", currentBundleTask)
- runBefore("processX86${targetName}Resources", currentBundleTask)
- runBefore("processUniversal${targetName}Resources", currentBundleTask)
- runBefore("process${targetName}Resources", currentBundleTask)
- }
- }
-}
@@ -52,13 +52,12 @@
import com.burnweb.rnsendintent.RNSendIntentPackage;
public class MainActivity extends ReactActivity {
- private CodePush _codePush;
private ReactNativePushNotificationPackage _pushNotification;
private CallbackManager mCallbackManager;
@Override
protected String getJSBundleFile() {
- return this._codePush.getBundleUrl("index.android.bundle");
+ return CodePush.getBundleUrl();
}
/**
@@ -85,7 +84,6 @@ protected boolean getUseDeveloperSupport() {
*/
@Override
protected List<ReactPackage> getPackages() {
- this._codePush = new CodePush("qwfkzzq7Y8cSrkiuU7aRCkIP7XYLEJ6b-AFoe", this, BuildConfig.DEBUG);
this._pushNotification = new ReactNativePushNotificationPackage(this);
mCallbackManager = new CallbackManager.Factory().create();
@@ -95,7 +93,7 @@ protected boolean getUseDeveloperSupport() {
new LinearGradientPackage(),
new RNSharePackage(),
new RNSendIntentPackage(),
- this._codePush.getReactPackage(),
+ new CodePush("qwfkzzq7Y8cSrkiuU7aRCkIP7XYLEJ6b-AFoe", this, BuildConfig.DEBUG),
this._pushNotification
);
}
@@ -113,7 +111,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
}
@Override
- protected void onNewIntent (Intent intent) {
+ public void onNewIntent (Intent intent) {
super.onNewIntent(intent);
_pushNotification.newIntent(intent);
}
@@ -11,4 +11,4 @@ project(':react-native-code-push').projectDir = new File(rootProject.projectDir,
project(':react-native-push-notification').projectDir = file('../node_modules/react-native-push-notification/RNPushNotificationAndroid')
project(':react-native-share').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-share/android')
project(':react-native-fbsdk').projectDir = new File(settingsDir, '../node_modules/react-native-fbsdk/Android')
-project(':react-native-send-intent').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-send-intent')
+project(':react-native-send-intent').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-send-intent/android')
View
@@ -51,7 +51,7 @@ - (dispatch_queue_t)methodQueue
RCTScrollView *reactScrollView = (RCTScrollView *)scrollView;
[_pinnedViews setObject:pinnedView forKey:reactScrollView.scrollView];
[_distances setObject:distance forKey:reactScrollView.scrollView];
- [reactScrollView setNativeScrollDelegate:self];
+ [reactScrollView addScrollListener:self];
[self scrollViewDidScroll:reactScrollView.scrollView];
}
}
@@ -63,7 +63,7 @@ - (dispatch_queue_t)methodQueue
RCTScrollView *reactScrollView = (RCTScrollView *)scrollView;
[_pinnedViews removeObjectForKey:reactScrollView.scrollView];
[_distances removeObjectForKey:reactScrollView.scrollView];
- [reactScrollView setNativeScrollDelegate:nil];
+ [reactScrollView removeScrollListener:self];
}
}
@@ -192,13 +192,13 @@
isa = PBXNativeTarget;
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "F8v2" */;
buildPhases = (
- BE0B165BA96102DAE4AF6D67 /* 📦 Check Pods Manifest.lock */,
+ BE0B165BA96102DAE4AF6D67 /* [CP] Check Pods Manifest.lock */,
13B07F871A680F5B00A75B9A /* Sources */,
13B07F8C1A680F5B00A75B9A /* Frameworks */,
13B07F8E1A680F5B00A75B9A /* Resources */,
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
- 789BB91E5A251077BA8A4EE8 /* 📦 Embed Pods Frameworks */,
- F391BEA07F3C4EAAEE2D8F23 /* 📦 Copy Pods Resources */,
+ 789BB91E5A251077BA8A4EE8 /* [CP] Embed Pods Frameworks */,
+ F391BEA07F3C4EAAEE2D8F23 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -304,44 +304,44 @@
shellPath = /bin/sh;
shellScript = "../node_modules/react-native/packager/react-native-xcode.sh\n../scripts/store-ip.sh";
};
- 789BB91E5A251077BA8A4EE8 /* 📦 Embed Pods Frameworks */ = {
+ 789BB91E5A251077BA8A4EE8 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
- name = "📦 Embed Pods Frameworks";
+ name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-F8v2/Pods-F8v2-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
- BE0B165BA96102DAE4AF6D67 /* 📦 Check Pods Manifest.lock */ = {
+ BE0B165BA96102DAE4AF6D67 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
- name = "📦 Check Pods Manifest.lock";
+ name = "[CP] Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
- F391BEA07F3C4EAAEE2D8F23 /* 📦 Copy Pods Resources */ = {
+ F391BEA07F3C4EAAEE2D8F23 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
- name = "📦 Copy Pods Resources";
+ name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
View
@@ -12,9 +12,11 @@ target 'F8v2' do
'RCTLinkingIOS',
'RCTVibration',
], :path => '../node_modules/react-native'
- pod 'react-native-fbsdkcore', :path => '../node_modules/react-native-fbsdk/iOS/core'
- pod 'react-native-fbsdklogin', :path => '../node_modules/react-native-fbsdk/iOS/login'
- pod 'react-native-fbsdkshare', :path => '../node_modules/react-native-fbsdk/iOS/share'
+ pod 'react-native-fbsdk', :subspecs => [
+ 'Core',
+ 'Login',
+ 'Share',
+ ], :path => '../node_modules/react-native-fbsdk/iOS'
pod 'CodePush', :path => '../node_modules/react-native-code-push'
end
View
@@ -5,51 +5,55 @@ PODS:
- Bolts/AppLinks (1.7.0):
- Bolts/Tasks
- Bolts/Tasks (1.7.0)
- - CodePush (1.7.3-beta):
+ - CodePush (1.12.2):
+ - CodePush/Core (= 1.12.2)
+ - CodePush/SSZipArchive (= 1.12.2)
+ - React
+ - CodePush/Core (1.12.2):
+ - React
+ - CodePush/SSZipArchive (1.12.2):
- React
- FBSDKCoreKit (4.10.1):
- Bolts (~> 1.5)
- FBSDKLoginKit (4.10.1):
- FBSDKCoreKit
- FBSDKShareKit (4.10.1):
- FBSDKCoreKit
- - React (0.23.1):
- - React/Core (= 0.23.1)
- - react-native-fbsdkcore (0.1.0-alpha.1):
+ - React (0.28.0):
+ - React/Core (= 0.28.0)
+ - react-native-fbsdk/Core (0.2.1):
- FBSDKCoreKit
- React
- - react-native-fbsdklogin (0.1.0-alpha.1):
- - FBSDKCoreKit
+ - react-native-fbsdk/Login (0.2.1):
- FBSDKLoginKit
- React
- - react-native-fbsdkshare (0.1.0-alpha.1):
- - FBSDKCoreKit
+ - react-native-fbsdk/Share (0.2.1):
- FBSDKShareKit
- React
- - React/Core (0.23.1)
- - React/RCTActionSheet (0.23.1):
+ - React/Core (0.28.0)
+ - React/RCTActionSheet (0.28.0):
- React/Core
- - React/RCTImage (0.23.1):
+ - React/RCTImage (0.28.0):
- React/Core
- React/RCTNetwork
- - React/RCTLinkingIOS (0.23.1):
+ - React/RCTLinkingIOS (0.28.0):
- React/Core
- - React/RCTNetwork (0.23.1):
+ - React/RCTNetwork (0.28.0):
- React/Core
- - React/RCTPushNotification (0.23.1):
+ - React/RCTPushNotification (0.28.0):
- React/Core
- - React/RCTText (0.23.1):
+ - React/RCTText (0.28.0):
- React/Core
- - React/RCTVibration (0.23.1):
+ - React/RCTVibration (0.28.0):
- React/Core
- - React/RCTWebSocket (0.23.1):
+ - React/RCTWebSocket (0.28.0):
- React/Core
DEPENDENCIES:
- CodePush (from `../node_modules/react-native-code-push`)
- - react-native-fbsdkcore (from `../node_modules/react-native-fbsdk/iOS/core`)
- - react-native-fbsdklogin (from `../node_modules/react-native-fbsdk/iOS/login`)
- - react-native-fbsdkshare (from `../node_modules/react-native-fbsdk/iOS/share`)
+ - react-native-fbsdk/Core (from `../node_modules/react-native-fbsdk/iOS`)
+ - react-native-fbsdk/Login (from `../node_modules/react-native-fbsdk/iOS`)
+ - react-native-fbsdk/Share (from `../node_modules/react-native-fbsdk/iOS`)
- React/Core (from `../node_modules/react-native`)
- React/RCTActionSheet (from `../node_modules/react-native`)
- React/RCTImage (from `../node_modules/react-native`)
@@ -65,24 +69,18 @@ EXTERNAL SOURCES:
:path: ../node_modules/react-native-code-push
React:
:path: ../node_modules/react-native
- react-native-fbsdkcore:
- :path: ../node_modules/react-native-fbsdk/iOS/core
- react-native-fbsdklogin:
- :path: ../node_modules/react-native-fbsdk/iOS/login
- react-native-fbsdkshare:
- :path: ../node_modules/react-native-fbsdk/iOS/share
+ react-native-fbsdk:
+ :path: ../node_modules/react-native-fbsdk/iOS
SPEC CHECKSUMS:
Bolts: a0058fa3b331c5a1e4402d534f2dae36dbff31e4
- CodePush: b079624335d06b6b309e6b70167f398c709cfcc6
+ CodePush: 96e1b7358f2305daf4fdf8436c0d23a172599de9
FBSDKCoreKit: d2aaed5e9ab7d8d6301c533376a1fbff1cf3deb5
FBSDKLoginKit: 699ff169080e3072de4b9b0faca90bf23dc36deb
FBSDKShareKit: 2fd887cce0056bdda91f99b2021d724a4fed8e88
- React: 0bc1e9a6369dc610ff0b29415ed0cab5229614f5
- react-native-fbsdkcore: f406a8e13011fd39b9c1db5f6bc517b84cfe97d9
- react-native-fbsdklogin: 7b371812b110ef24f3877ab52350df9e321faf6b
- react-native-fbsdkshare: f61448537392187b4d43c2e6b40260e3a1e7c658
+ React: 43544faed4af6a0e8fbc4b3abd26141ed654fa49
+ react-native-fbsdk: f809332ec877fe61466883f6cd775a0accfdf948
-PODFILE CHECKSUM: 45bef4538671c3205d919c48d17fd46190328f35
+PODFILE CHECKSUM: cb0411936cfdb2ef6ccae2a3fc8261c741029580
-COCOAPODS: 1.0.0.beta.6
+COCOAPODS: 1.0.1
@@ -24,7 +24,7 @@
'use strict';
-var React = require('react-native');
+var React = require('react');
var AppState = require('AppState');
var Platform = require('Platform');
var unseenNotificationsCount = require('./tabs/notifications/unseenNotificationsCount');
@@ -23,7 +23,7 @@
*/
'use strict';
-const React = require('react-native');
+const React = require('react');
const ViewPager = require('./ViewPager');
const StyleSheet = require('F8StyleSheet');
@@ -27,7 +27,7 @@
var F8Colors = require('F8Colors');
var Image = require('Image');
-var LinearGradient = require('react-native-linear-gradient');
+import LinearGradient from 'react-native-linear-gradient';
var React = require('React');
var StyleSheet = require('StyleSheet');
var { Text } = require('F8Text');
Oops, something went wrong.

0 comments on commit d1cafab

Please sign in to comment.