remove package.json electronVersion

This commit is contained in:
Joao Moreno 2017-11-16 14:43:41 +01:00
parent 3c70e7e276
commit fdcecb53e6
12 changed files with 17 additions and 46 deletions

View file

@ -33,6 +33,7 @@ const crypto = require('crypto');
const i18n = require('./lib/i18n');
const glob = require('glob');
const deps = require('./dependencies');
const getElectronVersion = require('./lib/electron').getElectronVersion;
const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname));
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 config = {
version: packageJson.electronVersion,
version: getElectronVersion(),
productAppName: product.nameLong,
companyName: 'Microsoft Corporation',
copyright: 'Copyright (C) 2017 Microsoft. All rights reserved',

View file

@ -21,9 +21,8 @@ module.exports.getElectronVersion = getElectronVersion;
// returns 0 if the right version of electron is in .build/electron
if (require.main === module) {
const version = getElectronVersion();
console.log(version);
const versionFile = path.join(root, '.build', 'electron', 'version');
const isUpToDate = fs.existsSync(versionFile) && fs.readFileSync(versionFile, 'utf8') === `v${version}`;
process.exit(isUpToDate ? 0 : 1);
}

View file

@ -1,7 +1,6 @@
{
"name": "code-oss-dev",
"version": "1.19.0",
"electronVersion": "1.7.9",
"distro": "4120b819fd97e23adef120e48ceaa7d47c213c2c",
"author": {
"name": "Microsoft Corporation"

View file

@ -13,14 +13,9 @@ set NAMESHORT=%NAMESHORT: "=%
set NAMESHORT=%NAMESHORT:"=%.exe
set CODE=".build\electron\%NAMESHORT%"
for /f "tokens=2 delims=:," %%a in ('findstr /R /C:"\"electronVersion\":.*" package.json') do set DESIREDVERSION=%%~a
set DESIREDVERSION=%DESIREDVERSION: "=%
set DESIREDVERSION=v%DESIREDVERSION:"=%
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
:: Download Electron if needed
node build\lib\electron.js
if %errorlevel% neq 0 node .\node_modules\gulp\bin\gulp.js electron
:: Build
if not exist out node .\node_modules\gulp\bin\gulp.js compile

View file

@ -18,14 +18,11 @@ function code() {
CODE=".build/electron/$NAME"
fi
INTENDED_VERSION="v`node -p "require('./package.json').electronVersion"`"
INSTALLED_VERSION=`cat .build/electron/version 2> /dev/null`
# Node modules
test -d node_modules || yarn
# 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
test -d out || ./node_modules/.bin/gulp compile

View file

@ -13,14 +13,9 @@ set NAMESHORT=%NAMESHORT: "=%
set NAMESHORT=%NAMESHORT:"=%.exe
set CODE=".build\electron\%NAMESHORT%"
for /f "tokens=2 delims=:," %%a in ('findstr /R /C:"\"electronVersion\":.*" package.json') do set DESIREDVERSION=%%~a
set DESIREDVERSION=%DESIREDVERSION: "=%
set DESIREDVERSION=v%DESIREDVERSION:"=%
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
:: Download Electron if needed
node build\lib\electron.js
if %errorlevel% neq 0 node .\node_modules\gulp\bin\gulp.js electron
:: Build
if not exist out node .\node_modules\gulp\bin\gulp.js compile

View file

@ -18,14 +18,11 @@ function code() {
CODE=".build/electron/$NAME"
fi
INTENDED_VERSION="v`node -p "require('./package.json').electronVersion"`"
INSTALLED_VERSION=`cat .build/electron/version 2> /dev/null`
# Node modules
test -d node_modules || yarn
# 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
test -d out || ./node_modules/.bin/gulp compile

View file

@ -1,3 +1,3 @@
$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"

View file

@ -1,6 +1,6 @@
#!/bin/bash
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_cache="$HOME/.npm-electron"
mkdir -p "$npm_config_cache"

View file

@ -17,12 +17,8 @@ else
CODE=".build/electron/$NAME"
fi
INTENDED_VERSION="v`node -p "require('./package.json').electronVersion"`"
INSTALLED_VERSION=$(cat .build/electron/version 2> /dev/null)
# 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
if [[ "$OSTYPE" == "darwin"* ]]; then

View file

@ -12,13 +12,8 @@ set NAMESHORT=%NAMESHORT:"=%.exe
set CODE=".build\electron\%NAMESHORT%"
:: Download Electron if needed
for /f "tokens=2 delims=:," %%a in ('findstr /R /C:"\"electronVersion\":.*" package.json') do set DESIREDVERSION=%%~a
set DESIREDVERSION=%DESIREDVERSION: "=%
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
node build\lib\electron.js
if %errorlevel% neq 0 node .\node_modules\gulp\bin\gulp.js electron
:: Run tests
%CODE% .\test\electron\index.js %*

View file

@ -18,14 +18,11 @@ else
CODE=".build/electron/$NAME"
fi
INTENDED_VERSION="v`node -p "require('./package.json').electronVersion"`"
INSTALLED_VERSION=$(cat .build/electron/version 2> /dev/null)
# Node modules
test -d node_modules || yarn
# 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
export ELECTRON_ENABLE_LOGGING=1