mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Merge commit '677bbb7f0b8754787ff9e7bfab4602ba82e13b0b' into wl-upgrade-webdriverio
This commit is contained in:
@@ -5,17 +5,17 @@ const CONFIG = require('../config')
|
||||
const semver = require('semver')
|
||||
|
||||
module.exports = function () {
|
||||
// Chromedriver should be specified as ~x.y where x and y match Electron major/minor
|
||||
// Chromedriver should be specified as ^n.x where n matches the Electron major version
|
||||
const chromedriverVer = buildMetadata.dependencies['electron-chromedriver']
|
||||
const mksnapshotVer = buildMetadata.dependencies['electron-mksnapshot']
|
||||
|
||||
// Always use tilde on electron-chromedriver so that it can pick up the best patch version
|
||||
if (!chromedriverVer.startsWith('~')) {
|
||||
throw new Error(`electron-chromedriver version in script/package.json should start with a tilde to match latest patch version.`)
|
||||
// Always use caret on electron-chromedriver so that it can pick up the best minor/patch versions
|
||||
if (!chromedriverVer.startsWith('^')) {
|
||||
throw new Error(`electron-chromedriver version in script/package.json should start with a caret to match latest patch version.`)
|
||||
}
|
||||
|
||||
if (!mksnapshotVer.startsWith('~')) {
|
||||
throw new Error(`electron-mksnapshot version in script/package.json should start with a tilde to match latest patch version.`)
|
||||
if (!mksnapshotVer.startsWith('^')) {
|
||||
throw new Error(`electron-mksnapshot version in script/package.json should start with a caret to match latest patch version.`)
|
||||
}
|
||||
|
||||
const electronVer = CONFIG.appMetadata.electronVersion
|
||||
|
||||
@@ -113,6 +113,12 @@ module.exports = function (packagedAppPath) {
|
||||
path.join(debianPackageLintianOverridesDirPath, atomExecutableName)
|
||||
)
|
||||
|
||||
console.log(`Copying polkit configuration into "${debianPackageShareDirPath}"`)
|
||||
fs.copySync(
|
||||
path.join(CONFIG.repositoryRootPath, 'resources', 'linux', 'atom.policy'),
|
||||
path.join(debianPackageShareDirPath, 'polkit-1', 'actions', 'atom.policy')
|
||||
)
|
||||
|
||||
console.log(`Generating .deb file from ${debianPackageDirPath}`)
|
||||
spawnSync('fakeroot', ['dpkg-deb', '-b', debianPackageDirPath], {stdio: 'inherit'})
|
||||
|
||||
|
||||
@@ -76,6 +76,12 @@ module.exports = function (packagedAppPath) {
|
||||
path.join(rpmPackageBuildDirPath, 'atom.sh')
|
||||
)
|
||||
|
||||
console.log(`Copying atom.policy into "${rpmPackageBuildDirPath}"`)
|
||||
fs.copySync(
|
||||
path.join(CONFIG.repositoryRootPath, 'resources', 'linux', 'atom.policy'),
|
||||
path.join(rpmPackageBuildDirPath, 'atom.policy')
|
||||
)
|
||||
|
||||
console.log(`Generating .rpm package from "${rpmPackageDirPath}"`)
|
||||
spawnSync('rpmbuild', ['-ba', '--clean', rpmPackageSpecFilePath])
|
||||
for (let generatedArch of fs.readdirSync(rpmPackageRpmsDirPath)) {
|
||||
|
||||
@@ -105,22 +105,36 @@ module.exports = function (packagedAppPath) {
|
||||
{env: Object.assign({}, process.env, {ELECTRON_RUN_AS_NODE: 1})}
|
||||
)
|
||||
|
||||
const generatedStartupBlobPath = path.join(CONFIG.buildOutputPath, 'snapshot_blob.bin')
|
||||
console.log(`Generating startup blob at "${generatedStartupBlobPath}"`)
|
||||
childProcess.execFileSync(
|
||||
path.join(CONFIG.repositoryRootPath, 'script', 'node_modules', 'electron-mksnapshot', 'bin', 'mksnapshot'),
|
||||
['--no-use_ic', snapshotScriptPath, '--startup_blob', generatedStartupBlobPath]
|
||||
console.log('Generating startup blob with mksnapshot')
|
||||
childProcess.spawnSync(
|
||||
process.execPath, [
|
||||
path.join(CONFIG.repositoryRootPath, 'script', 'node_modules', 'electron-mksnapshot', 'mksnapshot.js'),
|
||||
snapshotScriptPath,
|
||||
'--output_dir',
|
||||
CONFIG.buildOutputPath
|
||||
]
|
||||
)
|
||||
|
||||
let startupBlobDestinationPath
|
||||
if (process.platform === 'darwin') {
|
||||
startupBlobDestinationPath = `${packagedAppPath}/Contents/Frameworks/Electron Framework.framework/Resources/snapshot_blob.bin`
|
||||
startupBlobDestinationPath = `${packagedAppPath}/Contents/Frameworks/Electron Framework.framework/Resources`
|
||||
} else {
|
||||
startupBlobDestinationPath = path.join(packagedAppPath, 'snapshot_blob.bin')
|
||||
startupBlobDestinationPath = packagedAppPath
|
||||
}
|
||||
|
||||
console.log(`Moving generated startup blob into "${startupBlobDestinationPath}"`)
|
||||
fs.unlinkSync(startupBlobDestinationPath)
|
||||
fs.renameSync(generatedStartupBlobPath, startupBlobDestinationPath)
|
||||
const snapshotBinaries = ['v8_context_snapshot.bin', 'snapshot_blob.bin']
|
||||
for (let snapshotBinary of snapshotBinaries) {
|
||||
const destinationPath = path.join(startupBlobDestinationPath, snapshotBinary)
|
||||
console.log(`Moving generated startup blob into "${destinationPath}"`)
|
||||
try {
|
||||
fs.unlinkSync(destinationPath)
|
||||
} catch (err) {
|
||||
// Doesn't matter if the file doesn't exist already
|
||||
if (!err.code || err.code !== 'ENOENT') {
|
||||
throw err
|
||||
}
|
||||
}
|
||||
fs.renameSync(path.join(CONFIG.buildOutputPath, snapshotBinary), destinationPath)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ module.exports = function (packagedAppPath) {
|
||||
'find-certificate', '-c', 'Mac Developer'
|
||||
])
|
||||
|
||||
const certMatch = (result.stdout || '').toString().match(/\"(Mac Developer.*\))\"/)
|
||||
const certMatch = (result.stdout || '').toString().match(/"(Mac Developer.*\))"/)
|
||||
if (!certMatch || !certMatch[1]) {
|
||||
console.error('A "Mac Developer" certificate must be configured to perform test signing')
|
||||
} else {
|
||||
|
||||
36
script/package-lock.json
generated
36
script/package-lock.json
generated
@@ -1938,9 +1938,9 @@
|
||||
}
|
||||
},
|
||||
"electron-chromedriver": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/electron-chromedriver/-/electron-chromedriver-2.0.0.tgz",
|
||||
"integrity": "sha512-kERk/Wzhc9RzW9jUKXA5kJc4m8BlL6c9p5QH+CrIlst0saeqZL1Up7vzD4ZOnuBDpAVBBYJ4jhkAKIssf8ZlXg==",
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/electron-chromedriver/-/electron-chromedriver-3.0.0.tgz",
|
||||
"integrity": "sha512-xWivZRiPTtDFJt+qXv7Ax/Dmhxj0iqESOxoLZ2szu3fv6k1vYDUDJUMHfdfVAke9D2gBRIgChuGb5j3YEt6hxQ==",
|
||||
"requires": {
|
||||
"electron-download": "^4.1.0",
|
||||
"extract-zip": "^1.6.5"
|
||||
@@ -2035,12 +2035,34 @@
|
||||
}
|
||||
},
|
||||
"electron-mksnapshot": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/electron-mksnapshot/-/electron-mksnapshot-2.0.0.tgz",
|
||||
"integrity": "sha512-OoZwZJNKgHP+DwhCGVTJEuDSeb478hOzAbHeg7dKGCHDbKKmUWmjGc+pEjxGutpqQ3Mn8hCdLzdx2c/lAJcTLA==",
|
||||
"version": "3.1.10",
|
||||
"resolved": "https://registry.npmjs.org/electron-mksnapshot/-/electron-mksnapshot-3.1.10.tgz",
|
||||
"integrity": "sha512-hPbFENfbUNrgOsLMja3nUFbneBxgXowmfztmRdr+a7yW6X6/d9YAGw23b9kugBNDFTKcuuTo825zVpBRwjSYRQ==",
|
||||
"requires": {
|
||||
"electron-download": "^4.1.0",
|
||||
"extract-zip": "^1.6.5"
|
||||
"extract-zip": "^1.6.5",
|
||||
"fs-extra": "^7.0.1",
|
||||
"temp": "^0.8.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"fs-extra": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz",
|
||||
"integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==",
|
||||
"requires": {
|
||||
"graceful-fs": "^4.1.2",
|
||||
"jsonfile": "^4.0.0",
|
||||
"universalify": "^0.1.0"
|
||||
}
|
||||
},
|
||||
"jsonfile": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
|
||||
"integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
|
||||
"requires": {
|
||||
"graceful-fs": "^4.1.6"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"electron-osx-sign": {
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
"coffeelint": "1.15.7",
|
||||
"colors": "1.1.2",
|
||||
"donna": "1.0.16",
|
||||
"electron-chromedriver": "~2.0",
|
||||
"electron-chromedriver": "^3.0.0",
|
||||
"electron-link": "0.4.0",
|
||||
"electron-mksnapshot": "~2.0",
|
||||
"electron-mksnapshot": "^3.1.10",
|
||||
"electron-packager": "12.2.0",
|
||||
"electron-winstaller": "2.6.4",
|
||||
"eslint": "^5.16.0",
|
||||
|
||||
Reference in New Issue
Block a user