未验证 提交 acd7bb92 编写于 作者: J João Moreno 提交者: GitHub

Merge pull request #91155 from microsoft/joao/refactor-build

Refactor build
......@@ -77,6 +77,11 @@ steps:
yarn postinstall
displayName: Run postinstall scripts
condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'), eq(variables['CacheRestored'], 'true'))
env:
OSS_GITHUB_ID: "a5d3c261b032765a78de"
OSS_GITHUB_SECRET: $(oss-github-client-secret)
INSIDERS_GITHUB_ID: "31f02627809389d9f111"
INSIDERS_GITHUB_SECRET: $(insiders-github-client-secret)
# Mixin must run before optimize, because the CSS loader will
# inline small SVGs
......@@ -116,11 +121,6 @@ steps:
yarn gulp minify-vscode-reh-web
displayName: Compile
condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'))
env:
OSS_GITHUB_ID: "a5d3c261b032765a78de"
OSS_GITHUB_SECRET: $(oss-github-client-secret)
INSIDERS_GITHUB_ID: "31f02627809389d9f111"
INSIDERS_GITHUB_SECRET: $(insiders-github-client-secret)
- script: |
set -e
......
......@@ -74,7 +74,6 @@ function compileTask(src, out, build) {
if (src === 'src') {
generator.execute();
}
generateGitHubAuthConfig();
return srcPipe
.pipe(generator.stream)
.pipe(compile())
......@@ -97,17 +96,6 @@ function watchTask(out, build) {
}
exports.watchTask = watchTask;
const REPO_SRC_FOLDER = path.join(__dirname, '../../src');
function generateGitHubAuthConfig() {
const schemes = ['OSS', 'INSIDERS'];
let content = {};
schemes.forEach(scheme => {
content[scheme] = {
id: process.env[`${scheme}_GITHUB_ID`],
secret: process.env[`${scheme}_GITHUB_SECRET`]
};
});
fs.writeFileSync(path.join(__dirname, '../../extensions/github-authentication/src/common/config.json'), JSON.stringify(content));
}
class MonacoGenerator {
constructor(isWatch) {
this._executeSoonTimer = null;
......
......@@ -88,8 +88,6 @@ export function compileTask(src: string, out: string, build: boolean): () => Nod
generator.execute();
}
generateGitHubAuthConfig();
return srcPipe
.pipe(generator.stream)
.pipe(compile())
......@@ -117,19 +115,6 @@ export function watchTask(out: string, build: boolean): () => NodeJS.ReadWriteSt
const REPO_SRC_FOLDER = path.join(__dirname, '../../src');
function generateGitHubAuthConfig() {
const schemes = ['OSS', 'INSIDERS'];
let content: { [key: string]: { id?: string, secret?: string }} = {};
schemes.forEach(scheme => {
content[scheme] = {
id: process.env[`${scheme}_GITHUB_ID`],
secret: process.env[`${scheme}_GITHUB_SECRET`]
};
});
fs.writeFileSync(path.join(__dirname, '../../extensions/github-authentication/src/common/config.json'), JSON.stringify(content));
}
class MonacoGenerator {
private readonly _isWatch: boolean;
public readonly stream: NodeJS.ReadWriteStream;
......
......@@ -13,7 +13,7 @@ const yarn = process.platform === 'win32' ? 'yarn.cmd' : 'yarn';
* @param {*} [opts]
*/
function yarnInstall(location, opts) {
opts = opts || {};
opts = opts || { env: process.env };
opts.cwd = location;
opts.stdio = 'inherit';
......@@ -52,8 +52,6 @@ extensions.forEach(extension => yarnInstall(`extensions/${extension}`));
function yarnInstallBuildDependencies() {
// make sure we install the deps of build/lib/watch for the system installed
// node, since that is the driver of gulp
//@ts-ignore
const env = Object.assign({}, process.env);
const watchPath = path.join(path.dirname(__dirname), 'lib', 'watch');
const yarnrcPath = path.join(watchPath, '.yarnrc');
......@@ -66,7 +64,7 @@ target "${target}"
runtime "${runtime}"`;
fs.writeFileSync(yarnrcPath, yarnrc, 'utf8');
yarnInstall(watchPath, { env });
yarnInstall(watchPath);
}
yarnInstall(`build`); // node modules required for build
......
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
const fs = require('fs');
const path = require('path');
const schemes = ['OSS', 'INSIDERS'];
function main() {
let content = {};
for (const scheme of schemes) {
const id = process.env[`${scheme}_GITHUB_ID`];
const secret = process.env[`${scheme}_GITHUB_SECRET`];
if (id && secret) {
content[scheme] = { id, secret };
}
}
fs.writeFileSync(path.join(__dirname, '../src/common/config.json'), JSON.stringify(content));
}
main();
{
"name": "github-authentication",
"displayName": "%displayName%",
"description": "%description%",
"publisher": "vscode",
"version": "0.0.1",
"engines": {
"vscode": "^1.41.0"
},
"enableProposedApi": true,
"categories": [
"Other"
],
"activationEvents": [
"*"
],
"main": "./out/extension.js",
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "gulp compile-extension:github-authentication",
"watch": "gulp watch-extension:github-authentication"
},
"dependencies": {
"uuid": "^3.3.3"
},
"devDependencies": {
"@types/keytar": "^4.4.2",
"@types/node": "^10.12.21",
"@types/uuid": "^3.4.6",
"typescript": "^3.7.5"
}
"name": "github-authentication",
"displayName": "%displayName%",
"description": "%description%",
"publisher": "vscode",
"version": "0.0.1",
"engines": {
"vscode": "^1.41.0"
},
"enableProposedApi": true,
"categories": [
"Other"
],
"activationEvents": [
"*"
],
"main": "./out/extension.js",
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "gulp compile-extension:github-authentication",
"watch": "gulp watch-extension:github-authentication",
"postinstall": "node build/postinstall.js"
},
"dependencies": {
"uuid": "^3.3.3"
},
"devDependencies": {
"@types/keytar": "^4.4.2",
"@types/node": "^10.12.21",
"@types/uuid": "^3.4.6",
"typescript": "^3.7.5"
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册