|
1 |
| -module.exports = function( grunt ) { |
2 |
| - |
3 |
| - 'use strict'; |
4 |
| - |
5 |
| - // Project configuration |
6 |
| - grunt.initConfig( { |
7 |
| - |
8 |
| - pkg: grunt.file.readJSON( 'package.json' ), |
9 |
| - |
10 |
| - addtextdomain: { |
11 |
| - options: { |
12 |
| - textdomain: 'all-in-one-schemaorg-rich-snippets', |
13 |
| - }, |
14 |
| - update_all_domains: { |
15 |
| - options: { |
16 |
| - updateDomains: true |
17 |
| - }, |
18 |
| - src: [ '*.php', '**/*.php', '!\.git/**/*', '!bin/**/*', '!node_modules/**/*', '!tests/**/*' ] |
19 |
| - } |
20 |
| - }, |
21 |
| - |
22 |
| - wp_readme_to_markdown: { |
23 |
| - your_target: { |
24 |
| - files: { |
25 |
| - 'README.md': 'readme.txt' |
26 |
| - } |
27 |
| - }, |
28 |
| - }, |
29 |
| - |
30 |
| - makepot: { |
31 |
| - target: { |
32 |
| - options: { |
33 |
| - domainPath: '/languages', |
34 |
| - exclude: [ '\.git/*', 'bin/*', 'node_modules/*', 'tests/*' ], |
35 |
| - mainFile: 'index.php', |
36 |
| - potFilename: 'all-in-one-schemaorg-rich-snippets.pot', |
37 |
| - potHeaders: { |
38 |
| - poedit: true, |
39 |
| - 'x-poedit-keywordslist': true |
40 |
| - }, |
41 |
| - type: 'wp-plugin', |
42 |
| - updateTimestamp: true |
43 |
| - } |
44 |
| - } |
45 |
| - }, |
46 |
| - } ); |
47 |
| - |
48 |
| - grunt.loadNpmTasks( 'grunt-wp-i18n' ); |
49 |
| - grunt.loadNpmTasks( 'grunt-wp-readme-to-markdown' ); |
50 |
| - grunt.registerTask( 'i18n', ['addtextdomain', 'makepot'] ); |
51 |
| - grunt.registerTask( 'readme', ['wp_readme_to_markdown'] ); |
52 |
| - |
53 |
| - grunt.util.linefeed = '\n'; |
| 1 | +module.exports = function(grunt) { |
54 | 2 |
|
| 3 | + 'use strict'; |
| 4 | + |
| 5 | + // Project configuration |
| 6 | + grunt.initConfig({ |
| 7 | + |
| 8 | + pkg: grunt.file.readJSON('package.json'), |
| 9 | + |
| 10 | + addtextdomain: { |
| 11 | + options: { |
| 12 | + textdomain: 'all-in-one-schemaorg-rich-snippets', |
| 13 | + }, |
| 14 | + update_all_domains: { |
| 15 | + options: { |
| 16 | + updateDomains: true |
| 17 | + }, |
| 18 | + src: ['*.php', '**/*.php', '!\.git/**/*', '!bin/**/*', '!node_modules/**/*', '!tests/**/*'] |
| 19 | + } |
| 20 | + }, |
| 21 | + |
| 22 | + wp_readme_to_markdown: { |
| 23 | + your_target: { |
| 24 | + files: { |
| 25 | + 'README.md': 'readme.txt' |
| 26 | + } |
| 27 | + }, |
| 28 | + }, |
| 29 | + |
| 30 | + makepot: { |
| 31 | + target: { |
| 32 | + options: { |
| 33 | + domainPath: '/languages', |
| 34 | + exclude: ['\.git/*', 'bin/*', 'node_modules/*', 'tests/*'], |
| 35 | + mainFile: 'index.php', |
| 36 | + potFilename: 'all-in-one-schemaorg-rich-snippets.pot', |
| 37 | + potHeaders: { |
| 38 | + poedit: true, |
| 39 | + 'x-poedit-keywordslist': true |
| 40 | + }, |
| 41 | + type: 'wp-plugin', |
| 42 | + updateTimestamp: true |
| 43 | + } |
| 44 | + } |
| 45 | + }, |
| 46 | + |
| 47 | + zip: { |
| 48 | + 'release': { |
| 49 | + src: ['**/*', '!node_modules/**', '!tests/**', '!bin/**', '!**/*.zip'], // Exclude certain folders and existing zip files |
| 50 | + dest: 'all-in-one-schemaorg-rich-snippets.zip' |
| 51 | + } |
| 52 | + }, |
| 53 | + }); |
| 54 | + |
| 55 | + grunt.loadNpmTasks('grunt-wp-i18n'); |
| 56 | + grunt.loadNpmTasks('grunt-wp-readme-to-markdown'); |
| 57 | + grunt.loadNpmTasks('grunt-zip'); // Use grunt-zip instead |
| 58 | + |
| 59 | + grunt.registerTask('i18n', ['addtextdomain', 'makepot']); |
| 60 | + grunt.registerTask('readme', ['wp_readme_to_markdown']); |
| 61 | + grunt.registerTask('release', ['zip:release']); // Add release command |
| 62 | + |
| 63 | + grunt.util.linefeed = '\n'; |
55 | 64 | };
|
0 commit comments