Skip to content

Commit

Permalink
Merge branch 'plugins'
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Sep 19, 2016
2 parents c4cce9e + 6f8b705 commit 60d0839
Show file tree
Hide file tree
Showing 16 changed files with 1,257 additions and 456 deletions.
17 changes: 12 additions & 5 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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);
Expand Down Expand Up @@ -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){
Expand All @@ -252,7 +259,7 @@ var build = function(options) {
});
}));

if (options.version !== 'dev') {
if (!options.version.includes('-')) {
compiled.pipe(preprocess({ context: { DEBUG: false } }));
}

Expand Down
1 change: 1 addition & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ <h1>Matter.js Demo</h1>
<option value="avalanche">Avalanche</option>
<option value="softBody">Basic Soft Bodies</option>
<option value="cloth">Cloth</option>
<option value="attractors">Attractors (Plugin)</option>
<option value="events">Events</option>
<option value="collisionFiltering">Collision Filtering</option>
<option value="sensors">Sensors</option>
Expand Down
Loading

0 comments on commit 60d0839

Please sign in to comment.