File tree Expand file tree Collapse file tree 4 files changed +47
-4
lines changed Expand file tree Collapse file tree 4 files changed +47
-4
lines changed Original file line number Diff line number Diff line change @@ -54,8 +54,7 @@ module.exports = function( grunt ) {
54
54
grunt . initConfig ( gruntConfig ) ;
55
55
56
56
// Load custom tasks
57
- // Disabled, because there are no custom tasks yet. Enable when needed :)
58
- // grunt.loadTasks( 'grunt/tasks/' );
57
+ grunt . loadTasks ( 'grunt/tasks/' ) ;
59
58
60
59
// Register update_translations task
61
60
grunt . registerTask ( 'update_translations' , [
@@ -65,12 +64,22 @@ module.exports = function( grunt ) {
65
64
'potomo'
66
65
] ) ;
67
66
67
+ // Register build task
68
+ grunt . registerTask ( 'build' , [
69
+ 'coffee' ,
70
+ 'uglify' ,
71
+ 'sass' ,
72
+ 'update_translations' ,
73
+ 'clean'
74
+ ] ) ;
75
+
68
76
// Register default task
69
77
grunt . registerTask ( 'default' , [
70
78
'coffee' ,
71
79
'uglify' ,
72
80
'sass' ,
73
81
'makepot' ,
82
+ 'shell:tx_push' ,
74
83
'clean'
75
84
] ) ;
76
85
Original file line number Diff line number Diff line change @@ -12,11 +12,11 @@ module.exports = function( grunt ) {
12
12
cwd : 'woocommerce' ,
13
13
domainPath : 'i18n/languages' ,
14
14
exclude : [ ] ,
15
- potFilename : 'wc-plugin-framework .pot' ,
15
+ potFilename : '<%= pkg.name %> .pot' ,
16
16
mainFile : 'index.php' ,
17
17
potHeaders : {
18
18
'report-msgid-bugs-to' : 'https://support.woothemes.com/hc/' ,
19
- 'project-id-version' : 'WooCommerce Plugin Framework <%= pkg.version %>' ,
19
+ 'project-id-version' : '<%= pkg.title %> <%= pkg.version %>' ,
20
20
} ,
21
21
processPot : function ( pot ) {
22
22
delete pot . headers [ 'x-generator' ] ;
Original file line number Diff line number Diff line change
1
+ /* jshint node:true */
2
+ module . exports = function ( grunt ) {
3
+ 'use strict' ;
4
+
5
+ var fs = require ( 'fs' ) ,
6
+ gp = require ( 'gettext-parser' ) ,
7
+ util = grunt . option ( 'util' ) ;
8
+
9
+ // Parse and adjust PO headers.
10
+ grunt . registerTask ( 'parsepo' , 'Custom parse PO task.' , function ( ) {
11
+
12
+ var files = grunt . file . expand ( grunt . config ( 'dirs.lang' ) + '/*.po' ) ;
13
+
14
+ if ( ! files . length ) {
15
+ return ;
16
+ }
17
+
18
+ files . forEach ( function ( file ) {
19
+
20
+ var input = fs . readFileSync ( file ) ,
21
+ po = gp . po . parse ( input ) ;
22
+
23
+ // Set PO file headers to reflect the current version number.
24
+ po . headers [ 'project-id-version' ] = grunt . config ( 'pkg.title' ) + ' ' + grunt . config ( 'pkg.version' ) ;
25
+
26
+ fs . writeFileSync ( file , gp . po . compile ( po ) ) ;
27
+ } ) ;
28
+
29
+ } ) ;
30
+
31
+ } ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " wc-plugin-framework" ,
3
3
"version" : " 4.0.0" ,
4
+ "title" : " WooCommerce Plugin Framework" ,
4
5
"author" : " SkyVerge Team" ,
5
6
"homepage" : " https://github.com/skyverge/wc-plugin-framework#readme" ,
6
7
"repository" : {
15
16
"node" : " >= 0.10.0"
16
17
},
17
18
"devDependencies" : {
19
+ "gettext-parser" : " ^1.1.1" ,
18
20
"grunt" : " ~0.4.5" ,
19
21
"grunt-contrib-clean" : " ~0.6.0" ,
20
22
"grunt-contrib-coffee" : " ~0.13.0" ,
24
26
"grunt-notify" : " ~0.4.1" ,
25
27
"grunt-potomo" : " ^3.3.3" ,
26
28
"grunt-shell" : " ^1.1.2" ,
29
+ "grunt-text-replace" : " ^0.4.0" ,
27
30
"grunt-wp-i18n" : " ^0.5.2" ,
28
31
"load-grunt-tasks" : " ~3.2.0" ,
29
32
"time-grunt" : " ~1.2.1" ,
You can’t perform that action at this time.
0 commit comments