Browse Source

Remove unnecessary prelink script

Ben Hsieh 8 years ago
parent
commit
fd95d7073e
1 changed files with 0 additions and 25 deletions
  1. 0
    25
      src/scripts/prelink.js

+ 0
- 25
src/scripts/prelink.js View File

6
   var PACKAGE_JSON = process.cwd() + '/package.json';
6
   var PACKAGE_JSON = process.cwd() + '/package.json';
7
   var package = JSON.parse(fs.readFileSync(PACKAGE_JSON));
7
   var package = JSON.parse(fs.readFileSync(PACKAGE_JSON));
8
   var APP_NAME = package.name;
8
   var APP_NAME = package.name;
9
-  var APPLICATION_MAIN = glob.sync(process.cwd() + '/android/app/src/main/**/MainApplication.java')[0];
10
   var PACKAGE_GRADLE = process.cwd() + '/node_modules/react-native-fetch-blob/android/build.gradle'
9
   var PACKAGE_GRADLE = process.cwd() + '/node_modules/react-native-fetch-blob/android/build.gradle'
11
-  var hasNecessaryFile = MANIFEST_PATH && APPLICATION_MAIN;
12
   var VERSION = checkVersion();
10
   var VERSION = checkVersion();
13
 
11
 
14
   console.log('RNFetchBlob detected app version => ' + VERSION);
12
   console.log('RNFetchBlob detected app version => ' + VERSION);
15
 
13
 
16
-  if(VERSION >= 0.29) {
17
-    console.log('RNFetchBlob patching MainApplication.java .. ');
18
-    if(!hasNecessaryFile) {
19
-      console.log(
20
-        '\033[95mreact-native-fetch-blob\033[97m link \033[91mFAILED \033[97m\nCould not automatically link Android package, '+
21
-        'please follow the instructions to manually link the library : ' +
22
-        '\033[4mhttps://github.com/wkh237/react-native-fetch-blob/wiki/Manually-Link-Package\n\n')
23
-      return
24
-    }
25
-    var main = fs.readFileSync(APPLICATION_MAIN);
26
-    if(String(main).match('new RNFetchBlobPackage()') === null) {
27
-
28
-      main = String(main).replace('new MainReactPackage()', 'new RNFetchBlobPackage(),\n           new MainReactPackage()');
29
-      main = String(main).replace('import com.facebook.react.ReactApplication;', 'import com.facebook.react.ReactApplication;\nimport com.RNFetchBlob.RNFetchBlobPackage;')
30
-
31
-      fs.writeFileSync(APPLICATION_MAIN, main);
32
-      console.log('RNFetchBlob patching MainApplication.java .. ok')
33
-    }
34
-    else {
35
-      console.log('Project already linked, process skipped.');
36
-    }
37
-  }
38
-
39
   if(VERSION < 0.28) {
14
   if(VERSION < 0.28) {
40
     console.log('You project version is '+ VERSION + ' which may not compatible to react-native-fetch-blob 7.0+, please consider upgrade your application template to react-native 0.27+.')
15
     console.log('You project version is '+ VERSION + ' which may not compatible to react-native-fetch-blob 7.0+, please consider upgrade your application template to react-native 0.27+.')
41
     // add OkHttp3 dependency fo pre 0.28 project
16
     // add OkHttp3 dependency fo pre 0.28 project