function writeDocsJson () { var config = require(options.cwd + '/docs.json'); config.versions = config.versions.filter(function (version) { return version.indexOf('rc') < 0; }); config.versions.unshift(newVersion); //-- only set to default if not a release candidate config.latest = newVersion; fs.writeFileSync(options.cwd + '/docs.json', JSON.stringify(config, null, 2)); }
var normalizeVersion = function (data, version) { if ( data.versions.indexOf(version) !== -1 ) { return version; } else { return browserslist.versionAliases[data.name][version]; } };
function updateSite () { start('Adding new version of the docs site...'); var options = { cwd: './code.material.angularjs.org' }, config = require(options.cwd + '/docs.json'); config.versions.unshift(newVersion); config.latest = newVersion; fs.writeFileSync(options.cwd + '/docs.json', JSON.stringify(config, null, 2)); //-- build files for bower exec([ 'rm -rf dist', 'gulp docs', 'sed -i \'\' \'s,http:\\/\\/localhost:8080\\/angular-material,http:\\/\\/cdn.rawgit.com/angular/bower-material/v{{newVersion}}/angular-material,g\' dist/docs/docs.js' ]); //-- copy files over to site repo exec([ 'rm -rf latest', 'cp -Rf ../dist/docs {{newVersion}}', 'cp -Rf ../dist/docs latest', 'git add -A', 'git commit -m "release: version {{newVersion}}"', 'rm -rf ../dist' ], options); done(); //-- add steps to push script pushCmds.push( comment('push the site'), 'cd ' + options.cwd, 'git push', 'cd ..' ); }
h.platforms().forEach(function (platform) { var pkg = path.join(__dirname, '../../lib/platforms', platform, 'package.json'), versions = require(pkg).versions; versions.forEach(function (version) { test(format('cli: tarifa platform add %s@%s', platform, version), function (t) { var st = spawn(t, h.cmd(format('platform add %s@%s', platform, version)), { stdio: 'inherit' }); st.succeeds(); st.end(); }); test('cli: tarifa update --force', function (t) { var st = spawn(t, h.cmd('update --force'), { stdio: 'inherit' }); st.succeeds(); st.end(); }); test(format('cli: tarifa remove %s@%s', platform, version), function (t) { var st = spawn(t, h.cmd(format('platform remove %s', platform)), { stdio: 'inherit' }); st.succeeds(); st.end(); }); }); });
select: function (name, version) { var data = browserslist.byName(name); if ( data.versions.indexOf(version) == -1 ) { throw 'Unknown version ' + version + ' of ' + name; } return [data.name + ' ' + version]; }
module.exports.beforeCompile = function (conf, options) { var versions = require(path.resolve(__dirname, '../../package.json')).versions; if(versions.indexOf(conf.platformVersion) > -1) { var m = path.resolve(__dirname, '../../versions', conf.platformVersion, 'settings'); return require(m).beforeCompile(conf, options); } else { return options; } };
platforms.forEach(function(platform) { var version = platformHelper.getVersion(platform), platformName = platformHelper.getName(platform); if(version){ var versions = require(path.join(__dirname, '../platforms', platformName, 'package.json')).versions; if(versions.indexOf(version) < 0){ print.warning("version %s of platform %s is not supported by tarifa!", version, platformName); } } });
function updateSite () { start('Adding new version of the docs site...'); var options = { cwd: './code.material.angularjs.org' }, config = require(options.cwd + '/docs.json'); config.versions = config.versions.filter(function (version) { return version.indexOf('rc') < 0; }); config.versions.unshift(newVersion); //-- only set to default if not a release candidate if (newVersion.indexOf('rc') < 0) config.latest = newVersion; fs.writeFileSync(options.cwd + '/docs.json', JSON.stringify(config, null, 2)); //-- build files for bower exec([ 'rm -rf dist', 'gulp docs', 'sed -i \'\' \'s,http:\\/\\/localhost:8080\\/angular-material,https:\\/\\/gitcdn.xyz/repo/angular/bower-material/v{{newVersion}}/angular-material,g\' dist/docs/docs.js' ]); //-- copy files over to site repo exec([ 'rm -rf ./*-rc*', 'cp -Rf ../dist/docs {{newVersion}}', ( newVersion.indexOf('rc') < 0 ? 'rm -rf latest && cp -Rf ../dist/docs latest' : '# skipped latest because this is a release candidate' ), 'git add -A', 'git commit -m "release: version {{newVersion}}"', 'rm -rf ../dist' ], options); done(); //-- add steps to push script pushCmds.push( comment('push the site'), 'cd ' + options.cwd, 'git pull --rebase', 'git push', 'cd ..' ); }
module.exports.beforeCompile = function (conf, options) { options.device = true; options.argv = [ '--nosign' ]; var versions = require(path.resolve(__dirname, '../../package.json')).versions, mod = path.resolve(__dirname, '../../versions', conf.platformVersion, 'settings'); if(versions.indexOf(conf.platformVersion) > -1) { try { var m = require(mod); } catch(err) { return options; } return m.beforeCompile(conf, options); } return options; };
module.exports.create = function (root, keystore, alias, storepass, keypass, platformVersion) { var versions = require(path.resolve(__dirname, '../package.json')).versions, tmpl; if(versions.indexOf(platformVersion) > -1) { tmpl = require(path.resolve(__dirname, '../versions', platformVersion,'settings')).signingTemplate; } else { tmpl = "keystore=%s\nkey.alias=%s\nkeystore.password=%s\nkey.password=%s"; } keystore = path.normalize(keystore); if (path.sep === '\\') keystore = path.sep === '\\' ? keystore.replace(/\\/g, '\\\\') : keystore; return fs.write( releasePropertiesPath(root), format(tmpl, keystore, alias, storepass, keypass) ); };