-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Link both iOS and tvOS libraries with react-native link (fix #13783)
Summary: Fix issues with the react-native CLI when linking iOS and tvOS libraries to a project created with `react-native init`. (#13783) Verified the changes against test project at https://github.com/dlowder-salesforce/react-native-link-test. Both `react-native link react-native-svg` and `react-native unlink react-native-svg` work correctly on this project. Added new unit test for the new file added to `local-cli/link/ios`. [CLI] [BUGFIX] `react-native link` has been fixed to correctly link iOS and tvOS targets. [IOS] [BUGFIX] `react-native link` has been fixed to correctly link iOS and tvOS targets. Closes #17231 Differential Revision: D6837567 Pulled By: hramos fbshipit-source-id: 234d3d3966ae1b89cd16a37c95d303553f7ba5f5
- Loading branch information
1 parent
5fba82d
commit a63fd37
Showing
11 changed files
with
88 additions
and
9 deletions.
There are no files selected for viewing
Binary file modified
BIN
-79 Bytes
(100%)
...sts/ReferenceImages/RNTester-js-RNTesterApp.ios/testARTExample_1-iOS10_tvOS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+870 Bytes
(100%)
.../ReferenceImages/RNTester-js-RNTesterApp.ios/testLayoutExample_1-iOS10_tvOS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+68.5 KB
(170%)
...erenceImages/RNTester-js-RNTesterApp.ios/testScrollViewExample_1-iOS10_tvOS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+54 Bytes
(100%)
...ts/ReferenceImages/RNTester-js-RNTesterApp.ios/testTextExample_1-iOS10_tvOS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-35 Bytes
(100%)
...ts/ReferenceImages/RNTester-js-RNTesterApp.ios/testViewExample_1-iOS10_tvOS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* Copyright (c) 2013-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* All rights reserved. | ||
* | ||
* @emails oncall+javascript_foundation | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const xcode = require('xcode'); | ||
const getTargets = require('../../ios/getTargets'); | ||
const path = require('path'); | ||
|
||
const project = xcode.project( | ||
path.join(__dirname, '../../__fixtures__/project.pbxproj') | ||
); | ||
|
||
describe('ios::getTargets', () => { | ||
beforeEach(() => { | ||
project.parseSync(); | ||
}); | ||
|
||
it('should return an array of project targets', () => { | ||
const targets = getTargets(project); | ||
expect(targets.length).toBe(2); | ||
expect(targets[0].name).toContain('Basic.app'); | ||
expect(targets[1].name).toContain('BasicTests.xctest'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* Given xcodeproj it returns list of targets | ||
*/ | ||
module.exports = function getTargets(project) { | ||
let targets = project.getFirstProject().firstProject.targets; | ||
let nativeTargetSection = project.pbxNativeTargetSection(); | ||
return targets.map(function(target) { | ||
let key = target.value; | ||
let configurationListId = project.pbxNativeTargetSection()[key].buildConfigurationList; | ||
let configurationList = project.pbxXCConfigurationList()[configurationListId]; | ||
let buildConfigurationId = configurationList.buildConfigurations[0].value; | ||
let buildConfiguration = project.pbxXCBuildConfigurationSection()[buildConfigurationId]; | ||
return { | ||
uuid: key, | ||
target: nativeTargetSection[key], | ||
name: nativeTargetSection[key].productReference_comment, | ||
isTVOS: (buildConfiguration.buildSettings.SDKROOT && (buildConfiguration.buildSettings.SDKROOT.indexOf('appletv') !== -1)) || false | ||
} | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters