mirror of
https://github.com/google/blockly.git
synced 2026-01-06 16:40:07 +01:00
chore(build): Only suppress expected warnings from closure-make-deps (#6350)
This commit is contained in:
committed by
GitHub
parent
aff21b936c
commit
883d78d5a0
@@ -15,7 +15,7 @@ gulp.sourcemaps = require('gulp-sourcemaps');
|
|||||||
|
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var execSync = require('child_process').execSync;
|
const {exec, execSync} = require('child_process');
|
||||||
var through2 = require('through2');
|
var through2 = require('through2');
|
||||||
|
|
||||||
const clangFormat = require('clang-format');
|
const clangFormat = require('clang-format');
|
||||||
@@ -336,18 +336,47 @@ function buildDeps(done) {
|
|||||||
'tests/mocha'
|
'tests/mocha'
|
||||||
];
|
];
|
||||||
|
|
||||||
const args = roots.map(root => `--root '${root}' `).join('');
|
function filterErrors(text) {
|
||||||
execSync(
|
return text.split('\n')
|
||||||
`closure-make-deps ${args} 2>/dev/null >'${DEPS_FILE}'`,
|
.filter(
|
||||||
{stdio: 'inherit'});
|
(line) => !/^WARNING /.test(line) ||
|
||||||
|
!(/Missing type declaration./.test(line) ||
|
||||||
|
/illegal use of unknown JSDoc tag/.test(line)))
|
||||||
|
.join('\n');
|
||||||
|
}
|
||||||
|
|
||||||
// Use grep to filter out the entries that are already in deps.js.
|
new Promise((resolve, reject) => {
|
||||||
const testArgs = testRoots.map(root => `--root '${root}' `).join('');
|
const args = roots.map(root => `--root '${root}' `).join('');
|
||||||
execSync(
|
exec(
|
||||||
`closure-make-deps ${testArgs} 2>/dev/null \
|
`closure-make-deps ${args} >'${DEPS_FILE}'`,
|
||||||
| grep 'tests/mocha' > '${TEST_DEPS_FILE}'`,
|
{stdio: ['inherit', 'inherit', 'pipe']},
|
||||||
{stdio: 'inherit'});
|
(error, stdout, stderr) => {
|
||||||
done();
|
console.warn(filterErrors(stderr));
|
||||||
|
if (error) {
|
||||||
|
reject(error);
|
||||||
|
} else {
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}).then(() => new Promise((resolve, reject) => {
|
||||||
|
// Use grep to filter out the entries that are already in deps.js.
|
||||||
|
const testArgs =
|
||||||
|
testRoots.map(root => `--root '${root}' `).join('');
|
||||||
|
exec(
|
||||||
|
`closure-make-deps ${testArgs} 2>/dev/null\
|
||||||
|
| grep 'tests/mocha' > '${TEST_DEPS_FILE}'`,
|
||||||
|
{stdio: ['inherit', 'inherit', 'pipe']},
|
||||||
|
(error, stdout, stderr) => {
|
||||||
|
console.warn(filterErrors(stderr));
|
||||||
|
if (error) {
|
||||||
|
reject(error);
|
||||||
|
} else {
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})).then(() => {
|
||||||
|
done();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user