-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
executable file
·83 lines (70 loc) · 1.88 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/* global require */
'use strict';
var gulp = require('gulp');
var assetManifest = require('gulp-cordova-app-loader-manifest');
var handlebars = require('gulp-compile-handlebars');
var runSequence = require('run-sequence');
var config = require('./config.js');
var packageJson = require('./package.json');
config.version = packageJson.version;
gulp.task('default',function(){
gulp.start(['mobile']);
});
////////////////////////////////////////////////
///// Mobile
////////////////////////////////////////////////
gulp.task('mobile', function(){
runSequence(
'copyMobileAppFilesToMobileRemoteFolder',
'bumpTimestampFile',
'mobileMarkup',
'generateManifest',
'copyRemoteMobileFolderToMobileFolder',
'bumpTimestampFile',
'generateManifest'
);
});
gulp.task('generateManifest', function(){
return gulp.src([
'remote-files/**/autoupdate.js',
'remote-files/**/app.js',
'remote-files/**',
'!' + 'remote-files/manifest.json',
'!' + 'remote-files/index.html',
'!' + 'remote-files/img/**',
'!' + 'remote-files/**/bootstrap.js',
'!' + 'remote-files/**/cordova-app-loader-complete.js'
])
.pipe(assetManifest({
load: [
'js/autoupdate.js',
'js/app.js',
'js/timestamp.js'
]
}))
.pipe(gulp.dest('remote-files/'));
});
gulp.task('mobileMarkup',function(){
return gulp.src(['remote-files/index.html'])
.pipe(handlebars(config))
.pipe(gulp.dest('remote-files/'));
});
gulp.task('bumpTimestampFile',function(){
gulp.src(['mobileApp/src/js/timestamp.js'])
.pipe(handlebars({
timestamp: Date.now()
}))
.pipe(gulp.dest('remote-files/js/'));
});
gulp.task('copyRemoteMobileFolderToMobileFolder', function(){
return gulp.src([
'remote-files/**/'
])
.pipe(gulp.dest('mobileApp/www/'));
});
gulp.task('copyMobileAppFilesToMobileRemoteFolder', function(){
return gulp.src([
'mobileApp/src/**'
])
.pipe(gulp.dest('remote-files/'));
});