forked from gpac/mp4box.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
119 lines (112 loc) · 4.02 KB
/
Gruntfile.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: ';'
},
all: {
src: ['src/log.js', // logging system
'src/DataStream.js', // bit/byte/string read operations
'src/DataStream-write.js', // bit/byte/string write operations
'src/DataStream-map.js', // bit/byte/string other operations
'src/descriptor.js', // MPEG-4 descriptor parsing
'src/box.js', // base code for box parsing/writing
'src/box-parse.js', // box parsing code
'src/box-write.js', // box writing code
'src/box-unpack.js', // box code for sample manipulation
'src/meta.js', // box code for meta-related box parsing
'src/text-mp4.js', // text-based track manipulations
'src/isofile.js', // file level operations (read, write)
'src/mp4box.js' // application level operations (data append, sample extraction, segmentation, ...)
],
dest: 'dist/<%= pkg.name %>.all.js'
},
simple: {
src: ['src/log.js', // logging system
'src/DataStream.js', // bit/byte/string read-write operations
'src/box.js', // base code for box parsing/writing
'src/box-parse.js', // box parsing code
'src/meta.js', // box code for meta-related box parsing
'src/isofile.js', // file level operations (read, write)
'src/mp4box.js' // application level operations (data append, sample extraction, segmentation, ...)
],
dest: 'dist/<%= pkg.name %>.simple.js'
},
boxparser: {
src: ['src/log.js', // logging system
'src/DataStream.js', // bit/byte/string read-write operations
'src/box.js', // base code for box parsing/writing
'src/box-parse.js', // box parsing code
'src/isofile.js', // file level operations (read, write)
'src/mp4box.js' // application level operations (data append, sample extraction, segmentation, ...)
],
dest: 'dist/boxparser.js'
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
all: {
files: {
'dist/<%= pkg.name %>.all.min.js': ['<%= concat.all.dest %>']
}
},
simple: {
files: {
'dist/<%= pkg.name %>.simple.min.js': ['<%= concat.simple.dest %>']
}
},
boxparser: {
files: {
'dist/boxparser.min.js': ['<%= concat.boxparser.dest %>']
}
}
},
qunit: {
all: {
options: {
urls: [
'http://localhost:9000/test/qunit.html'
]
}
}
},
connect: {
server: {
options: {
port: 9000,
base: '.'
}
}
},
jshint: {
files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js', '!test/lib/**/*.js' , '!test/mp4/**/*.js'],
options: {
// options here to override JSHint defaults
eqeqeq: false,
asi: true,
loopfunc: true,
eqnull: true,
globals: {
}
}
},
watch: {
files: ['<%= jshint.files %>'],
tasks: ['jshint', 'connect', 'qunit']
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.registerTask('test', ['jshint', 'connect', 'qunit']);
grunt.registerTask('all', [ 'concat:all', 'uglify:all']);
grunt.registerTask('simple', [ 'concat:simple', 'uglify:simple']);
grunt.registerTask('boxparser', [ 'concat:boxparser', 'uglify:boxparser']);
grunt.registerTask('default', [ 'jshint', 'all', 'simple', 'boxparser']);
};