Skip to content

Commit

Permalink
Merge pull request #7791 from cb1kenobi/timob-20489_5_2_X
Browse files Browse the repository at this point in the history
[TIMOB-20489] (5_2_X) Added support for a 'Resource' dir for iOS modules that…
  • Loading branch information
feons committed Mar 3, 2016
2 parents fa6abf7 + b983659 commit 1d07a55
Show file tree
Hide file tree
Showing 8 changed files with 239 additions and 283 deletions.
11 changes: 6 additions & 5 deletions cli/commands/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,16 @@ exports.title = __('Build');
exports.desc = __('builds a project');
exports.extendedDesc = __('Builds an existing app or module project.');

exports.config = function (logger, config, cli) {
exports.config = function config(logger, config, cli) {
fields.setup({ colors: cli.argv.colors });

// start patching the logger here
patchLogger(logger, cli);

return function (finished) {
cli.createHook('build.config', function (callback) {
// note: it's currently impossible for the module build to declare any
// config options/flags.
ti.platformOptions(logger, config, cli, 'build', function (platformConf) {
var conf = {
flags: {
Expand Down Expand Up @@ -229,7 +231,7 @@ exports.config = function (logger, config, cli) {
};
};

exports.validate = function (logger, config, cli) {
exports.validate = function validate(logger, config, cli) {
// Determine if the project is an app or a module, run appropriate build command
if (cli.argv.type === 'module') {

Expand Down Expand Up @@ -275,9 +277,8 @@ exports.validate = function (logger, config, cli) {
}
};

exports.run = function (logger, config, cli, finished) {

var buildFile = (cli.argv.type === 'module') ? '_buildModule.js' :'_build.js',
exports.run = function run(logger, config, cli, finished) {
var buildFile = cli.argv.type === 'module' ? '_buildModule.js' :'_build.js',
platform = ti.resolvePlatform(cli.argv.platform),
buildModule = path.join(__dirname, '..', '..', platform, 'cli', 'commands', buildFile),
counter = 0;
Expand Down
3 changes: 2 additions & 1 deletion iphone/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2094,7 +2094,7 @@ iOSBuilder.prototype.initialize = function initialize() {
this.xcodeTarget = /^device|simulator$/.test(this.target) ? 'Debug' : 'Release';
this.xcodeTargetOS = this.target === 'simulator' ? 'iphonesimulator' : 'iphoneos';

this.iosBuildDir = path.join(this.buildDir, 'build', 'Products', this.xcodeTarget + '-' + (this.target === 'simulator' ? 'iphonesimulator' : 'iphoneos'));
this.iosBuildDir = path.join(this.buildDir, 'build', 'Products', this.xcodeTarget + '-' + this.xcodeTargetOS);
this.xcodeAppDir = path.join(this.iosBuildDir, this.tiapp.name + '.app');
this.xcodeProjectConfigFile = path.join(this.buildDir, 'project.xcconfig');
this.buildAssetsDir = path.join(this.buildDir, 'assets');
Expand Down Expand Up @@ -4291,6 +4291,7 @@ iOSBuilder.prototype.copyResources = function copyResources(next) {
walk(path.join(module.modulePath, 'assets'), path.join(this.xcodeAppDir, 'modules', module.id.toLowerCase()));
walk(path.join(module.modulePath, 'platform', 'iphone'), this.buildDir);
walk(path.join(module.modulePath, 'platform', 'ios'), this.buildDir);
walk(path.join(module.modulePath, 'Resources'), this.xcodeAppDir);
}, this);

this.logger.info(__('Analyzing localized launch images'));
Expand Down

0 comments on commit 1d07a55

Please sign in to comment.