2016-06-01 15:49:24 +00:00
|
|
|
var gulp = require('gulp');
|
|
|
|
var autoprefixer = require('gulp-autoprefixer');
|
|
|
|
var cssnano = require('gulp-cssnano');
|
|
|
|
var jshint = require('gulp-jshint');
|
|
|
|
var uglify = require('gulp-uglify');
|
|
|
|
var rename = require('gulp-rename');
|
|
|
|
var concat = require('gulp-concat');
|
|
|
|
var notify = require('gulp-notify');
|
|
|
|
var cache = require('gulp-cache');
|
|
|
|
var livereload = require('gulp-livereload');
|
|
|
|
var htmlmin = require('gulp-htmlmin');
|
|
|
|
var inject = require('gulp-inject');
|
|
|
|
var del = require('del');
|
|
|
|
var htmlreplace = require('gulp-html-replace');
|
|
|
|
var stripDebug = require('gulp-strip-debug');
|
|
|
|
|
|
|
|
|
|
|
|
var filePath = {
|
|
|
|
build_dir: './dist'
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
gulp.task('appJS', function() {
|
|
|
|
return gulp.src(['app/js/mandecoder.js','app/js/index.js'])
|
|
|
|
.pipe(stripDebug())
|
|
|
|
.pipe(jshint('.jshintrc'))
|
|
|
|
.pipe(jshint.reporter('default'))
|
|
|
|
.pipe(concat('index.js'))
|
|
|
|
/*.pipe(gulp.dest('dist/js'))*/
|
|
|
|
/*.pipe(rename({suffix: '.min'}))*/
|
|
|
|
/* .pipe(uglify({mangle: false}))*/
|
|
|
|
/*.pipe(concat('app.js'))*/
|
|
|
|
.pipe(gulp.dest('www/js'));
|
|
|
|
});
|
|
|
|
|
|
|
|
gulp.task('cc2650', function() {
|
|
|
|
return gulp.src(['app/js/device/CC2650/**/*'])
|
|
|
|
.pipe(stripDebug())
|
|
|
|
.pipe(jshint('.jshintrc'))
|
|
|
|
.pipe(jshint.reporter('default'))
|
|
|
|
.pipe(concat('cc2650.js'))
|
|
|
|
/*.pipe(gulp.dest('dist/js'))*/
|
|
|
|
/*.pipe(rename({suffix: '.min'}))*/
|
|
|
|
/* .pipe(uglify({mangle: false}))*/
|
|
|
|
/*.pipe(concat('app.js'))*/
|
|
|
|
.pipe(gulp.dest('www/js/device'));
|
|
|
|
});
|
|
|
|
|
|
|
|
gulp.task('devices', function() {
|
|
|
|
return gulp.src(['app/js/standards/bluetooth_company_identifiers.js','app/js/standards/capability.js','app/js/standards/battery.js','app/js/standards/button.js'])
|
|
|
|
.pipe(stripDebug())
|
|
|
|
.pipe(jshint('.jshintrc'))
|
|
|
|
.pipe(jshint.reporter('default'))
|
|
|
|
.pipe(concat('devices.js'))
|
|
|
|
/*.pipe(gulp.dest('dist/js'))*/
|
|
|
|
/*.pipe(rename({suffix: '.min'}))*/
|
|
|
|
/* .pipe(uglify({mangle: false}))*/
|
|
|
|
/*.pipe(concat('app.js'))*/
|
|
|
|
.pipe(gulp.dest('www/js/standards'));
|
|
|
|
});
|
|
|
|
|
|
|
|
gulp.task('buildJS', function() {
|
|
|
|
gulp.start('appJS','cc2650','devices');
|
|
|
|
});
|
|
|
|
|
|
|
|
gulp.task('clean', function() {
|
|
|
|
return del(['www']);
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gulp.task('default', ['clean'], function() {
|
|
|
|
gulp.start('buildJS');
|
|
|
|
});
|