forked from cypress-io/cypress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.coffee
81 lines (70 loc) · 1.9 KB
/
gulpfile.coffee
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
fs = require("fs-extra")
pkg = require("./package.json")
gulp = require("gulp")
clean = require("gulp-clean")
rename = require("gulp-rename")
runSeq = require("run-sequence")
source = require("vinyl-source-stream")
Promise = require("bluebird")
coffeeify = require("coffeeify")
browserify = require("browserify")
icons = require("@cypress/icons")
ext = require("./")
gulp.task "copy:socket:client", ->
gulp.src(require("../socket").getPathToClientSource())
.pipe(gulp.dest("dist"))
gulp.task "clean", ->
gulp.src("dist")
.pipe(clean())
gulp.task "manifest", (done) ->
gulp.src("app/manifest.json")
.pipe(gulp.dest("dist"))
.on "end", ->
fs.readJson "dist/manifest.json", (err, json) ->
json.version = pkg.version
fs.writeJson "dist/manifest.json", json, {spaces: 2}, done
null
gulp.task "backup", ->
gulp.src("dist/background.js")
.pipe(rename("background_src.js"))
.pipe(gulp.dest("dist"))
gulp.task "background", ->
browserify({
entries: "app/background.coffee"
transform: coffeeify
})
.bundle()
.pipe(source("background.js"))
.pipe(gulp.dest("dist"))
gulp.task "html", ->
gulp.src("app/**/*.html")
.pipe(gulp.dest("dist"))
gulp.task "css", ->
gulp.src("app/**/*.css")
.pipe(gulp.dest("dist"))
gulp.task "icons", ->
gulp.src([
icons.getPathToIcon("icon_16x16.png")
icons.getPathToIcon("icon_19x19.png")
icons.getPathToIcon("icon_38x38.png")
icons.getPathToIcon("icon_48x48.png")
icons.getPathToIcon("icon_128x128.png")
])
.pipe(gulp.dest("dist/icons"))
gulp.task "logos", ->
gulp.src([
icons.getPathToLogo("cypress-bw.png")
])
.pipe(gulp.dest("dist/logos"))
gulp.task "watch", ["build"], ->
gulp.watch("app/**/*", ["build"])
gulp.task "build", ->
runSeq "clean", [
"copy:socket:client"
"icons"
"logos"
"manifest"
"background"
"html"
"css"
]