Skip to content

Commit 8c3a49f

Browse files
authored
edit gulpfile so envs ext is only bundled in pre-release (#25227)
1 parent 6e9c76c commit 8c3a49f

File tree

4 files changed

+23
-8
lines changed

4 files changed

+23
-8
lines changed

.github/actions/build-vsix/action.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,15 @@ runs:
7070
shell: bash
7171

7272
- name: Update optional extension dependencies
73-
run: npm run addExtensionPackDependencies
73+
run: |
74+
if [[ "${VSIX_NAME}" == *"insiders"* ]]; then
75+
npm run addExtensionPackDependenciesPreRelease
76+
else
77+
npm run addExtensionPackDependencies
78+
fi
7479
shell: bash
80+
env:
81+
VSIX_NAME: ${{ inputs.vsix_name }}
7582

7683
- name: Build Webpack
7784
run: |

build/azure-pipeline.pre-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ extends:
9191
- script: python ./build/update_package_file.py
9292
displayName: Update telemetry in package.json
9393

94-
- script: npm run addExtensionPackDependencies
94+
- script: npm run addExtensionPackDependenciesPreRelease
9595
displayName: Update optional extension dependencies
9696

9797
- script: npx gulp prePublishBundle

gulpfile.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,23 @@ gulp.task('addExtensionPackDependencies', async () => {
9393
await addExtensionPackDependencies();
9494
});
9595

96-
async function addExtensionPackDependencies() {
96+
// This task adds 'ms-python.vscode-python-envs' as required deps only for pre-release builds.
97+
gulp.task('addExtensionPackDependenciesPreRelease', async () => {
98+
await buildLicense();
99+
await addExtensionPackDependencies(true);
100+
});
101+
102+
async function addExtensionPackDependencies(isPreRelease = false) {
97103
// Update the package.json to add extension pack dependencies at build time so that
98104
// extension dependencies need not be installed during development
99105
const packageJsonContents = await fsExtra.readFile('package.json', 'utf-8');
100106
const packageJson = JSON.parse(packageJsonContents);
101-
packageJson.extensionPack = [
102-
'ms-python.vscode-pylance',
103-
'ms-python.debugpy',
104-
'ms-python.vscode-python-envs',
105-
].concat(packageJson.extensionPack ? packageJson.extensionPack : []);
107+
let deps = ['ms-python.vscode-pylance', 'ms-python.debugpy'];
108+
if (isPreRelease) {
109+
deps.push('ms-python.vscode-python-envs');
110+
}
111+
packageJson.extensionPack = deps.concat(packageJson.extensionPack ? packageJson.extensionPack : []);
112+
106113
// Remove potential duplicates.
107114
packageJson.extensionPack = packageJson.extensionPack.filter(
108115
(item, index) => packageJson.extensionPack.indexOf(item) === index,

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1671,6 +1671,7 @@
16711671
"format-fix": "prettier --write 'src/**/*.ts' 'build/**/*.js' '.github/**/*.yml' gulpfile.js",
16721672
"clean": "gulp clean",
16731673
"addExtensionPackDependencies": "gulp addExtensionPackDependencies",
1674+
"addExtensionPackDependenciesPreRelease": "gulp addExtensionPackDependenciesPreRelease",
16741675
"updateBuildNumber": "gulp updateBuildNumber",
16751676
"verifyBundle": "gulp verifyBundle",
16761677
"webpack": "webpack"

0 commit comments

Comments
 (0)