Skip to content

Commit

Permalink
[TIMOB-24242] Add frameworks search paths from CocoaPods
Browse files Browse the repository at this point in the history
  • Loading branch information
janvennemann committed Feb 16, 2017
1 parent c27a191 commit 45afcb0
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions iphone/plugin/hyperloop.js
Original file line number Diff line number Diff line change
Expand Up @@ -521,22 +521,28 @@ HyperloopiOSBuilder.prototype.generateSourceFiles = function generateSourceFiles
}

var extraHeaderSearchPaths = [];
var extraFrameworkSearchPaths = [];
if (this.hasCocoaPods) {
if (this.cocoaPodsBuildSettings.HEADER_SEARCH_PATHS) {
var addSearchPathsFromCocoaPods = function (target, source) {
if (!(source instanceof Array)) {
return;
}
var cocoaPodsRoot = this.cocoaPodsBuildSettings.PODS_ROOT;
var paths = this.cocoaPodsBuildSettings.HEADER_SEARCH_PATHS.split(" ");
var paths = source.split(" ");
paths.forEach(function(path) {
if (path === '$(inherited)') {
return;
}

var headerSearchPath = path.replace('${PODS_ROOT}', cocoaPodsRoot);
headerSearchPath = headerSearchPath.replace(/"/g, '');
extraHeaderSearchPaths.push(headerSearchPath);
var searchPath = path.replace('${PODS_ROOT}', cocoaPodsRoot);
searchPath = searchPath.replace(/"/g, '');
target.push(searchPath);
});
}
};

addSearchPathsFromCocoaPods(extraHeaderSearchPaths, this.cocoaPodsBuildSettings.HEADER_SEARCH_PATHS);
addSearchPathsFromCocoaPods(extraFrameworkSearchPaths, this.cocoaPodsBuildSettings.FRAMEWORK_SEARCH_PATHS);
}
var extraFrameworkSearchPaths = [];
if (this.hyperloopConfig.ios.thirdparty) {
Object.keys(this.hyperloopConfig.ios.thirdparty).forEach(function(frameworkName) {
var thirdPartyFrameworkConfig = this.hyperloopConfig.ios.thirdparty[frameworkName];
Expand Down

0 comments on commit 45afcb0

Please sign in to comment.