Skip to content

Commit

Permalink
Quick fix for react-native link tvOS issue
Browse files Browse the repository at this point in the history
  • Loading branch information
douglowder committed Nov 22, 2017
1 parent 75123c6 commit 0e2ac2b
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions local-cli/link/ios/getProducts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,24 @@
* project static library
*/
module.exports = function getProducts(project) {
return project
.pbxGroupByName('Products')
.children
.map(c => c.comment)
.filter(c => c.indexOf('.a') > -1);
debugger;
let nativeTargetSection = project.pbxNativeTargetSection();
var results = [];
for (var key in nativeTargetSection) {
if(key.indexOf('_comment') === -1) {
let configurationListId = nativeTargetSection[key].buildConfigurationList;
let configurationList = project.pbxXCConfigurationList()[configurationListId];
let buildConfigurationId = configurationList.buildConfigurations[0].value;
let buildConfiguration = project.pbxXCBuildConfigurationSection()[buildConfigurationId];
if ( !buildConfiguration.buildSettings.SDKROOT || buildConfiguration.buildSettings.SDKROOT.indexOf('appletv') === -1) {
results.push(nativeTargetSection[key].productReference_comment);
}
}
}
return results;
// return project
// .pbxGroupByName('Products')
// .children
// .map(c => c.comment)
// .filter(c => c.indexOf('.a') > -1);
};

2 comments on commit 0e2ac2b

@douglowder
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@grabbou this is an initial exploratory fix for the react-native link issue (facebook#13783) -- it finds the first debug build configuration for each target to see if it is a tvOS target or not. This fixes the issue with linking iOS libraries, but doesn't link the tvOS libraries to the tvOS top-level project target.

@grabbou
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dlowder-salesforce for starting work on this! I am currently quite busy with regular tasks at job - is it okay if I get back to you on that in few days? (monday in particular)

Please sign in to comment.