Skip to content

Add gulp build tasks for cancellationToken and typingsInstaller #11071

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions Gulpfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,35 @@ gulp.task(servicesFile, false, ["lib", "generate-diagnostics"], () => {
]).pipe(gulp.dest(builtLocalDirectory));
});

// cancellationToken.js
const cancellationTokenJs = path.join(builtLocalDirectory, "cancellationToken.js");
gulp.task(cancellationTokenJs, false, [servicesFile], () => {
const cancellationTokenProject = tsc.createProject("src/server/cancellationToken/tsconfig.json", getCompilerSettings({}, /*useBuiltCompiler*/true));
return cancellationTokenProject.src()
.pipe(newer(cancellationTokenJs))
.pipe(sourcemaps.init())
.pipe(tsc(cancellationTokenProject))
.pipe(prependCopyright())
.pipe(sourcemaps.write("."))
.pipe(gulp.dest(builtLocalDirectory));
});

// typingsInstallerFile.js
const typingsInstallerJs = path.join(builtLocalDirectory, "typingsInstaller.js");
gulp.task(typingsInstallerJs, false, [servicesFile], () => {
const cancellationTokenProject = tsc.createProject("src/server/typingsInstaller/tsconfig.json", getCompilerSettings({}, /*useBuiltCompiler*/true));
return cancellationTokenProject.src()
.pipe(newer(typingsInstallerJs))
.pipe(sourcemaps.init())
.pipe(tsc(cancellationTokenProject))
.pipe(prependCopyright())
.pipe(sourcemaps.write("."))
.pipe(gulp.dest(builtLocalDirectory));
});

const serverFile = path.join(builtLocalDirectory, "tsserver.js");

gulp.task(serverFile, false, [servicesFile], () => {
gulp.task(serverFile, false, [servicesFile, typingsInstallerJs, cancellationTokenJs], () => {
const serverProject = tsc.createProject("src/server/tsconfig.json", getCompilerSettings({}, /*useBuiltCompiler*/true));
return serverProject.src()
.pipe(newer(serverFile))
Expand Down Expand Up @@ -452,7 +478,6 @@ gulp.task("lssl", "Builds language service server library", [tsserverLibraryFile
gulp.task("local", "Builds the full compiler and services", [builtLocalCompiler, servicesFile, serverFile, builtGeneratedDiagnosticMessagesJSON, tsserverLibraryFile]);
gulp.task("tsc", "Builds only the compiler", [builtLocalCompiler]);


// Generate Markdown spec
const word2mdJs = path.join(scriptsDirectory, "word2md.js");
const word2mdTs = path.join(scriptsDirectory, "word2md.ts");
Expand Down Expand Up @@ -491,7 +516,7 @@ gulp.task("useDebugMode", false, [], (done) => { useDebugMode = true; done(); })
gulp.task("dontUseDebugMode", false, [], (done) => { useDebugMode = false; done(); });

gulp.task("VerifyLKG", false, [], () => {
const expectedFiles = [builtLocalCompiler, servicesFile, serverFile, nodePackageFile, nodeDefinitionsFile, standaloneDefinitionsFile, tsserverLibraryFile, tsserverLibraryDefinitionFile].concat(libraryTargets);
const expectedFiles = [builtLocalCompiler, servicesFile, serverFile, nodePackageFile, nodeDefinitionsFile, standaloneDefinitionsFile, tsserverLibraryFile, tsserverLibraryDefinitionFile, typingsInstallerJs, cancellationTokenJs].concat(libraryTargets);
const missingFiles = expectedFiles.filter(function(f) {
return !fs.existsSync(f);
});
Expand Down
3 changes: 2 additions & 1 deletion Jakefile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ var compilerDirectory = "src/compiler/";
var servicesDirectory = "src/services/";
var serverDirectory = "src/server/";
var typingsInstallerDirectory = "src/server/typingsInstaller";
var cancellationTokenDirectory = "src/server/cancellationToken";
var harnessDirectory = "src/harness/";
var libraryDirectory = "src/lib/";
var scriptsDirectory = "scripts/";
Expand Down Expand Up @@ -143,7 +144,7 @@ var serverCoreSources = [
var cancellationTokenSources = [
"cancellationToken.ts"
].map(function (f) {
return path.join(serverDirectory, f);
return path.join(cancellationTokenDirectory, f);
});

var typingsInstallerSources = [
Expand Down
19 changes: 19 additions & 0 deletions src/server/cancellationToken/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"noImplicitAny": true,
"noImplicitThis": true,
"removeComments": true,
"preserveConstEnums": true,
"pretty": true,
"outDir": "../../../built/local",
"module": "commonjs",
"sourceMap": true,
"stripInternal": true,
"types": [
"node"
]
},
"files": [
"cancellationToken.ts"
]
}
3 changes: 1 addition & 2 deletions src/server/typingsInstaller/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
"removeComments": true,
"preserveConstEnums": true,
"pretty": true,
"out": "../../../built/local/typingsInstaller.js",
"out": "../../built/local/typingsInstaller.js",
"sourceMap": true,
"stripInternal": true,
"types": [
"node"
]
},
"files": [
"../../services/services.ts",
"../types.d.ts",
"typingsInstaller.ts",
"nodeTypingsInstaller.ts"
Expand Down