forked from btcpayserver/woocommerce-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
112 lines (105 loc) · 2.75 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/**
* @license Copyright 2011-2014 BitPay Inc., MIT License
* see https://github.com/bitpay/woocommerce-plugin/blob/master/LICENSE
*/
'use strict';
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: {
build: ['dist'],
dev: {
src: ['/var/www/html/woocommerce/wp-content/plugins/btcpay-for-woocommerce/'],
options: {
force: true
}
}
},
compress: {
build: {
options: {
archive: 'dist/btcpay-for-woocommerce.zip'
},
files: [{
expand: true,
cwd: 'dist',
src: ['**']
}]
}
},
copy: {
build: {
files: [
{
expand: true,
cwd: 'src/',
src: ['**/**'],
dest: 'dist/btcpay-for-woocommerce'
},
{
expand: true,
cwd: 'vendor/bitpay/php-client/src/',
src: ['**/**.*'],
dest: 'dist/btcpay-for-woocommerce/lib'
},
{
src: 'LICENSE',
dest: 'dist/btcpay-for-woocommerce/license.txt'
}
]
},
dev: {
files: [{
expand: true,
cwd: 'dist/btcpay-for-woocommerce',
src: ['**/**'],
dest: '/var/www/html/woocommerce/wp-content/plugins/btcpay-for-woocommerce/'
}]
}
},
cssmin: {
build: {
options: {
banner: '/**\n * @license Copyright 2011-2018 BitPay Inc. & BtcPay Inc., MIT License\n * see https://github.com/btcpayserver/woocommerce-plugin/blob/master/LICENSE\n */'
},
files: {
'dist/btcpay-for-woocommerce/assets/css/style.css': ['src/assets/css/**.css']
}
}
},
phpcsfixer: {
build: {
dir: 'src/'
},
options: {
bin: 'vendor/bin/php-cs-fixer',
diff: true,
ignoreExitCode: true,
level: 'all',
quiet: true
}
},
watch: {
scripts: {
files: ['src/**/**.*'],
tasks: ['dev'],
options: {
spawn: false,
atBegin: true
},
},
},
});
// Load the plugins
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-php-cs-fixer');
// Default task(s).
grunt.registerTask('build', ['phpcsfixer', 'clean:build', 'cssmin:build', 'copy:build', 'compress:build']);
grunt.registerTask('dev', ['build', 'clean:dev', 'copy:dev']);
grunt.registerTask('default', 'build');
};