Skip to content

Commit c9f62f3

Browse files
authored
Add folds to travis log (#10269)
1 parent 688e9bc commit c9f62f3

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed

Gulpfile.ts

Lines changed: 3 additions & 0 deletions
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -35,6 +35,7 @@ import merge2 = require("merge2");
35
import intoStream = require("into-stream");
35
import intoStream = require("into-stream");
36
import * as os from "os";
36
import * as os from "os";
37
import Linter = require("tslint");
37
import Linter = require("tslint");
38+
import fold = require("travis-fold");
38
const gulp = helpMaker(originalGulp);
39
const gulp = helpMaker(originalGulp);
39
const mochaParallel = require("./scripts/mocha-parallel.js");
40
const mochaParallel = require("./scripts/mocha-parallel.js");
40
const {runTestsInParallel} = mochaParallel;
41
const {runTestsInParallel} = mochaParallel;
@@ -964,6 +965,7 @@ gulp.task("lint", "Runs tslint on the compiler sources. Optional arguments are:
964
const fileMatcher = RegExp(cmdLineOptions["files"]);
965
const fileMatcher = RegExp(cmdLineOptions["files"]);
965
const lintOptions = getLinterOptions();
966
const lintOptions = getLinterOptions();
966
let failed = 0;
967
let failed = 0;
968+
if (fold.isTravis()) console.log(fold.start("lint"));
967
return gulp.src(lintTargets)
969
return gulp.src(lintTargets)
968
.pipe(insert.transform((contents, file) => {
970
.pipe(insert.transform((contents, file) => {
969
if (!fileMatcher.test(file.path)) return contents;
971
if (!fileMatcher.test(file.path)) return contents;
@@ -975,6 +977,7 @@ gulp.task("lint", "Runs tslint on the compiler sources. Optional arguments are:
975
return contents; // TODO (weswig): Automatically apply fixes? :3
977
return contents; // TODO (weswig): Automatically apply fixes? :3
976
}))
978
}))
977
.on("end", () => {
979
.on("end", () => {
980+
if (fold.isTravis()) console.log(fold.end("lint"));
978
if (failed > 0) {
981
if (failed > 0) {
979
console.error("Linter errors.");
982
console.error("Linter errors.");
980
process.exit(1);
983
process.exit(1);

Jakefile.js

Lines changed: 25 additions & 2 deletions
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -5,6 +5,7 @@ var os = require("os");
5
var path = require("path");
5
var path = require("path");
6
var child_process = require("child_process");
6
var child_process = require("child_process");
7
var Linter = require("tslint");
7
var Linter = require("tslint");
8+
var fold = require("travis-fold");
8
var runTestsInParallel = require("./scripts/mocha-parallel").runTestsInParallel;
9
var runTestsInParallel = require("./scripts/mocha-parallel").runTestsInParallel;
9

10

10
// Variables
11
// Variables
@@ -560,9 +561,19 @@ compileFile(
560
desc("Builds language service server library");
561
desc("Builds language service server library");
561
task("lssl", [tsserverLibraryFile, tsserverLibraryDefinitionFile]);
562
task("lssl", [tsserverLibraryFile, tsserverLibraryDefinitionFile]);
562

563

564+
desc("Emit the start of the build fold");
565+
task("build-fold-start", [] , function() {
566+
if (fold.isTravis()) console.log(fold.start("build"));
567+
});
568+
569+
desc("Emit the end of the build fold");
570+
task("build-fold-end", [] , function() {
571+
if (fold.isTravis()) console.log(fold.end("build"));
572+
});
573+
563
// Local target to build the compiler and services
574
// Local target to build the compiler and services
564
desc("Builds the full compiler and services");
575
desc("Builds the full compiler and services");
565-
task("local", ["generate-diagnostics", "lib", tscFile, servicesFile, nodeDefinitionsFile, serverFile, builtGeneratedDiagnosticMessagesJSON, "lssl"]);
576+
task("local", ["build-fold-start", "generate-diagnostics", "lib", tscFile, servicesFile, nodeDefinitionsFile, serverFile, builtGeneratedDiagnosticMessagesJSON, "lssl", "build-fold-end"]);
566

577

567
// Local target to build only tsc.js
578
// Local target to build only tsc.js
568
desc("Builds only the compiler");
579
desc("Builds only the compiler");
@@ -998,12 +1009,22 @@ var tslintRulesOutFiles = tslintRules.map(function(p) {
998
return path.join(builtLocalDirectory, "tslint", p + ".js");
1009
return path.join(builtLocalDirectory, "tslint", p + ".js");
999
});
1010
});
1000
desc("Compiles tslint rules to js");
1011
desc("Compiles tslint rules to js");
1001-
task("build-rules", tslintRulesOutFiles);
1012+
task("build-rules", ["build-rules-start"].concat(tslintRulesOutFiles).concat(["build-rules-end"]));
1002
tslintRulesFiles.forEach(function(ruleFile, i) {
1013
tslintRulesFiles.forEach(function(ruleFile, i) {
1003
compileFile(tslintRulesOutFiles[i], [ruleFile], [ruleFile], [], /*useBuiltCompiler*/ false,
1014
compileFile(tslintRulesOutFiles[i], [ruleFile], [ruleFile], [], /*useBuiltCompiler*/ false,
1004
{ noOutFile: true, generateDeclarations: false, outDir: path.join(builtLocalDirectory, "tslint")});
1015
{ noOutFile: true, generateDeclarations: false, outDir: path.join(builtLocalDirectory, "tslint")});
1005
});
1016
});
1006

1017

1018+
desc("Emit the start of the build-rules fold");
1019+
task("build-rules-start", [] , function() {
1020+
if (fold.isTravis()) console.log(fold.start("build-rules"));
1021+
});
1022+
1023+
desc("Emit the end of the build-rules fold");
1024+
task("build-rules-end", [] , function() {
1025+
if (fold.isTravis()) console.log(fold.end("build-rules"));
1026+
});
1027+
1007
function getLinterOptions() {
1028
function getLinterOptions() {
1008
return {
1029
return {
1009
configuration: require("./tslint.json"),
1030
configuration: require("./tslint.json"),
@@ -1047,6 +1068,7 @@ var lintTargets = compilerSources
1047

1068

1048
desc("Runs tslint on the compiler sources. Optional arguments are: f[iles]=regex");
1069
desc("Runs tslint on the compiler sources. Optional arguments are: f[iles]=regex");
1049
task("lint", ["build-rules"], function() {
1070
task("lint", ["build-rules"], function() {
1071+
if (fold.isTravis()) console.log(fold.start("lint"));
1050
var lintOptions = getLinterOptions();
1072
var lintOptions = getLinterOptions();
1051
var failed = 0;
1073
var failed = 0;
1052
var fileMatcher = RegExp(process.env.f || process.env.file || process.env.files || "");
1074
var fileMatcher = RegExp(process.env.f || process.env.file || process.env.files || "");
@@ -1062,6 +1084,7 @@ task("lint", ["build-rules"], function() {
1062
done[target] = true;
1084
done[target] = true;
1063
}
1085
}
1064
}
1086
}
1087+
if (fold.isTravis()) console.log(fold.end("lint"));
1065
if (failed > 0) {
1088
if (failed > 0) {
1066
fail('Linter errors.', failed);
1089
fail('Linter errors.', failed);
1067
}
1090
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberOriginal file lineDiff line numberDiff line change
@@ -30,8 +30,8 @@
30
},
30
},
31
"devDependencies": {
31
"devDependencies": {
32
"@types/browserify": "latest",
32
"@types/browserify": "latest",
33-
"@types/convert-source-map": "latest",
34
"@types/chai": "latest",
33
"@types/chai": "latest",
34+
"@types/convert-source-map": "latest",
35
"@types/del": "latest",
35
"@types/del": "latest",
36
"@types/glob": "latest",
36
"@types/glob": "latest",
37
"@types/gulp": "latest",
37
"@types/gulp": "latest",
@@ -72,6 +72,7 @@
72
"run-sequence": "latest",
72
"run-sequence": "latest",
73
"sorcery": "latest",
73
"sorcery": "latest",
74
"through2": "latest",
74
"through2": "latest",
75+
"travis-fold": "latest",
75
"ts-node": "latest",
76
"ts-node": "latest",
76
"tslint": "next",
77
"tslint": "next",
77
"typescript": "next"
78
"typescript": "next"

0 commit comments

Comments
 (0)