Skip to content

Commit

Permalink
Fix auto link on react-native 68+ (#7500)
Browse files Browse the repository at this point in the history
  • Loading branch information
yogevbd authored Apr 11, 2022
1 parent 4d08d1f commit ff03c2a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions autolink/postlink/path.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
var glob = require('glob');
var ignoreFolders = {ignore: ['node_modules/**', '**/build/**', '**/Build/**', '**/DerivedData/**', '**/*-tvOS*/**']};
var ignoreFolders = {
ignore: ['node_modules/**', '**/build/**', '**/Build/**', '**/DerivedData/**', '**/*-tvOS*/**'],
};

var manifestPath = glob.sync('**/AndroidManifest.xml', ignoreFolders)[0];

Expand All @@ -9,6 +11,10 @@ var mainApplicationJava = glob.sync('**/MainApplication.java', ignoreFolders)[0]
exports.mainApplicationJava = mainApplicationJava;
exports.rootGradle = mainApplicationJava.replace(/android\/app\/.*\.java/, 'android/build.gradle');

exports.appDelegate = glob.sync('**/AppDelegate.m', ignoreFolders)[0];
var reactNativeVersion = require('../../../react-native/package.json').version;
exports.appDelegate = glob.sync(
reactNativeVersion < '0.68.0' ? '**/AppDelegate.m' : '**/AppDelegate.mm',
ignoreFolders
)[0];
exports.podFile = glob.sync('**/Podfile', ignoreFolders)[0];
exports.plist = glob.sync('**/info.plist', ignoreFolders)[0];
exports.plist = glob.sync('**/info.plist', ignoreFolders)[0];

0 comments on commit ff03c2a

Please sign in to comment.