Skip to content

Commit

Permalink
Merge pull request #3166 from cb1kenobi/timob-11368
Browse files Browse the repository at this point in the history
[TIMOB-11368] Fixed missing files and extra files when performing a mobile web build.
  • Loading branch information
Bryan Hughes committed Oct 12, 2012
2 parents 4dad186 + 7a53934 commit 18f6375
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
17 changes: 11 additions & 6 deletions mobileweb/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,15 @@ build.prototype = {
wrench.mkdirSyncRecursive(this.buildDir);
afs.copyDirSyncRecursive(this.mobilewebThemeDir, this.buildDir + '/themes', { preserve: true, logger: this.logger.debug });
afs.copyDirSyncRecursive(this.mobilewebTitaniumDir, this.buildDir + '/titanium', { preserve: true, logger: this.logger.debug });
afs.copyDirSyncRecursive(this.projectResDir, this.buildDir, { preserve: true, logger: this.logger.debug }, ti.availablePlatforms.filter(function (p) { return p != 'mobileweb'; }));
afs.copyDirSyncRecursive(this.projectResDir, this.buildDir, { preserve: true, logger: this.logger.debug, rootIgnore: ti.filterPlatforms('mobileweb') });
if (afs.exists(this.projectResDir, 'mobileweb')) {
afs.copyDirSyncRecursive(this.projectResDir + '/mobileweb', this.buildDir + '/mobileweb', { preserve: true, logger: this.logger.debug, rootIgnores: ['apple_startup_images', 'splash'] });
afs.copyDirSyncRecursive(this.projectResDir + '/mobileweb', this.buildDir + '/mobileweb', { preserve: true, logger: this.logger.debug, rootIgnore: ['apple_startup_images', 'splash'] });
['Default.jpg', 'Default-Portrait.jpg', 'Default-Landscape.jpg'].forEach(function (file) {
file = this.projectResDir + '/mobileweb/apple_startup_images/' + file;
afs.exists(file) && afs.copyFileSync(file, this.buildDir + '/mobileweb/apple_startup_images', { logger: this.logger.debug });
if (afs.exists(file)) {
afs.copyFileSync(file, this.buildDir, { logger: this.logger.debug });
afs.copyFileSync(file, this.buildDir + '/mobileweb/apple_startup_images', { logger: this.logger.debug });
}
}, this);
}
callback();
Expand Down Expand Up @@ -682,14 +685,16 @@ build.prototype = {
createIcons: function (callback) {
this.logger.info(__('Creating favicon and Apple touch icons'));

var file = this.projectResDir + '/' + this.tiapp.icon;
var file = path.join(this.projectResDir, this.tiapp.icon);
if (!/\.(png|jpg|gif)$/.test(file) || !afs.exists(file)) {
file = this.projectResDir + '/mobileweb/appicon.png';
file = path.join(this.projectResDir, 'mobileweb', 'appicon.png');
}

if (afs.exists(file)) {
afs.copyFileSync(file, this.buildDir, { logger: this.logger.debug });

appc.image.resize(file, [
{ file: this.buildDir + '/favicon.png', width: 16, height: 16 },
{ file: this.buildDir + '/favicon.ico', width: 16, height: 16 },
{ file: this.buildDir + '/apple-touch-icon-precomposed.png', width: 57, height: 57 },
{ file: this.buildDir + '/apple-touch-icon-57x57-precomposed.png', width: 57, height: 57 },
{ file: this.buildDir + '/apple-touch-icon-72x72-precomposed.png', width: 72, height: 72 },
Expand Down
2 changes: 1 addition & 1 deletion support/node_modules/titanium-sdk/lib/titanium.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 18f6375

Please sign in to comment.