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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
|
From ece2d15b4c492aed991735a72e99cf1e2fcaa47d Mon Sep 17 00:00:00 2001
From: vantu5z <vantu5z@mail.ru>
Date: Tue, 20 Jul 2021 16:23:15 +0300
Subject: [PATCH] fix build files (for gulp 4)
---
gulpfile.js | 108 ++++++++++++++++-----------------------------------
package.json | 4 +-
2 files changed, 36 insertions(+), 76 deletions(-)
diff --git a/gulpfile.js b/gulpfile.js
index d92108e..82356d5 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -64,7 +64,7 @@ function timeLog(m) {
/**
* GTK Auto reload
*/
-function autoreload() {
+gulp.task('autoreload', async function () {
var theme = dirLight;
@@ -91,7 +91,7 @@ function autoreload() {
})
}
-}
+});
/**
@@ -101,7 +101,7 @@ function autoreload() {
*/
gulp.task('copy-user-theme-folder', function () {
- return gulp.src('./build/**/*')
+ return gulp.src(`./build/+(${dirLight}|${dirDark})/**/*`)
.pipe(gulp.dest(os.homedir() + '/.local/share/themes/'))
})
@@ -196,7 +196,6 @@ gulp.task('gtk3-assets', function () {
/*---------- gtk-2.0 ----------*/
// Light
-gulp.task('gtk2-light', ['gtk2-light-assets', 'gtk2-light-menubar', 'gtk2-light-files']);
gulp.task('gtk2-light-assets', function (cb) {
return gulp.src('./src/gtk-2.0/assets/*')
@@ -221,8 +220,9 @@ gulp.task('gtk2-light-files', function () {
.pipe(gulp.dest(`./build/${dirLight}/gtk-2.0`));
})
+gulp.task('gtk2-light', gulp.series(['gtk2-light-assets', 'gtk2-light-menubar', 'gtk2-light-files']));
+
// Dark
-gulp.task('gtk2-dark', ['gtk2-dark-assets', 'gtk2-dark-menubar', 'gtk2-dark-files', 'gtk2-gtkrc-dark']);
gulp.task('gtk2-dark-assets', function (cb) {
return gulp.src('./src/gtk-2.0/assets-dark/*')
@@ -252,6 +252,8 @@ gulp.task('gtk2-gtkrc-dark', function (cb) {
.pipe(gulp.dest(`./build/${dirDark}/gtk-2.0`))
});
+gulp.task('gtk2-dark', gulp.series(['gtk2-dark-assets','gtk2-dark-menubar','gtk2-dark-files','gtk2-gtkrc-dark']));
+
// gulp.task('gtk2-light', function(){
// return gulp.src([
// "./src/gtk-2.0/*",
@@ -307,8 +309,6 @@ gulp.task('xfwm4-light', function (cb) {
});
-gulp.task('xfwm4-dark', ['xfwm4-dark-assets', 'xfwm4-dark-themerc']);
-
gulp.task('xfwm4-dark-assets', function (cb) {
return gulp.src('./src/xfwm4/assets-dark/*.png')
.pipe(gulp.dest(`./build/${dirDark}/xfwm4`))
@@ -320,6 +320,7 @@ gulp.task('xfwm4-dark-themerc', function (cb) {
.pipe(gulp.dest(`./build/${dirDark}/xfwm4`))
});
+gulp.task('xfwm4-dark', gulp.series(['xfwm4-dark-assets','xfwm4-dark-themerc']));
/*===== End of Common tasks ======*/
@@ -334,74 +335,36 @@ gulp.task('xfwm4-dark-themerc', function (cb) {
gulp.task('watch', function () {
// Gtk4
- gulp.watch('./src/gtk-4.0/**/*.scss', function (cb) {
-
- gulp.start(['gtk4-light', 'gtk4-dark'], function () {
-
- gulp.start('copy-user-theme-folder', function () {
- autoreload();
- })
- })
-
- });
-
- gulp.watch('./src/gtk-4.0/assets/*', function (file) {
-
- gulp.src(file.path)
- .pipe(gulp.dest(`./build/${dirLight}/gtk-4.0/assets`))
- .pipe(gulp.dest(`./build/${dirDark}/gtk-4.0/assets`))
- .on('end', (cb) => {
-
- timeLog(`gtk-4.0 Assets`);
-
- })
-
- });
+ gulp.watch('./src/gtk-4.0/**/*.scss',
+ gulp.parallel([
+ 'gtk4-light', 'gtk4-dark',
+ 'copy-user-theme-folder', 'autoreload']));
+ gulp.watch('./src/gtk-4.0/assets/*',
+ gulp.parallel([
+ 'gtk4-assets',
+ 'copy-user-theme-folder', 'autoreload']));
// Gtk3
- gulp.watch('./src/gtk-3.0/**/*.scss', function (cb) {
+ gulp.watch('./src/gtk-3.0/**/*.scss',
+ gulp.parallel([
+ 'gtk3-light', 'gtk3-dark',
+ 'copy-user-theme-folder', 'autoreload']));
- gulp.start(['gtk3-light', 'gtk3-dark'], function () {
-
- gulp.start('copy-user-theme-folder', function () {
- autoreload();
- })
- })
-
- });
-
- gulp.watch('./src/gtk-3.0/assets/*', function (file) {
-
- gulp.src(file.path)
- .pipe(gulp.dest(`./build/${dirLight}/gtk-3.0/assets`))
- .pipe(gulp.dest(`./build/${dirDark}/gtk-3.0/assets`))
- .on('end', (cb) => {
-
- timeLog(`gtk-3.0 Assets`);
-
- })
-
- });
+ gulp.watch('./src/gtk-3.0/assets/*',
+ gulp.parallel([
+ 'gtk3-assets',
+ 'copy-user-theme-folder', 'autoreload']));
// Gnome-shell
- gulp.watch('./src/gnome-shell/**/*.scss', function (cb) {
-
- gulp.start([
+ gulp.watch('./src/gnome-shell/**/*.scss',
+ gulp.parallel([
'gnome-shell-light',
'gnome-shell-light-assets',
'gnome-shell-dark',
'gnome-shell-dark-assets',
- 'gnome-shell-high'
- ], function () {
- gulp.start('copy-user-theme-folder', function () {
- autoreload();
- })
- })
-
- });
-
-
+ 'gnome-shell-high',
+ 'copy-user-theme-folder', 'autoreload']));
});
/*===== End of Watch ======*/
@@ -418,7 +381,7 @@ gulp.task('zip-dark', function () {
.pipe(gulp.dest('./build/'))
})
-
+gulp.task('zip', gulp.series(['zip-light', 'zip-dark']));
/**
*
@@ -426,7 +389,7 @@ gulp.task('zip-dark', function () {
*
*/
-gulp.task('default', [
+gulp.task('default', gulp.series([
'theme-light',
'theme-dark',
'gtk4-light',
@@ -443,11 +406,6 @@ gulp.task('default', [
'gnome-shell-dark-assets',
'gnome-shell-high',
'xfwm4-light',
- 'xfwm4-dark'
-], (cb) => {
-
- gulp.start(['zip-light', 'zip-dark'], function () {
- cb;
- })
-
-});
+ 'xfwm4-dark',
+ 'zip'
+]));
diff --git a/package.json b/package.json
index bf667d6..a72cd1e 100644
--- a/package.json
+++ b/package.json
@@ -26,8 +26,10 @@
"gulp-zip": "^4.1.0"
},
"devDependencies": {
+ "graceful-fs": "^4.2.3",
+ "chokidar": "^3.5.2",
"del": "^3.0.0",
- "gulp": "^3.9.1",
+ "gulp": "^4.0.2",
"gulp-rename": "^1.2.3",
"gulp-sass": "^4.0.1",
"gulp-watch": "^5.0.1"
|