-
Notifications
You must be signed in to change notification settings - Fork 138
/
Copy pathGruntfile.coffee
76 lines (64 loc) · 1.77 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
"use strict"
module.exports = (grunt) ->
# Project configuration.
grunt.initConfig
# Metadata.
pkg: grunt.file.readJSON("localize.jquery.json")
banner: """
/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today(\"yyyy-mm-dd\") %>
<%= pkg.homepage ? "* " + pkg.homepage : "" %>
* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>; Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */
"""
# Task configuration.
clean:
files: ["dist"]
coffee:
options:
bare: true
compile:
files:
"dist/<%= pkg.name %>.js": "src/*.coffee"
"test/localize_test.js": "test/localize_test.coffee"
uglify:
options:
banner: "<%= banner %>"
dist:
src: "dist/<%= pkg.name %>.js"
dest: "dist/<%= pkg.name %>.min.js"
qunit:
all:
options:
urls: [
"1.7.2"
"1.8.3"
"1.9.1"
"1.10.2"
"1.11.3"
"2.0.3"
"2.1.4"
].map((version) ->
"http://localhost:<%= connect.server.options.port %>/test/localize.html?jquery=" + version
)
connect:
server:
options:
port: 8085 # This is a random port, feel free to change it.
# These plugins provide necessary tasks.
grunt.loadNpmTasks "grunt-contrib-clean"
grunt.loadNpmTasks "grunt-contrib-uglify"
grunt.loadNpmTasks "grunt-contrib-qunit"
grunt.loadNpmTasks "grunt-contrib-coffee"
grunt.loadNpmTasks "grunt-contrib-connect"
# Default task.
grunt.registerTask "default", [
"connect"
"clean"
"coffee"
"uglify"
"qunit"
]
grunt.registerTask "test", [
"connect"
"qunit"
]
return