Vsix build task for langpacks (#15489)

* added refreshlangpack command

* added beginning update-localization yml file, also changed langpack location in RLE

* added regex tester

* moved xlf files into new folder structure

* small change to update-localization

* added yaml script for gulp refresh

* added missing dash.

* added better update-localization yml file

* remove update-localization as its not necessary

* added small changes to langpack-compile

* remove upload sourcemaps and write version information

* added more languages

* added vsce packaging

* added automatic langpack handling

* added built locFunc

* fixed refresh-langpack-extension

* working langpack vsix generator made

* added langpacks to files in copyArtifacts and product-build-linux

* changed command to package-langpacks

* removed unnecessary language flags.

* invalid ADS extensions filter explained

* Fix for regex

* removed unnecessary fields to change, and removed langpack-compile

* added doc comments.

* moved xlf files back to old place.

* WIP translation redirect

* isolated vsix build task

* fixed spaces in locFunc.ts
This commit is contained in:
Alex Ma
2021-05-20 20:03:25 -07:00
committed by GitHub
parent a5db46b961
commit 82e0ede921
6 changed files with 140 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ const es = require('event-stream');
const filter = require('gulp-filter');
const path = require('path');
const ext = require('./lib/extensions');
const loc = require('./lib/locFunc');
const task = require('./lib/task');
const glob = require('glob');
const vsce = require('vsce');
@@ -115,6 +116,31 @@ gulp.task('package-external-extensions', task.series(
})
));
gulp.task('package-langpacks', task.series(
task.define('bundle-external-langpack-build', () => loc.packageLangpacksStream().pipe(gulp.dest('.build/external'))),
task.define('create-external-langpack-vsix-build', () => {
const vsixes = glob.sync('.build/external/langpacks/*/package.json').map(manifestPath => {
const extensionPath = path.dirname(path.join(root, manifestPath));
const extensionName = path.basename(extensionPath);
return { name: extensionName, path: extensionPath };
}).map(element => {
const pkgJson = require(path.join(element.path, 'package.json'));
const vsixDirectory = path.join(root, '.build', 'langpacks');
mkdirp.sync(vsixDirectory);
const packagePath = path.join(vsixDirectory, `${pkgJson.name}-${pkgJson.version}.vsix`);
console.info('Creating vsix for ' + element.path + ' result:' + packagePath);
return vsce.createVSIX({
cwd: element.path,
packagePath: packagePath,
useYarn: true
});
});
return Promise.all(vsixes);
})
));
gulp.task('package-rebuild-extensions', task.series(
task.define('clean-rebuild-extensions', () => ext.cleanRebuildExtensions('.build/extensions')),
task.define('rebuild-extensions-build', () => ext.packageRebuildExtensionsStream().pipe(gulp.dest('.build'))),