Skip to content

Commit 3717fa4

Browse files
committed
Replace Makefile with Gruntfile
1 parent b4dbff0 commit 3717fa4

4 files changed

Lines changed: 92 additions & 60 deletions

File tree

Gruntfile.coffee

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
module.exports = (grunt) ->
2+
require('load-grunt-tasks') grunt
3+
grunt.file.readJSON('package.json')
4+
5+
License = '/*!Copyright(c) CommentCoreLibrary (//github.com/jabbany/CommentCoreLibrary) - Licensed under the MIT License */'
6+
7+
SRC_CORE = [
8+
'src/CommentFilter.js'
9+
'src/CommentSpaceAllocator.js'
10+
'src/CommentCoreLibrary.js'
11+
]
12+
13+
SRC_TRANSITION = [
14+
'src/CCLComment.js'
15+
'src/CommentFilter.js'
16+
'src/CommentTransitionSpaceAllocator.js'
17+
'src/CommentTransitionLibrary.js'
18+
]
19+
20+
SRC_PARSER = [
21+
'src/parsers/AcfunFormat.js'
22+
'src/parsers/BilibiliFormat.js'
23+
]
24+
25+
SRC_CORELIB = SRC_PARSER.concat(SRC_CORE)
26+
27+
grunt.initConfig(
28+
# Concat CSS and JS files
29+
concat:
30+
basic_and_extras:
31+
files:
32+
'build/style.css': ['src/base.css', 'src/fontalias.css']
33+
'build/CommentCore.js': SRC_CORE
34+
'build/CommentCoreLibrary.js': SRC_CORELIB
35+
36+
# Auto-prefix CSS properties using Can I Use?
37+
autoprefixer:
38+
options:
39+
browsers: ['last 3 versions', 'bb 10', 'android 3']
40+
41+
no_dest:
42+
# File to output
43+
src: 'build/style.css'
44+
45+
# Minify CSS
46+
cssmin:
47+
minify:
48+
src: ['build/style.css']
49+
dest: 'build/style.min.css'
50+
51+
uglify:
52+
options: banner: License
53+
comment_core:
54+
files:
55+
'build/CommentCore.min.js': SRC_CORE
56+
comment_core_lib:
57+
files:
58+
'build/CommentCoreLibrary.min.js': SRC_CORELIB
59+
60+
# Watch files for changes
61+
watch:
62+
css:
63+
files: ['src/**/*', '!node_modules']
64+
65+
# Run concat, autoprefixer, cssmin and uglify
66+
tasks: ['build']
67+
)
68+
69+
# Register our tasks
70+
grunt.registerTask 'build', ['concat', 'autoprefixer', 'cssmin', 'uglify']
71+
grunt.registerTask 'default', ['build', 'watch']
72+

Makefile

Lines changed: 0 additions & 60 deletions
This file was deleted.

bower.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "CommentCoreLibrary",
3+
"version": "0.9.0",
4+
"dependencies": {
5+
}
6+
}

package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "CommentCoreLibrary",
3+
"version": "0.9.0",
4+
"devDependencies": {
5+
"grunt": "~0.4.1",
6+
"grunt-autoprefixer": "~0.8.0",
7+
"grunt-contrib-watch": "~0.6.0",
8+
"grunt-contrib-concat": "~0.4.0",
9+
"grunt-contrib-cssmin": "~0.10.0",
10+
"grunt-contrib-uglify": "~0.5.0",
11+
"load-grunt-tasks": "~0.6.0"
12+
}
13+
}
14+

0 commit comments

Comments
 (0)