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

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

Issue 2620883002: Convert Settings.in, CSSValueKeywords.in, SVGCSSValueKeywords.in to json5 (Closed)
Patch Set: Convert CSSProperties.in to json5 format Created 3 years, 11 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 87
88 Promise.all([browserProtocolPromise, jsProtocolPromise]) 88 Promise.all([browserProtocolPromise, jsProtocolPromise])
89 .then(() => done()) 89 .then(() => done())
90 .catch(err => console.log("Error fetching protocols:", err)); 90 .catch(err => console.log("Error fetching protocols:", err));
91 } 91 }
92 92
93 gulp.task("generateSupportedCSSProperties", ["fetchSupportedCSSProperties"], gen erateSupportedCSSProperties); 93 gulp.task("generateSupportedCSSProperties", ["fetchSupportedCSSProperties"], gen erateSupportedCSSProperties);
94 function generateSupportedCSSProperties() 94 function generateSupportedCSSProperties()
95 { 95 {
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 { 106 {
107 var supportedCSSPropertiesURL = "https://chromium.googlesource.com/chromium/ src/+/master/third_party/WebKit/Source/core/css/CSSProperties.in?format=TEXT"; 107 var supportedCSSPropertiesURL = "https://chromium.googlesource.com/chromium/ src/+/master/third_party/WebKit/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, supportedCSSPropertiesFil e) 109 fetchAndSaveCodePromise(supportedCSSPropertiesURL, supportedCSSPropertiesFil e)
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 { 116 {
117 var script = path.join(scriptsPath, "build", "generate_devtools_extension_ap i.py"); 117 var script = path.join(scriptsPath, "build", "generate_devtools_extension_ap i.py");
118 var inputs = [path.join(frontendPath, "extensions", "ExtensionAPI.js")]; 118 var inputs = [path.join(frontendPath, "extensions", "ExtensionAPI.js")];
(...skipping 21 matching lines...) Expand all
140 { 140 {
141 return utils.fetch(url) 141 return utils.fetch(url)
142 .then(buffer => utils.atob(buffer.toString("binary"))) 142 .then(buffer => utils.atob(buffer.toString("binary")))
143 .then(data => fsPromise.writeFile(file, data)); 143 .then(data => fsPromise.writeFile(file, data));
144 } 144 }
145 145
146 function runPythonScript(script, args) 146 function runPythonScript(script, args)
147 { 147 {
148 shell(`python ${script} ${args.join(" ")}`); 148 shell(`python ${script} ${args.join(" ")}`);
149 } 149 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698