Procházet zdrojové kódy

Change prelink script for #223

Ben Hsieh před 7 roky
rodič
revize
bd54a37d01

+ 10
- 9
src/ios/RNFetchBlob/RNFetchBlob.h Zobrazit soubor

@@ -4,25 +4,26 @@
4 4
 //  Created by wkh237 on 2016/4/28.
5 5
 //
6 6
 
7
-// comment out this line if your RN project >= 0.40
8
-#define OLD_IMPORT
7
+//XXX: DO NO REMOVE THIS LINE IF YOU'RE USING IT ON RN > 0.40 PROJECT
8
+//#define RN040_IMPORT
9
+
9 10
 
10 11
 #ifndef RNFetchBlob_h
11 12
 #define RNFetchBlob_h
12 13
 
13 14
 
14
-#ifdef OLD_IMPORT
15
-#import "RCTBridgeModule.h"
16
-#import "RCTLog.h"
17
-#import "RCTRootView.h"
18
-#import "RCTBridge.h"
19
-#import "RCTEventDispatcher.h"
20
-#else
15
+#ifdef RN040_IMPORT
21 16
 #import <React/RCTLog.h>
22 17
 #import <React/RCTRootView.h>
23 18
 #import <React/RCTBridge.h>
24 19
 #import <React/RCTEventDispatcher.h>
25 20
 #import <React/RCTBridgeModule.h>
21
+#else
22
+#import "RCTBridgeModule.h"
23
+#import "RCTLog.h"
24
+#import "RCTRootView.h"
25
+#import "RCTBridge.h"
26
+#import "RCTEventDispatcher.h"
26 27
 #endif
27 28
 
28 29
 #import <UIKit/UIKit.h>

+ 3
- 3
src/ios/RNFetchBlobFS.h Zobrazit soubor

@@ -12,10 +12,10 @@
12 12
 #import "RNFetchBlob.h"
13 13
 
14 14
 #import <Foundation/Foundation.h>
15
-#ifdef OLD_IMPORT
16
-#import "RCTBridgeModule.h"
17
-#else
15
+#ifdef RN040_IMPORT
18 16
 #import <React/RCTBridgeModule.h>
17
+#else
18
+#import "RCTBridgeModule.h"
19 19
 #endif
20 20
 
21 21
 @import AssetsLibrary;

+ 4
- 4
src/ios/RNFetchBlobFS.m Zobrazit soubor

@@ -13,12 +13,12 @@
13 13
 #import "IOS7Polyfill.h"
14 14
 @import AssetsLibrary;
15 15
 
16
-#ifdef OLD_IMPORT
17
-#import "RCTBridge.h"
18
-#import "RCTEventDispatcher.h"
19
-#else
16
+#ifdef RN040_IMPORT
20 17
 #import <React/RCTBridge.h>
21 18
 #import <React/RCTEventDispatcher.h>
19
+#else
20
+#import "RCTBridge.h"
21
+#import "RCTEventDispatcher.h"
22 22
 #endif
23 23
 
24 24
 

+ 3
- 3
src/ios/RNFetchBlobNetwork.h Zobrazit soubor

@@ -10,10 +10,10 @@
10 10
 #import "RNFetchBlobProgress.h"
11 11
 #import "RNFetchBlobFS.h"
12 12
 
13
-#ifdef OLD_IMPORT
14
-#import "RCTBridgeModule.h"
15
-#else
13
+#ifdef RN040_IMPORT
16 14
 #import <React/RCTBridgeModule.h>
15
+#else
16
+#import "RCTBridgeModule.h"
17 17
 #endif
18 18
 
19 19
 #ifndef RNFetchBlobNetwork_h

+ 6
- 6
src/ios/RNFetchBlobNetwork.m Zobrazit soubor

@@ -17,16 +17,16 @@
17 17
 #import <CommonCrypto/CommonDigest.h>
18 18
 #import "RNFetchBlobProgress.h"
19 19
 
20
-#ifdef OLD_IMPORT
21
-#import "RCTRootView.h"
22
-#import "RCTLog.h"
23
-#import "RCTEventDispatcher.h"
24
-#import "RCTBridge.h"
25
-#else
20
+#ifdef RN040_IMPORT
26 21
 #import <React/RCTRootView.h>
27 22
 #import <React/RCTLog.h>
28 23
 #import <React/RCTEventDispatcher.h>
29 24
 #import <React/RCTBridge.h>
25
+#else
26
+#import "RCTRootView.h"
27
+#import "RCTLog.h"
28
+#import "RCTEventDispatcher.h"
29
+#import "RCTBridge.h"
30 30
 #endif
31 31
 
32 32
 ////////////////////////////////////////

+ 3
- 3
src/ios/RNFetchBlobReqBuilder.m Zobrazit soubor

@@ -13,10 +13,10 @@
13 13
 #import "RNFetchBlobFS.h"
14 14
 #import "IOS7Polyfill.h"
15 15
 
16
-#ifdef OLD_IMPORT
17
-#import "RCTLog.h"
18
-#else
16
+#ifdef RN040_IMPORT
19 17
 #import <React/RCTLog.h>
18
+#else
19
+#import "RCTLog.h"
20 20
 #endif
21 21
 
22 22
 @interface RNFetchBlobReqBuilder()

+ 2
- 2
src/scripts/prelink.js Zobrazit soubor

@@ -21,13 +21,13 @@ try {
21 21
     console.log('adding OkHttp3 dependency to pre 0.28 project .. ok')
22 22
   }
23 23
   else if (VERSION >= 0.40) {
24
-    console.log('Remove OLD_IMPORT for RN >= 0.40 project ..')
24
+    console.log('Adding RN040_IMPORT for RN >= 0.40 project ..')
25 25
     glob('**/RNFetchBlob.h',{}, function(err, files) {
26 26
       if(Array.isArray(files)) {
27 27
         var target = process.cwd() + '/' + files[0];
28 28
         console.log('\033[92mPatching .. \033[97m' + target);
29 29
         var data = fs.readFileSync(target);
30
-        fs.writeFileSync(target, String(data).replace(/#define OLD_IMPORT/, ''));
30
+        fs.writeFileSync(target, String(data).replace(/\/\/#define RN040_IMPORT/, '#define RN040_IMPORT'));
31 31
         console.log('done.')
32 32
       }
33 33
     })