Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
id: argv.id,
name: argv.name,
url: argv.url || '',
version: '1.0',
guid: uuid.v4(),
'deployment-targets': {},
'sdk-version': this.sdk.name
},
tiappFile = path.join(projectDir, 'tiapp.xml');
if (platforms.original.indexOf('ios') !== -1) {
platforms.original.indexOf('ipad') !== -1 || platforms.original.push('ipad');
platforms.original.indexOf('iphone') !== -1 || platforms.original.push('iphone');
}
ti.availablePlatformsNames.forEach(function (p) {
if (p !== 'ios') {
params['deployment-targets'][p] = platforms.original.indexOf(p) !== -1;
}
});
this.cli.createHook('create.populateTiappXml', this, function (tiapp, params, done) {
// read and populate the tiapp.xml
this.logger.info(__('Writing tiapp.xml'));
projectConfig = appc.util.mix(tiapp, params);
projectConfig.save(tiappFile);
done();
}.bind(this))(fs.existsSync(tiappFile) ? new ti.tiappxml(tiappFile) : new ti.tiappxml(), params, next);
},
logger.info(__('Copying project files'));
var copyOpts = {
preserve: true,
ignoreDirs: this.ignoreDirs,
ignoreFiles: this.ignoreFiles,
callback: function (src, dest, contents) {
logger.debug(__('Copying %s => %s', src.cyan, dest.cyan));
return contents;
}
};
afs.copyDirSyncRecursive(this.mobilewebTitaniumDir, path.join(this.buildDir, 'titanium'), copyOpts);
afs.copyDirSyncRecursive(this.mobilewebThemeDir, path.join(this.buildDir, 'themes'), copyOpts);
copyOpts.rootIgnore = ti.availablePlatformsNames;
afs.copyDirSyncRecursive(this.projectResDir, this.buildDir, copyOpts);
var mobilewebDir = path.join(this.projectResDir, 'mobileweb');
if (fs.existsSync(mobilewebDir)) {
copyOpts.rootIgnore = ['apple_startup_images', 'splash'];
afs.copyDirSyncRecursive(mobilewebDir, this.buildDir, copyOpts);
}
this.cli.emit('build.mobileweb.copyFiles', this, next);
};
function (cb) {
const src = path.join(this.titaniumSdkPath, 'common', 'Resources', 'windows');
_t.logger.debug(__('Copying %s', src.cyan));
copyDir.call(this, {
src: src,
dest: this.buildTargetAssetsDir,
ignoreRootDirs: ti.availablePlatformsNames
}, cb);
},
fs.existsSync(dir) && fs.readdirSync(dir).forEach(function (name) {
var file = path.join(dir, name);
if (fs.statSync(file).isDirectory()) {
if (!isRoot || name == 'mobileweb' || ti.availablePlatformsNames.indexOf(name) == -1) {
walk(file, isMobileWebDir || name == 'mobileweb');
}
return;
}
var m = name.match(/^(.+)\.(otf|woff|ttf|svg)$/);
if (m) {
var p = file.replace(/\\/g, '/').replace(prefix, '');
fonts[m[1]] || (fonts[m[1]] = {});
fonts[m[1]][m[2]] = {
path: isMobileWebDir ? p.replace('mobileweb/', '') : p,
format: fontFormats[m[2]] || m[2]
};
}
});
}(this.projectResDir, false, true));