Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(499)

Side by Side Diff: third_party/WebKit/Source/devtools/scripts/gulp/gulpfile.js

Issue 2633223003: Convert CSSProperties.in to JSON5 format (Closed)
Patch Set: Fix test_converter_unittest Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var childProcess = require('child_process'); 5 var childProcess = require('child_process');
6 var fs = require('fs'); 6 var fs = require('fs');
7 var path = require('path'); 7 var path = require('path');
8 var shell = childProcess.execSync; 8 var shell = childProcess.execSync;
9 9
10 var del = require('del'); 10 var del = require('del');
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 var jsProtocolPromise = fetchAndSaveCodePromise(jsProtocolURL, jsProtocolFile) ; 87 var jsProtocolPromise = fetchAndSaveCodePromise(jsProtocolURL, jsProtocolFile) ;
88 88
89 Promise.all([browserProtocolPromise, jsProtocolPromise]) 89 Promise.all([browserProtocolPromise, jsProtocolPromise])
90 .then(() => done()) 90 .then(() => done())
91 .catch(err => console.log('Error fetching protocols:', err)); 91 .catch(err => console.log('Error fetching protocols:', err));
92 } 92 }
93 93
94 gulp.task('generateSupportedCSSProperties', ['fetchSupportedCSSProperties'], gen erateSupportedCSSProperties); 94 gulp.task('generateSupportedCSSProperties', ['fetchSupportedCSSProperties'], gen erateSupportedCSSProperties);
95 function generateSupportedCSSProperties() { 95 function generateSupportedCSSProperties() {
96 var script = path.join(scriptsPath, 'build', 'generate_supported_css.py'); 96 var script = path.join(scriptsPath, 'build', 'generate_supported_css.py');
97 var inputs = [path.join(releasePath, 'CSSProperties.in')]; 97 var inputs = [path.join(releasePath, 'CSSProperties.json5')];
98 var outputs = [path.join(releasePath, 'SupportedCSSProperties.js')]; 98 var outputs = [path.join(releasePath, 'SupportedCSSProperties.js')];
99 var args = inputs.concat(outputs); 99 var args = inputs.concat(outputs);
100 runPythonScript(script, args); 100 runPythonScript(script, args);
101 del.sync([path.join(releasePath, 'CSSProperties.in')], {force: true}); 101 del.sync([path.join(releasePath, 'CSSProperties.json5')], {force: true});
102 } 102 }
103 103
104 gulp.task('fetchSupportedCSSProperties', ['clean'], fetchSupportedCSSProperties) ; 104 gulp.task('fetchSupportedCSSProperties', ['clean'], fetchSupportedCSSProperties) ;
105 function fetchSupportedCSSProperties(done) { 105 function fetchSupportedCSSProperties(done) {
106 var supportedCSSPropertiesURL = 106 var supportedCSSPropertiesURL =
107 'https://chromium.googlesource.com/chromium/src/+/master/third_party/WebKi t/Source/core/css/CSSProperties.in?format=TEXT'; 107 'https://chromium.googlesource.com/chromium/src/+/master/third_party/WebKi t/Source/core/css/CSSProperties.json5?format=TEXT';
108 var supportedCSSPropertiesFile = path.join(releasePath, 'CSSProperties.in'); 108 var supportedCSSPropertiesFile = path.join(releasePath, 'CSSProperties.json5') ;
109 fetchAndSaveCodePromise(supportedCSSPropertiesURL, supportedCSSPropertiesFile) 109 fetchAndSaveCodePromise(supportedCSSPropertiesURL, supportedCSSPropertiesFile)
110 .then(() => done()) 110 .then(() => done())
111 .catch(err => console.log('Error fetching CSS properties:', err)); 111 .catch(err => console.log('Error fetching CSS properties:', err));
112 } 112 }
113 113
114 gulp.task('generateDevtoolsExtensionAPI', ['clean'], generateDevtoolsExtensionAP ITask); 114 gulp.task('generateDevtoolsExtensionAPI', ['clean'], generateDevtoolsExtensionAP ITask);
115 function generateDevtoolsExtensionAPITask() { 115 function generateDevtoolsExtensionAPITask() {
116 var script = path.join(scriptsPath, 'build', 'generate_devtools_extension_api. py'); 116 var script = path.join(scriptsPath, 'build', 'generate_devtools_extension_api. py');
117 var inputs = [path.join(frontendPath, 'extensions', 'ExtensionAPI.js')]; 117 var inputs = [path.join(frontendPath, 'extensions', 'ExtensionAPI.js')];
118 var outputs = [path.join(releasePath, 'devtools_extension_api.js')]; 118 var outputs = [path.join(releasePath, 'devtools_extension_api.js')];
(...skipping 14 matching lines...) Expand all
133 133
134 function fetchAndSaveCodePromise(url, file) { 134 function fetchAndSaveCodePromise(url, file) {
135 return utils.fetch(url) 135 return utils.fetch(url)
136 .then(buffer => utils.atob(buffer.toString('binary'))) 136 .then(buffer => utils.atob(buffer.toString('binary')))
137 .then(data => fsPromise.writeFile(file, data)); 137 .then(data => fsPromise.writeFile(file, data));
138 } 138 }
139 139
140 function runPythonScript(script, args) { 140 function runPythonScript(script, args) {
141 shell(`python ${script} ${args.join(' ')}`); 141 shell(`python ${script} ${args.join(' ')}`);
142 } 142 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698