build: enable JS semicolons (#22783)
This commit is contained in:
parent
24e21467b9
commit
5d657dece4
354 changed files with 21512 additions and 21510 deletions
|
@ -1,9 +1,9 @@
|
|||
const crypto = require('crypto')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const crypto = require('crypto');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
// Fallback to blow away old cache keys
|
||||
const HASH_VERSION = 3
|
||||
const HASH_VERSION = 3;
|
||||
|
||||
// Base files to hash
|
||||
const filesToHash = [
|
||||
|
@ -11,42 +11,42 @@ const filesToHash = [
|
|||
path.resolve(__dirname, '../yarn.lock'),
|
||||
path.resolve(__dirname, '../script/external-binaries.json'),
|
||||
path.resolve(__dirname, '../script/sysroots.json')
|
||||
]
|
||||
];
|
||||
|
||||
const addAllFiles = (dir) => {
|
||||
for (const child of fs.readdirSync(dir).sort()) {
|
||||
const childPath = path.resolve(dir, child)
|
||||
const childPath = path.resolve(dir, child);
|
||||
if (fs.statSync(childPath).isDirectory()) {
|
||||
addAllFiles(childPath)
|
||||
addAllFiles(childPath);
|
||||
} else {
|
||||
filesToHash.push(childPath)
|
||||
filesToHash.push(childPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Add all patch files to the hash
|
||||
addAllFiles(path.resolve(__dirname, '../patches'))
|
||||
addAllFiles(path.resolve(__dirname, '../patches'));
|
||||
|
||||
// Create Hash
|
||||
const hasher = crypto.createHash('SHA256')
|
||||
hasher.update(`HASH_VERSION:${HASH_VERSION}`)
|
||||
const hasher = crypto.createHash('SHA256');
|
||||
hasher.update(`HASH_VERSION:${HASH_VERSION}`);
|
||||
for (const file of filesToHash) {
|
||||
hasher.update(fs.readFileSync(file))
|
||||
hasher.update(fs.readFileSync(file));
|
||||
}
|
||||
|
||||
// Add the GCLIENT_EXTRA_ARGS variable to the hash
|
||||
const extraArgs = process.env.GCLIENT_EXTRA_ARGS || 'no_extra_args'
|
||||
hasher.update(extraArgs)
|
||||
const extraArgs = process.env.GCLIENT_EXTRA_ARGS || 'no_extra_args';
|
||||
hasher.update(extraArgs);
|
||||
|
||||
const effectivePlatform = extraArgs.includes('host_os=mac') ? 'darwin' : process.platform
|
||||
const effectivePlatform = extraArgs.includes('host_os=mac') ? 'darwin' : process.platform;
|
||||
|
||||
// Write the hash to disk
|
||||
fs.writeFileSync(path.resolve(__dirname, '../.depshash'), hasher.digest('hex'))
|
||||
fs.writeFileSync(path.resolve(__dirname, '../.depshash'), hasher.digest('hex'));
|
||||
|
||||
let targetContent = `${effectivePlatform}\n${process.env.TARGET_ARCH}\n${process.env.GN_CONFIG}\n${undefined}\n${process.env.GN_EXTRA_ARGS}\n${process.env.GN_BUILDFLAG_ARGS}`
|
||||
const argsDir = path.resolve(__dirname, '../build/args')
|
||||
let targetContent = `${effectivePlatform}\n${process.env.TARGET_ARCH}\n${process.env.GN_CONFIG}\n${undefined}\n${process.env.GN_EXTRA_ARGS}\n${process.env.GN_BUILDFLAG_ARGS}`;
|
||||
const argsDir = path.resolve(__dirname, '../build/args');
|
||||
for (const argFile of fs.readdirSync(argsDir).sort()) {
|
||||
targetContent += `\n${argFile}--${crypto.createHash('SHA1').update(fs.readFileSync(path.resolve(argsDir, argFile))).digest('hex')}`
|
||||
targetContent += `\n${argFile}--${crypto.createHash('SHA1').update(fs.readFileSync(path.resolve(argsDir, argFile))).digest('hex')}`;
|
||||
}
|
||||
|
||||
fs.writeFileSync(path.resolve(__dirname, '../.depshash-target'), targetContent)
|
||||
fs.writeFileSync(path.resolve(__dirname, '../.depshash-target'), targetContent);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue