0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-27 09:50:52 -05:00

changed naming approach for prerelease versions

This commit is contained in:
liabru 2016-09-03 23:25:07 +01:00
parent 3883981097
commit 83ae546ad6
2 changed files with 13 additions and 6 deletions

View file

@ -87,11 +87,11 @@ gulp.task('release:push:docs', function(callback) {
});
gulp.task('build:dev', function() {
return build(extend(extend({}, pkg), { version: 'dev' }));
return build(extend(extend({}, pkg), { version: pkg.version + '-dev' }));
});
gulp.task('build:edge', function() {
return build(extend(extend({}, pkg), { version: 'master' }));
return build(extend(extend({}, pkg), { version: pkg.version + '-alpha' }));
});
gulp.task('build:release', function() {
@ -113,7 +113,14 @@ gulp.task('watch', function() {
var bundle = function() {
gutil.log('Updated bundle build/matter-dev.js');
b.bundle().pipe(fs.createWriteStream('build/matter-dev.js'));
b.bundle()
.pipe(through2({ objectMode: true }, function(chunk, encoding, callback) {
return callback(
null,
chunk.toString().replace(/@@VERSION@@/g, pkg.version + '-dev')
);
}))
.pipe(fs.createWriteStream('build/matter-dev.js'));
};
b.on('update', bundle);
@ -243,7 +250,7 @@ var build = function(options) {
gutil.log('Building', filename, options.date);
var compiled = gulp.src(['src/module/main.js'])
.pipe(replace("version = 'master'", "version = '" + options.version + "'"))
.pipe(replace('@@VERSION@@', options.version))
.pipe(through2.obj(function(file, enc, next){
browserify(file.path, { standalone: 'Matter' })
.bundle(function(err, res){
@ -252,7 +259,7 @@ var build = function(options) {
});
}));
if (options.version !== 'dev') {
if (!options.version.includes('-')) {
compiled.pipe(preprocess({ context: { DEBUG: false } }));
}

View file

@ -26,7 +26,7 @@ var Plugin = require('./Plugin');
* @readOnly
* @type {String}
*/
Matter.version = 'master';
Matter.version = '@@VERSION@@';
/**
* A list of plugin dependencies to be installed. These are normally set and installed through `Matter.use`.