-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathGruntfile.coffee
119 lines (101 loc) · 3.37 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
###
cssowl
https://github.com/owl-stars/cssowl
Copyright (c) 2013 Owl-Stars
Licensed under the MIT license.
###
"use strict"
librarianowl = require('librarianowl')
module.exports = (grunt) ->
# Project configuration.
grunt.initConfig
pkg: grunt.file.readJSON "package.json"
coffeelint:
files: ["Gruntfile.coffee", "test/**/*.coffee"]
options:
max_line_length:
value: 200
level: "error"
clean:
test:
src: ["test/tmp", "test/examples"]
less:
test:
files:
"test/tmp/examples.less.css": "test/fixtures/less/cssowl.less"
"test/tmp/issues.less.css": "test/issues/less/issues.less"
sass:
test:
options:
trace: true
files:
"test/tmp/examples.sass.css": "test/fixtures/sass/cssowl.sass"
"test/tmp/examples.scss.css": "test/fixtures/scss/cssowl.scss"
"test/tmp/issues.sass.css": "test/issues/sass/issues.sass"
"test/tmp/issues.scss.css": "test/issues/scss/issues.scss"
stylus:
test:
options:
compress: false
files:
"test/tmp/examples.styl.css": "test/fixtures/styl/cssowl.styl"
"test/tmp/issues.styl.css": "test/issues/styl/issues.styl"
csslint:
test:
options:
"text-indent": false
"adjoining-classes": false
"duplicate-background-images": false
src: ['test/tmp/*.css']
# Unit tests.
mochacov:
options:
bail: true
ui: 'exports'
require: 'coffee-script'
compilers: ['coffee:coffee-script/register']
files: 'test/specs/**/*.test.coffee'
all:
options:
reporter: 'spec'
# Deployment
bumper:
options:
push: false
createTag: false
tasks: ["default"]
files: ["package.json", 'bower.json']
updateConfigs: ["pkg"]
# Custom task for fixtures generation
grunt.registerTask "librarianowl-examples", ->
librarianowl.compile "src", "test/examples",
template: "resources/librarianowl/template-examples.hbs"
# Custom task for library generation
grunt.registerTask "librarianowl-lib", ->
librarianowl.compile "src", "lib", {
helpers: "resources/librarianowl/helpers.js"
template: "resources/librarianowl/template-library.hbs"
}
# Custom task for library generation
grunt.registerTask "librarianowl-docs", ->
librarianowl.compile "src", "docs/source/partials", {
filename: (item, syntax) ->
return "_" + item.module + ".haml"
filter: (filename) ->
return (filename != '_imports.yml')
helpers: "resources/librarianowl/helpers.js"
template: "resources/librarianowl/template-docs.hbs"
}
# Load npm tasks
grunt.loadNpmTasks "grunt-mocha-cov"
grunt.loadNpmTasks "grunt-coffeelint"
grunt.loadNpmTasks "grunt-contrib-sass"
grunt.loadNpmTasks "grunt-contrib-less"
grunt.loadNpmTasks "grunt-contrib-stylus"
grunt.loadNpmTasks "grunt-contrib-csslint"
grunt.loadNpmTasks "grunt-contrib-clean"
grunt.loadNpmTasks "grunt-bumper"
# Register tasks
grunt.registerTask 'default', ['coffeelint', 'librarianowl-lib']
grunt.registerTask 'test', ['default', 'clean', 'librarianowl-examples', 'sass', 'less', 'stylus', 'csslint', 'mochacov']
grunt.registerTask 'docs', ['default', 'clean', 'librarianowl-examples', 'librarianowl-docs']