This repository has been archived by the owner on Apr 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 66
/
Gruntfile.js
88 lines (79 loc) · 2.61 KB
/
Gruntfile.js
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
'use strict';
module.exports = function(grunt) {
require('time-grunt')(grunt);
require('load-grunt-tasks')(grunt);
var _ = require('underscore');
var underscoreDeepExtend = require('underscore-deep-extend');
_.mixin({deepExtend: underscoreDeepExtend(_)});
// Project Configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
_test_runner: './node_modules/.bin/turbo',
_unit_args: '--setUp ./test/setupTeardown.js --tearDown ./test/setupTeardown.js test/unit/**',
_accept_args: 'test/accept/*',
unit: ['env NODE_PATH=.:./lib <%= _test_runner %> <%= _unit_args %>',
'env NODE_PATH=.:./lib <%= _test_runner %> <%= _unit_args %>/**',
'env NODE_PATH=.:./lib <%= _test_runner %> <%= _unit_args %>/**/**',
'env NODE_PATH=.:./lib <%= _test_runner %> <%= _unit_args %>/**/**/**',
'env NODE_PATH=.:./lib <%= _test_runner %> <%= _unit_args %>/**/**/**/**'],
accept: 'env NODE_PATH=.:./lib <%= _test_runner %> <%= _accept_args %>',
unit_cover: 'istanbul cover --dir cov-unit <%= _test_runner %> -- <%= _unit_args %>',
accept_cover: 'istanbul cover --dir cov-unit <%= _test_runner %> -- <%= _accept_args %>',
eslint: {
options: {
configFile: '.eslintrc.json'
},
target: ['lib/**/*.js']
},
jsxgettext: {
pot: {
files: [
{
src: ['lib/**/*.js'],
dest: 'po/fh-fhc.pot'
}
],
options: {
keyword: [
'_', 'N_'
]
}
}
},
zanata: {
push: {
options: {
url: 'https://translate.zanata.org',
project: 'fh-fhc',
'project-version': 'master',
'project-type': 'gettext'
},
files: [
{src: 'po', type: 'source'}
]
},
pull: {
options: {
url: 'https://translate.zanata.org',
project: 'fh-fhc',
'project-version': 'master',
'project-type': 'gettext'
},
files: [
{src: 'po', type: 'trans'}
]
}
}
});
grunt.loadNpmTasks('grunt-fh-build');
grunt.loadNpmTasks('grunt-jsxgettext');
grunt.loadNpmTasks('grunt-zanata-js');
grunt.registerTask('test', ['eslint','fh:test']);
grunt.registerTask('unit', ['eslint', 'fh:unit']);
grunt.registerTask('accept', ['fh:accept']);
grunt.registerTask('coverage', ['fh:coverage']);
grunt.registerTask('analysis', ['fh:analysis']);
grunt.registerTask('potupload', ['jsxgettext:pot', 'zanata:push']);
grunt.registerTask('dist', ['zanata:pull', 'fh:dist']);
grunt.registerTask('default', ['fh:default']);
};