-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathGruntfile.coffee
135 lines (124 loc) · 3.83 KB
/
Gruntfile.coffee
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
module.exports = ->
banner = """/* Lime Player <%= pkg.version %> - Linked Media Player
by Szaby Gruenwald, Cristian Bara and the ConnectMe Project.
Available under the Apache License, Version 2.0
See http://connectme.sti2.org/ for more information.
*/"""
# Project configuration
@initConfig
pkg: @file.readJSON 'package.json'
# Build setup: concatenate source files
coffee:
compile:
files:
'lib/lime-core.js': [
'src/lime.coffee'
'src/annotation.coffee'
'src/plugin.coffee'
'src/widget.coffee'
'src/videojs-adapter.coffee'
'src/cmf.coffee'
'src/annotationoverlays.coffee'
'src/plugins/ldplugin.coffee'
'src/jquery.scrollTo.coffee'
'src/settings/usersettings.coffee'
]
'lib/lime.js': [
'src/lime.coffee'
'src/annotation.coffee'
'src/plugin.coffee'
'src/widget.coffee'
'src/videojs-adapter.coffee'
'src/cmf.coffee'
'src/annotationoverlays.coffee'
'src/jquery.scrollTo.coffee'
'src/plugins/*.coffee'
'src/settings/*.coffee'
]
mult_plugins:
src: ['src/plugins/*.coffee']
dest: 'lib/plugins/'
flatten: true
expand: true
ext: '.js'
mult_settings:
src: ['src/settings/*.coffee']
dest: 'lib/settings/'
flatten: true
expand: true
ext: '.js'
# JavaScript minification
uglify:
options:
banner: banner
report: 'min'
full:
files:
'lib/lime.min.js': ['lib/lime.js']
core:
files:
'lib/lime-core.min.js': ['lib/lime-core.js']
deps:
files:
'lib/lime-deps.min.js': ['lib/lime-deps.js']
concat:
# core is the lime player without extra plugins
core:
src: ['lib/lime-core.js','lib/utils.js']
dest: 'lib/lime-core.js'
# full is the lime player with all plugins
full:
src:['lib/lime.js','lib/utils.js']
dest: 'lib/lime.js'
# deps is the dependencies without the player itself.
deps:
src:['lib/underscoreJS/underscore.min.js', 'lib/backboneJS/backbone.js', 'lib/rdfquery/latest/jquery.rdfquery.debug.js', 'lib/vie/vie.js'],
dest: 'lib/lime-deps.js'
# Add short info in front of the produced file
usebanner:
coffee:
options:
position: 'top' || 'bottom'
banner: banner
files:
src: [ 'lib/lime.js', 'lib/lime-core.js' ]
docco_husky:
project_name: "LIME - Linked Media Player"
# show_timestamp: false
files: [
'src/lime.coffee'
'src/annotation.coffee'
'src/plugin.coffee'
'src/widget.coffee'
'src/videojs-adapter.coffee'
'src/cmf.coffee'
'src/annotationoverlays.coffee'
'src/jquery.scrollTo.coffee'
'src/plugins/*.coffee'
'src/settings/*.coffee'
]
# Automated recompilation and testing when developing
watch:
# Files to watch
files: [
'src/*.coffee'
'src/**/*.coffee'
]
# Tasks to run on change
tasks: ['build']
# Build dependencies
@loadNpmTasks 'grunt-contrib-coffee'
@loadNpmTasks 'grunt-contrib-concat'
@loadNpmTasks 'grunt-contrib-uglify'
@loadNpmTasks 'grunt-banner'
@loadNpmTasks 'grunt-docco-husky'
# Testing dependencies
# @loadNpmTasks 'grunt-contrib-jshint'
# @loadNpmTasks 'grunt-contrib-qunit'
# @loadNpmTasks 'grunt-contrib-nodeunit'
@loadNpmTasks 'grunt-contrib-watch'
# Local tasks
@registerTask 'build', ["coffee", "concat", "usebanner", "uglify"]
@registerTask 'default', 'build'
@registerTask 'doc', =>
@task.run "docco_husky"