remove package.json electronVersion
This commit is contained in:
parent
3c70e7e276
commit
fdcecb53e6
|
@ -33,6 +33,7 @@ const crypto = require('crypto');
|
||||||
const i18n = require('./lib/i18n');
|
const i18n = require('./lib/i18n');
|
||||||
const glob = require('glob');
|
const glob = require('glob');
|
||||||
const deps = require('./dependencies');
|
const deps = require('./dependencies');
|
||||||
|
const getElectronVersion = require('./lib/electron').getElectronVersion;
|
||||||
|
|
||||||
const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname));
|
const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname));
|
||||||
const baseModules = Object.keys(process.binding('natives')).filter(n => !/^_|\//.test(n));
|
const baseModules = Object.keys(process.binding('natives')).filter(n => !/^_|\//.test(n));
|
||||||
|
@ -123,7 +124,7 @@ gulp.task('minify-vscode', ['clean-minified-vscode', 'optimize-index-js'], commo
|
||||||
const darwinCreditsTemplate = product.darwinCredits && _.template(fs.readFileSync(path.join(root, product.darwinCredits), 'utf8'));
|
const darwinCreditsTemplate = product.darwinCredits && _.template(fs.readFileSync(path.join(root, product.darwinCredits), 'utf8'));
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
version: packageJson.electronVersion,
|
version: getElectronVersion(),
|
||||||
productAppName: product.nameLong,
|
productAppName: product.nameLong,
|
||||||
companyName: 'Microsoft Corporation',
|
companyName: 'Microsoft Corporation',
|
||||||
copyright: 'Copyright (C) 2017 Microsoft. All rights reserved',
|
copyright: 'Copyright (C) 2017 Microsoft. All rights reserved',
|
||||||
|
|
|
@ -21,9 +21,8 @@ module.exports.getElectronVersion = getElectronVersion;
|
||||||
// returns 0 if the right version of electron is in .build/electron
|
// returns 0 if the right version of electron is in .build/electron
|
||||||
if (require.main === module) {
|
if (require.main === module) {
|
||||||
const version = getElectronVersion();
|
const version = getElectronVersion();
|
||||||
console.log(version);
|
|
||||||
|
|
||||||
const versionFile = path.join(root, '.build', 'electron', 'version');
|
const versionFile = path.join(root, '.build', 'electron', 'version');
|
||||||
const isUpToDate = fs.existsSync(versionFile) && fs.readFileSync(versionFile, 'utf8') === `v${version}`;
|
const isUpToDate = fs.existsSync(versionFile) && fs.readFileSync(versionFile, 'utf8') === `v${version}`;
|
||||||
|
|
||||||
process.exit(isUpToDate ? 0 : 1);
|
process.exit(isUpToDate ? 0 : 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "code-oss-dev",
|
"name": "code-oss-dev",
|
||||||
"version": "1.19.0",
|
"version": "1.19.0",
|
||||||
"electronVersion": "1.7.9",
|
|
||||||
"distro": "4120b819fd97e23adef120e48ceaa7d47c213c2c",
|
"distro": "4120b819fd97e23adef120e48ceaa7d47c213c2c",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Microsoft Corporation"
|
"name": "Microsoft Corporation"
|
||||||
|
|
|
@ -13,14 +13,9 @@ set NAMESHORT=%NAMESHORT: "=%
|
||||||
set NAMESHORT=%NAMESHORT:"=%.exe
|
set NAMESHORT=%NAMESHORT:"=%.exe
|
||||||
set CODE=".build\electron\%NAMESHORT%"
|
set CODE=".build\electron\%NAMESHORT%"
|
||||||
|
|
||||||
for /f "tokens=2 delims=:," %%a in ('findstr /R /C:"\"electronVersion\":.*" package.json') do set DESIREDVERSION=%%~a
|
:: Download Electron if needed
|
||||||
set DESIREDVERSION=%DESIREDVERSION: "=%
|
node build\lib\electron.js
|
||||||
set DESIREDVERSION=v%DESIREDVERSION:"=%
|
if %errorlevel% neq 0 node .\node_modules\gulp\bin\gulp.js electron
|
||||||
if exist .\.build\electron\version (set /p INSTALLEDVERSION=<.\.build\electron\version) else (set INSTALLEDVERSION="")
|
|
||||||
|
|
||||||
:: Get electron
|
|
||||||
if not exist %CODE% node .\node_modules\gulp\bin\gulp.js electron
|
|
||||||
if not "%INSTALLEDVERSION%" == "%DESIREDVERSION%" node .\node_modules\gulp\bin\gulp.js electron
|
|
||||||
|
|
||||||
:: Build
|
:: Build
|
||||||
if not exist out node .\node_modules\gulp\bin\gulp.js compile
|
if not exist out node .\node_modules\gulp\bin\gulp.js compile
|
||||||
|
|
|
@ -18,14 +18,11 @@ function code() {
|
||||||
CODE=".build/electron/$NAME"
|
CODE=".build/electron/$NAME"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
INTENDED_VERSION="v`node -p "require('./package.json').electronVersion"`"
|
|
||||||
INSTALLED_VERSION=`cat .build/electron/version 2> /dev/null`
|
|
||||||
|
|
||||||
# Node modules
|
# Node modules
|
||||||
test -d node_modules || yarn
|
test -d node_modules || yarn
|
||||||
|
|
||||||
# Get electron
|
# Get electron
|
||||||
(test -f "$CODE" && [ $INTENDED_VERSION == $INSTALLED_VERSION ]) || ./node_modules/.bin/gulp electron
|
node build/lib/electron.js || ./node_modules/.bin/gulp electron
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
test -d out || ./node_modules/.bin/gulp compile
|
test -d out || ./node_modules/.bin/gulp compile
|
||||||
|
|
|
@ -13,14 +13,9 @@ set NAMESHORT=%NAMESHORT: "=%
|
||||||
set NAMESHORT=%NAMESHORT:"=%.exe
|
set NAMESHORT=%NAMESHORT:"=%.exe
|
||||||
set CODE=".build\electron\%NAMESHORT%"
|
set CODE=".build\electron\%NAMESHORT%"
|
||||||
|
|
||||||
for /f "tokens=2 delims=:," %%a in ('findstr /R /C:"\"electronVersion\":.*" package.json') do set DESIREDVERSION=%%~a
|
:: Download Electron if needed
|
||||||
set DESIREDVERSION=%DESIREDVERSION: "=%
|
node build\lib\electron.js
|
||||||
set DESIREDVERSION=v%DESIREDVERSION:"=%
|
if %errorlevel% neq 0 node .\node_modules\gulp\bin\gulp.js electron
|
||||||
if exist .\.build\electron\version (set /p INSTALLEDVERSION=<.\.build\electron\version) else (set INSTALLEDVERSION="")
|
|
||||||
|
|
||||||
:: Get electron
|
|
||||||
if not exist %CODE% node .\node_modules\gulp\bin\gulp.js electron
|
|
||||||
if not "%INSTALLEDVERSION%" == "%DESIREDVERSION%" node .\node_modules\gulp\bin\gulp.js electron
|
|
||||||
|
|
||||||
:: Build
|
:: Build
|
||||||
if not exist out node .\node_modules\gulp\bin\gulp.js compile
|
if not exist out node .\node_modules\gulp\bin\gulp.js compile
|
||||||
|
|
|
@ -18,14 +18,11 @@ function code() {
|
||||||
CODE=".build/electron/$NAME"
|
CODE=".build/electron/$NAME"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
INTENDED_VERSION="v`node -p "require('./package.json').electronVersion"`"
|
|
||||||
INSTALLED_VERSION=`cat .build/electron/version 2> /dev/null`
|
|
||||||
|
|
||||||
# Node modules
|
# Node modules
|
||||||
test -d node_modules || yarn
|
test -d node_modules || yarn
|
||||||
|
|
||||||
# Get electron
|
# Get electron
|
||||||
(test -f "$CODE" && [ $INTENDED_VERSION == $INSTALLED_VERSION ]) || ./node_modules/.bin/gulp electron
|
node build/lib/electron.js || ./node_modules/.bin/gulp electron
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
test -d out || ./node_modules/.bin/gulp compile
|
test -d out || ./node_modules/.bin/gulp compile
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
$env:npm_config_disturl="https://atom.io/download/electron"
|
$env:npm_config_disturl="https://atom.io/download/electron"
|
||||||
$env:npm_config_target=(node -p "require('./package.json').electronVersion")
|
$env:npm_config_target=(node "build/lib/electron.js")
|
||||||
$env:npm_config_runtime="electron"
|
$env:npm_config_runtime="electron"
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
export npm_config_disturl=https://atom.io/download/electron
|
export npm_config_disturl=https://atom.io/download/electron
|
||||||
export npm_config_target=$(node -p "require('./package.json').electronVersion")
|
export npm_config_target=$(node "build/lib/electron.js")
|
||||||
export npm_config_runtime=electron
|
export npm_config_runtime=electron
|
||||||
export npm_config_cache="$HOME/.npm-electron"
|
export npm_config_cache="$HOME/.npm-electron"
|
||||||
mkdir -p "$npm_config_cache"
|
mkdir -p "$npm_config_cache"
|
|
@ -17,12 +17,8 @@ else
|
||||||
CODE=".build/electron/$NAME"
|
CODE=".build/electron/$NAME"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
INTENDED_VERSION="v`node -p "require('./package.json').electronVersion"`"
|
|
||||||
INSTALLED_VERSION=$(cat .build/electron/version 2> /dev/null)
|
|
||||||
|
|
||||||
|
|
||||||
# Get electron
|
# Get electron
|
||||||
(test -f "$CODE" && [ $INTENDED_VERSION == $INSTALLED_VERSION ]) || ./node_modules/.bin/gulp electron
|
node build/lib/electron.js || ./node_modules/.bin/gulp electron
|
||||||
|
|
||||||
export VSCODE_DEV=1
|
export VSCODE_DEV=1
|
||||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
|
|
|
@ -12,13 +12,8 @@ set NAMESHORT=%NAMESHORT:"=%.exe
|
||||||
set CODE=".build\electron\%NAMESHORT%"
|
set CODE=".build\electron\%NAMESHORT%"
|
||||||
|
|
||||||
:: Download Electron if needed
|
:: Download Electron if needed
|
||||||
for /f "tokens=2 delims=:," %%a in ('findstr /R /C:"\"electronVersion\":.*" package.json') do set DESIREDVERSION=%%~a
|
node build\lib\electron.js
|
||||||
set DESIREDVERSION=%DESIREDVERSION: "=%
|
if %errorlevel% neq 0 node .\node_modules\gulp\bin\gulp.js electron
|
||||||
set DESIREDVERSION=v%DESIREDVERSION:"=%
|
|
||||||
if exist .\.build\electron\version (set /p INSTALLEDVERSION=<.\.build\electron\version) else (set INSTALLEDVERSION="")
|
|
||||||
|
|
||||||
if not exist %CODE% node .\node_modules\gulp\bin\gulp.js electron
|
|
||||||
if not "%INSTALLEDVERSION%" == "%DESIREDVERSION%" node .\node_modules\gulp\bin\gulp.js electron
|
|
||||||
|
|
||||||
:: Run tests
|
:: Run tests
|
||||||
%CODE% .\test\electron\index.js %*
|
%CODE% .\test\electron\index.js %*
|
||||||
|
|
|
@ -18,14 +18,11 @@ else
|
||||||
CODE=".build/electron/$NAME"
|
CODE=".build/electron/$NAME"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
INTENDED_VERSION="v`node -p "require('./package.json').electronVersion"`"
|
|
||||||
INSTALLED_VERSION=$(cat .build/electron/version 2> /dev/null)
|
|
||||||
|
|
||||||
# Node modules
|
# Node modules
|
||||||
test -d node_modules || yarn
|
test -d node_modules || yarn
|
||||||
|
|
||||||
# Get electron
|
# Get electron
|
||||||
(test -f "$CODE" && [ $INTENDED_VERSION == $INSTALLED_VERSION ]) || ./node_modules/.bin/gulp electron
|
node build/lib/electron.js || ./node_modules/.bin/gulp electron
|
||||||
|
|
||||||
# Unit Tests
|
# Unit Tests
|
||||||
export ELECTRON_ENABLE_LOGGING=1
|
export ELECTRON_ENABLE_LOGGING=1
|
||||||
|
|
Loading…
Reference in a new issue