Skip to content

Commit

Permalink
Working module inclusion!
Browse files Browse the repository at this point in the history
  • Loading branch information
hansemannn committed Jul 31, 2018
1 parent e539012 commit 7fc437f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
24 changes: 9 additions & 15 deletions iphone/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2209,7 +2209,6 @@ iOSBuilder.prototype.scrubbedModuleId = function (moduleId) {
}).join('');
};


/**
* Performs the build operations.
*
Expand Down Expand Up @@ -3256,13 +3255,18 @@ iOSBuilder.prototype.createXcodeProject = function createXcodeProject(next) {
fileRefUuid = this.generateXcodeUuid(xcodeProject),
buildFileUuid = this.generateXcodeUuid(xcodeProject);

// Framworks are handled by our framework manager!
if (isFramework) {
return;
}

// add the file reference
xobjs.PBXFileReference[fileRefUuid] = {
isa: 'PBXFileReference',
lastKnownFileType: isFramework ? 'wrapper.framework' : 'archive.ar',
lastKnownFileType: 'archive.ar',
name: lib.libName,
path: '"' + lib.libFile + '"',
sourceTree: isFramework ? 'BUILT_PRODUCTS_DIR' : '"<absolute>"'
sourceTree: '"<absolute>"'
};
xobjs.PBXFileReference[fileRefUuid + '_comment'] = lib.libName;

Expand Down Expand Up @@ -3290,18 +3294,8 @@ iOSBuilder.prototype.createXcodeProject = function createXcodeProject(next) {
xobjs.XCConfigurationList[xobjs.PBXNativeTarget[mainTargetUuid].buildConfigurationList].buildConfigurations.forEach(function (buildConf) {
var buildSettings = xobjs.XCBuildConfiguration[buildConf.value].buildSettings;

// Use LIBRARY_SEARCH_PATHS for libraries and FRAMEWORK_SEARCH_PATHS for frameworks
if (isFramework) {
// This returns a String by default, because the Xcode template is empty
// We need to map it to an array. Not sure if this is the correct way to handle it
if (!buildSettings.FRAMEWORK_SEARCH_PATHS || typeof buildSettings.FRAMEWORK_SEARCH_PATHS !== 'object') {
buildSettings.FRAMEWORK_SEARCH_PATHS = [ '"$(inherited)"' ];
}
buildSettings.FRAMEWORK_SEARCH_PATHS.push('"\\"' + path.dirname(lib.libFile) + '\\""');
} else {
buildSettings.LIBRARY_SEARCH_PATHS || (buildSettings.LIBRARY_SEARCH_PATHS = []);
buildSettings.LIBRARY_SEARCH_PATHS.push('"\\"' + path.dirname(lib.libFile) + '\\""');
}
buildSettings.LIBRARY_SEARCH_PATHS || (buildSettings.LIBRARY_SEARCH_PATHS = []);
buildSettings.LIBRARY_SEARCH_PATHS.push('"\\"' + path.dirname(lib.libFile) + '\\""');
});
}, this);
} else {
Expand Down
1 change: 1 addition & 0 deletions iphone/cli/hooks/frameworks.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class FrameworkManager {
path.join(this._builder.projectDir, 'platform', 'iphone')
];
for (let module of this._builder.modules) {
pathsToScan.push(path.join(module.modulePath));
pathsToScan.push(path.join(module.modulePath, 'platform'));
pathsToScan.push(path.join(module.modulePath, 'Resources'));
}
Expand Down

0 comments on commit 7fc437f

Please sign in to comment.