Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-23665] Make sure custom classes will be added to Xcode Project #43

Merged
merged 5 commits into from
Jul 29, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 19 additions & 7 deletions iphone/plugin/hyperloop.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ var TI_MIN = '5.4.0';
var IOS_SDK_MIN = '9.0';
// enum for ios javascript core
var coreLib = {
JSCore: 'libhyperloop-jscore.a',
TiCore: 'libhyperloop-ticore.a'
JSCore: 'libhyperloop-jscore.a',
TiCore: 'libhyperloop-ticore.a'
};

var path = require('path'),
Expand Down Expand Up @@ -455,6 +455,7 @@ HyperloopiOSBuilder.prototype.generateSourceFiles = function generateSourceFiles
}

this.metabase = metabase;
this.metabase.classes = this.metabase.classes || {};

if (cached && this.swiftSources.length === 0 && !this.forceMetabase) {
// if cached, skip generation
Expand Down Expand Up @@ -612,9 +613,9 @@ HyperloopiOSBuilder.prototype.copyHyperloopJSFiles = function copyHyperloopJSFil
builder.unmarkBuildDirFiles(destFile);

builder.currentBuildManifest.files[rel] = {
hash: contents === null && prev ? prev.hash : hash || builder.hash(contents || ''),
hash: contents === null && prev ? prev.hash : hash || builder.hash(contents || ''),
mtime: contents === null && prev ? prev.mtime : srcMtime,
size: contents === null && prev ? prev.size : srcStat.size
size: contents === null && prev ? prev.size : srcStat.size
};

if (changed) {
Expand Down Expand Up @@ -669,7 +670,18 @@ HyperloopiOSBuilder.prototype.updateXcodeProject = function updateXcodeProject()
var data = this.xcodeprojectdata;
var nativeModules = Object.keys(this.nativeModules);

if (!nativeModules.length) {
// third party libraries won't have an entry in native modules so we explicitly
// check for those here
var thirdPartyFrameworksUsed = false;
if (this.hyperloopConfig.ios.thirdparty) {
var usedPackages = Object.keys(this.packages);
thirdPartyFrameworksUsed = Object.keys(this.hyperloopConfig.ios.thirdparty).some(function(thirdPartyFramework) {
return usedPackages.some(function (packageName) {
return packageName === thirdPartyFramework;
});
});
}
if (!nativeModules.length && !thirdPartyFrameworksUsed) {
return;
}

Expand Down Expand Up @@ -1009,11 +1021,11 @@ HyperloopiOSBuilder.prototype.hookXcodebuild = function hookXcodebuild(data) {
this.headers.forEach(function (header) {
addParam('HEADER_SEARCH_PATHS', header);
});
//For some reason, when using ticore and having custom headers, the original header search path goes missing.
//For some reason, when using ticore and having custom headers, the original header search path goes missing.
//FIX ME
if(!this.builder.tiapp.ios['use-jscore-framework']) {
addParam('HEADER_SEARCH_PATHS', 'headers');
}
}
}

addParam('GCC_PREPROCESSOR_DEFINITIONS', '$(inherited) HYPERLOOP=1');
Expand Down