diff --git a/Gulpfile.ts b/Gulpfile.ts index e34bc2b5c26..bc5eb3a2d38 100644 --- a/Gulpfile.ts +++ b/Gulpfile.ts @@ -585,7 +585,7 @@ gulp.task(specMd, /*help*/ false, [word2mdJs], (done) => { gulp.task("generate-spec", "Generates a Markdown version of the Language Specification", [specMd]); -gulp.task("clean", "Cleans the compiler output, declare files, and tests", [], () => { +gulp.task("clean", "Cleans the compiler output, declare files, and tests", ["clean:private-packages"], () => { return del([builtDirectory]); }); @@ -611,7 +611,7 @@ gulp.task("LKG", "Makes a new LKG out of the built js files", ["clean", "dontUse return runSequence("LKGInternal", "VerifyLKG"); }); -function compilePrivatePackage(packageName) { +function compilePrivatePackage(packageName: string) { const project = tsc.createProject(`scripts/${packageName}/tsconfig.json`, getCompilerSettings({}, /*useBuiltCompiler*/ false)); return project.src() .pipe(sourcemaps.init()) @@ -621,6 +621,10 @@ function compilePrivatePackage(packageName) { .pipe(gulp.dest(`scripts/${packageName}/dist`)); } +function cleanPrivatePackage(packageName: string) { + return del([`scripts/${packageName}/dist`]); +} + gulp.task("typemock", () => compilePrivatePackage("typemock")); gulp.task("vfs-core", () => compilePrivatePackage("vfs-core")); gulp.task("vfs-errors", () => compilePrivatePackage("vfs-errors")); @@ -629,6 +633,14 @@ gulp.task("vfs", ["vfs-core", "vfs-errors", "vfs-path", "typemock"], () => compi gulp.task("harness-core", ["vfs-core"], () => compilePrivatePackage("harness-core")); gulp.task("private-packages", ["typemock", "vfs", "harness-core"]); +gulp.task("clean:typemock", () => cleanPrivatePackage("typemock")); +gulp.task("clean:vfs-core", () => cleanPrivatePackage("vfs-core")); +gulp.task("clean:vfs-errors", () => cleanPrivatePackage("vfs-errors")); +gulp.task("clean:vfs-path", ["clean:vfs-core", "clean:vfs-errors"], () => cleanPrivatePackage("vfs-path")); +gulp.task("clean:vfs", ["clean:vfs-core", "clean:vfs-errors", "clean:vfs-path", "clean:typemock"], () => cleanPrivatePackage("vfs")); +gulp.task("clean:harness-core", ["clean:vfs-core"], () => cleanPrivatePackage("harness-core")); +gulp.task("clean:private-packages", ["clean:typemock", "clean:vfs", "clean:harness-core"]); + // Task to build the tests infrastructure using the built compiler const run = path.join(builtLocalDirectory, "run.js"); gulp.task(run, /*help*/ false, [servicesFile, tsserverLibraryFile, "private-packages"], () => { diff --git a/Jakefile.js b/Jakefile.js index ddae2021484..7d0e28b80e8 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -738,7 +738,7 @@ task("default", ["local"]); // Cleans the built directory desc("Cleans the compiler output, declare files, and tests"); -task("clean", function () { +task("clean", ["clean-private-packages"], function () { jake.rmRf(builtDirectory); }); @@ -804,7 +804,7 @@ task("LKG", ["clean", "release", "local"].concat(libraryTargets), function () { directory(builtLocalDirectory); function privatePackage(packageName, prereqs) { - task(packageName, prereqs, function () { + task(packageName, prereqs || [], function () { var startCompileTime = mark(); execCompiler(/*useBuiltCompiler*/ false, ["-p", `scripts/${packageName}/tsconfig.json`], function (error) { if (error) { @@ -818,6 +818,10 @@ function privatePackage(packageName, prereqs) { }, { async: true }); } +function cleanPrivatePackage(packageName) { + jake.rmRf(`scripts/${packageName}/dist`); +} + privatePackage("typemock"); privatePackage("vfs-core"); privatePackage("vfs-errors"); @@ -826,6 +830,14 @@ privatePackage("vfs", ["vfs-path", "typemock"]); privatePackage("harness-core", ["vfs-core"]); task("private-packages", ["typemock", "vfs", "harness-core"]); +task("clean-typemock", () => cleanPrivatePackage("typemock")); +task("clean-vfs-core", () => cleanPrivatePackage("vfs-core")); +task("clean-vfs-errors", () => cleanPrivatePackage("vfs-errors")); +task("clean-vfs-path", ["clean-vfs-core", "clean-vfs-errors"], () => cleanPrivatePackage("vfs-path")); +task("clean-vfs", ["clean-vfs-path", "clean-typemock"], () => cleanPrivatePackage("vfs")); +task("clean-harness-core", ["clean-vfs-core"], () => cleanPrivatePackage("harness-core")); +task("clean-private-packages", ["clean-typemock", "clean-vfs", "clean-harness-core"]); + // Task to build the tests infrastructure using the built compiler var run = path.join(builtLocalDirectory, "run.js"); compileFile( diff --git a/package.json b/package.json index cf109417b9f..b3bdec3be5d 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,8 @@ "@types/source-map-support": "latest", "@types/through2": "latest", "@types/xml2js": "^0.4.0", + "@typescript/vfs-core": "file:scripts/vfs-core", + "@typescript/vfs-errors": "file:scripts/vfs-errors", "@typescript/vfs-path": "file:scripts/vfs-path", "@typescript/vfs": "file:scripts/vfs", "@typescript/harness-core": "file:scripts/harness-core",