(output: string)
| 81 | * Makes Xcode logs pretty as xcpretty :) |
| 82 | */ |
| 83 | export function formatXcodeBuildOutput(output: string): string { |
| 84 | return output |
| 85 | .replace(/^(\/.*)(:\d+:\d+): (error|warning|note)(:.*)$/gm, (_, p1, p2, p3, p4) => { |
| 86 | if (p3 === 'note') { |
| 87 | return gray.bold(p3) + white.bold(p4); |
| 88 | } |
| 89 | const relativePath = path.relative(process.cwd(), p1); |
| 90 | const logColor = p3 === 'error' ? red.bold : yellow.bold; |
| 91 | |
| 92 | return cyan.bold(relativePath + p2) + ' ' + logColor(p3 + p4); |
| 93 | }) |
| 94 | .replace(/^(In file included from )(\/[^\n]+)(:\d+:[^\n]*)$/gm, (_, p1, p2, p3) => { |
| 95 | const relativePath = path.relative(process.cwd(), p2); |
| 96 | return gray.italic(p1 + relativePath + p3); |
| 97 | }) |
| 98 | .replace(/\s\^\n(\s[^\n]+)?/g, green.bold('$&\n')) |
| 99 | .replace(/\*\* BUILD FAILED \*\*/, red.bold('$&')); |
| 100 | } |
no test coverage detected
searching dependent graphs…