Skip to content

Commit dbe4c41

Browse files
committed
Add tgut build to grunt
1 parent c4b1230 commit dbe4c41

File tree

2 files changed

+50
-6
lines changed

2 files changed

+50
-6
lines changed

Gruntfile.js

+46-5
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,64 @@ module.exports = function(grunt) {
55
grunt.initConfig({
66
pkg: grunt.file.readJSON('package.json'),
77
manifest: grunt.file.readJSON('src/manifest.json'),
8+
copy: {
9+
main: {
10+
expand: true,
11+
src: 'src/**',
12+
dest: 'build/tgut-temp/',
13+
},
14+
},
15+
'string-replace': {
16+
dist: {
17+
files: {
18+
'build/tgut-temp/src/': 'build/tgut-temp/src/*',
19+
'build/tgut-temp/src/js/': 'build/tgut-temp/src/js/*',
20+
},
21+
options: {
22+
replacements: [{
23+
pattern: /The Great Suspender/ig,
24+
replacement: 'The Great Update Tester'
25+
}]
26+
}
27+
}
28+
},
829
crx: {
9-
dev: {
30+
public: {
31+
src: [
32+
"src/**/*",
33+
"!**/html2canvas.js",
34+
"!**/Thumbs.db"
35+
],
36+
dest: "build/<%= pkg.name %>-<%= manifest.version %>-dev.zip",
37+
},
38+
private: {
1039
src: [
1140
"src/**/*",
1241
"!**/html2canvas.js",
1342
"!**/Thumbs.db"
1443
],
15-
dest: "build/crx/<%= pkg.name %>-<%= manifest.version %>-dev.crx",
16-
zipDest: "build/zip/<%= pkg.name %>-<%= manifest.version %>-dev.zip",
44+
dest: "build/<%= pkg.name %>-<%= manifest.version %>-dev.crx",
1745
options: {
1846
"privateKey": "key.pem"
1947
}
48+
},
49+
tgut: {
50+
src: [
51+
"build/tgut-temp/src/**/*",
52+
"!**/html2canvas.js",
53+
"!**/Thumbs.db"
54+
],
55+
dest: "build/tgut-<%= manifest.version %>-dev.zip"
2056
}
21-
}
57+
},
58+
clean: ['build/tgut-temp/']
2259
});
2360

61+
grunt.loadNpmTasks('grunt-contrib-copy');
62+
grunt.loadNpmTasks('grunt-string-replace');
2463
grunt.loadNpmTasks('grunt-crx');
25-
grunt.registerTask('default', ['crx']);
64+
grunt.loadNpmTasks('grunt-contrib-clean');
65+
grunt.registerTask('default', ['crx:public', 'crx:private']);
66+
grunt.registerTask('tgut', ['copy', 'string-replace', 'crx:tgut', 'clean']);
2667
};
2768

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@
3434
"eslint-plugin-standard": "^3.0.1",
3535
"grunt": "~0.4.5",
3636
"grunt-cli": "^1.2.0",
37-
"grunt-crx": "~1.0.3",
37+
"grunt-contrib-clean": "^1.1.0",
38+
"grunt-contrib-copy": "^1.0.0",
39+
"grunt-crx": "~1.0.5",
40+
"grunt-string-replace": "^1.3.1",
3841
"time-grunt": "~1.2.1"
3942
}
4043
}

0 commit comments

Comments
 (0)