ivogabe / gulp-typescript

A TypeScript compiler for gulp with incremental compilation support.
MIT License
839 stars 129 forks source link

Emit .buildinfo file #618

Open michaelaird opened 5 years ago

michaelaird commented 5 years ago

This is a first step in supporting incremental builds

michaelaird commented 5 years ago

@ivogabe I can't figure out why these tests are failing. Can you have a look?

arieldf commented 5 years ago

@ivogabe I would really like this to be merged. Anything I can assist with?

boenrobot commented 5 years ago

I would really like this to be merged as well...

From what I can see, the file "test/tsConfigIncremental/gulptask.js" is triggered for all TS versions, but since there is no tsbuildinfo in versions earlier than 3.4, the tests fail, because earlier TS versions don't just ignore the unknown option, but complain about it instead.

To fix this, one must either strip the unknown option for versions prior to 3.4, or make the test detect 3.4, and skip it if it's earlier. I'm not entirely sure how do either of those things... I'm just pointing out the cause.

For detecting version and skipping tests, I think perhaps if this line is modified to also pass in the version, the test can check it from its start and just return right there.

boenrobot commented 5 years ago

Hmm... it looks like tsbuildinfo contains full paths, which is why the paths from my PC leaked into the test baseline for this... oops. And I'm not sure what's going on with the other error, but suffice it to say the baseline should probably be adjusted to match the test.

ivogabe commented 5 years ago

I’ll try to take a look at this in the weekend.

boenrobot commented 5 years ago

BTW, I tried to actually use this, and there's a problem with it - if the tsconfig.json does not define an outFile, no buildinfo is emitted.

If you use tsc from the command line, you do get it, so this is a bug with this PR or TS as a lib.