diff --git a/Gulpfile.js b/Gulpfile.js index 9123207fbdc8d..a880d46cfb425 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -567,23 +567,6 @@ task("baseline-accept").description = "Makes the most recent test results the ne task("baseline-accept-rwc", () => baselineAccept(localRwcBaseline, refRwcBaseline)); task("baseline-accept-rwc").description = "Makes the most recent rwc test results the new baseline, overwriting the old baseline"; -// TODO(jakebailey): figure out what tsc-instrumented and such are for and what do to with them. - -const buildLoggedIO = () => buildProject("src/loggedIO/tsconfig-tsc-instrumented.json"); -const cleanLoggedIO = () => del("built/local/loggedIO.js"); -cleanTasks.push(cleanLoggedIO); - -const buildInstrumenter = () => buildProject("src/instrumenter"); -const cleanInstrumenter = () => cleanProject("src/instrumenter"); -cleanTasks.push(cleanInstrumenter); - -const tscInstrumented = () => exec(process.execPath, ["built/local/instrumenter.js", "record", cmdLineOptions.tests || "iocapture", "built/local/tsc.js"]); -task("tsc-instrumented", series(lkgPreBuild, parallel(localize, buildTsc, buildServer, buildServices, buildLssl, buildLoggedIO, buildInstrumenter), tscInstrumented)); -task("tsc-instrumented").description = "Builds an instrumented tsc.js"; -task("tsc-instrumented").flags = { - "-t --tests=": "The test to run." -}; - // TODO(rbuckton): Determine if we still need this task. Depending on a relative // path here seems like a bad idea. const updateSublime = () => src(["built/local/tsserver.js", "built/local/tsserver.js.map"]) diff --git a/src/instrumenter/instrumenter.ts b/src/instrumenter/instrumenter.ts deleted file mode 100644 index 641d1734561e4..0000000000000 --- a/src/instrumenter/instrumenter.ts +++ /dev/null @@ -1,43 +0,0 @@ -import * as fs from "fs"; -import * as path from "path"; - -function instrumentForRecording(fn: string, tscPath: string) { - instrument(tscPath, ` -ts.sys = Playback.wrapSystem(ts.sys); -ts.sys.startRecord("${ fn }");`, `ts.sys.endRecord();`); -} - -function instrumentForReplay(logFilename: string, tscPath: string) { - instrument(tscPath, ` -ts.sys = Playback.wrapSystem(ts.sys); -ts.sys.startReplay("${ logFilename }");`); -} - -function instrument(tscPath: string, prepareCode: string, cleanupCode = "") { - const bak = `${tscPath}.bak`; - const filename = fs.existsSync(bak) ? bak : tscPath; - const tscContent = fs.readFileSync(filename, "utf-8"); - fs.writeFileSync(bak, tscContent); - const loggerContent = fs.readFileSync(path.resolve(path.dirname(tscPath) + "/loggedIO.js"), "utf-8"); - const invocationLine = "ts.executeCommandLine(ts.sys, ts.noop, ts.sys.args);"; - const index1 = tscContent.indexOf(invocationLine); - if (index1 < 0) { - throw new Error(`Could not find ${invocationLine}`); - } - const index2 = index1 + invocationLine.length; - const newContent = tscContent.substr(0, index1) + loggerContent + prepareCode + invocationLine + cleanupCode + tscContent.substr(index2) + "\r\n"; - fs.writeFileSync(tscPath, newContent); -} - -const isJson = (arg: string) => arg.indexOf(".json") > 0; - -const record = process.argv.indexOf("record"); -const tscPath = process.argv[process.argv.length - 1]; -if (record >= 0) { - console.log(`Instrumenting ${tscPath} for recording`); - instrumentForRecording(process.argv[record + 1], tscPath); -} -else if (process.argv.some(isJson)) { - const filename = process.argv.filter(isJson)[0]; - instrumentForReplay(filename, tscPath); -} diff --git a/src/instrumenter/tsconfig.json b/src/instrumenter/tsconfig.json deleted file mode 100644 index b20d49e47ce33..0000000000000 --- a/src/instrumenter/tsconfig.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "target": "es5", - "lib": [ - "es6", - "dom", - "scripthost" - ], - "outDir": "../../built/local/instrumenter" - }, - "files": [ - "instrumenter.ts" - ] -} diff --git a/src/loggedIO/tsconfig-tsc-instrumented.json b/src/loggedIO/tsconfig-tsc-instrumented.json deleted file mode 100644 index 65159c293a3aa..0000000000000 --- a/src/loggedIO/tsconfig-tsc-instrumented.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - // TODO: ??? - "extends": "../tsconfig-base", - "compilerOptions": { - "outDir": "../../built/local/loggedIO", - "types": [ - "node", "mocha", "chai" - ], - "lib": [ - "es6", - "scripthost" - ] - }, - "references": [ - { "path": "../compiler" }, - { "path": "../services" }, - { "path": "../jsTyping" }, - { "path": "../server" }, - { "path": "../typingsInstallerCore" }, - { "path": "../harness" }, - ], - - "files": [ - "loggedIO.ts" - ] -}