forked from CurtisHumphrey/knockout-firebase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.coffee
109 lines (95 loc) · 3.04 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
module.exports = (grunt) ->
# Livereload and connect variables
LIVERELOAD_PORT = 1337
lrSnippet = require("connect-livereload")(port: LIVERELOAD_PORT)
mountFolder = (connect, dir) ->
connect.static require("path").resolve(dir)
grunt.initConfig
connect:
dev:
options:
port: 9001
hostname: 'localhost',
middleware: ( connect ) ->
[lrSnippet, mountFolder(connect, '.')]
open:
test:
path: 'http://localhost:<%= connect.dev.options.port %>/_SpecRunner.html'
jasmine:
dev:
options:
specs: "test/specs/**/*.js"
helpers: ["test/helpers/**/*.js"]
keepRunner: true
template: require "grunt-template-jasmine-requirejs"
templateOptions:
requireConfigFile: "dev/require_config.js"
requireConfig:
baseUrl: 'dev'
requirejs:
compile:
options:
baseUrl: 'dev'
mainConfigFile: "dev/require_config.js"
out: "dist/knockout_firebase.js"
name: "knockout_firebase"
optimize: 'none'
paths:
knockout: 'empty:'
lodash: 'empty:'
mockfirebase: 'empty:'
exec:
git:
cmd: 'START "" "C:\\Program Files\\TortoiseGit\\bin\\TortoiseGitProc.exe" /command:log /path:..'
coffee:
compile_tests:
expand : true
cwd : 'test/specs'
src : ['**/*.coffee']
dest : 'test/specs'
ext : '.spec.js'
compile_lib:
expand : true
cwd : 'dev'
src : ['**/*.coffee']
dest : 'dev'
ext : '.js'
copy:
dist:
expand: true
flatten: true
src : ['dev/fire_*.js']
dest : 'dist/'
watch:
configFiles:
files: ['Gruntfile.coffee']
options:
reload: true
reload_jasmine:
files: ['test/specs/**/*.js','dev/**/*.js']
tasks: ['jasmine:dev', 'requirejs', 'copy']
options:
livereload: 1337
coffee_spec:
files: ['test/specs/**/*.coffee']
tasks: ['newer:coffee:compile_tests']
coffee_lib:
files: ['dev/**/*.coffee']
tasks: ['newer:coffee:compile_lib']
options:
livereload: 35729
bump:
options:
files: ['bower.json', 'package.json']
commitFiles: ['bower.json', 'package.json']
push: false
commit: true
require('time-grunt')(grunt)
require('load-grunt-tasks')(grunt)
grunt.registerTask 'git', ['exec:git']
grunt.registerTask 'next_version', ['build','bump:patch']
grunt.registerTask 'rerun', ['coffee', 'connect:dev:livereload', 'watch']
grunt.registerTask 'dev', ['coffee', 'connect:dev:livereload', 'open', 'watch']
grunt.registerTask 'build', ['coffee','jasmine','requirejs','copy']
grunt.registerTask 'default', ['git', 'dev']
grunt.registerTask 'test', ['coffee', 'jasmine']