typescript-generator
typescript-generator copied to clipboard
Build should fail if a class cannot be found
I am using typescript generator as part of my build process using a maven plugin.
When a class cannot be found (e.g. because of a typo in the type name in pom.xml) then an error is printed, but the build continues. However this will naturally result in an incomplete output file which will cause some confusion when that incomplete file is used elsewhere.
It would make it easier to detect such an error early on by failing the build process and thus alerting the user.
The ClassNotFoundException
is currently caught, printed and then ignored here: https://github.com/vojtechhabarta/typescript-generator/blob/63ee545173a1bb62ace5155a46523287226d75e7/typescript-generator-core/src/main/java/cz/habarta/typescript/generator/Input.java#L176
@yankee42 you are right, this is not optimal. This behavior (continuing after error) was added as part of solving class loading problem (#142). I will consider to changing it, maybe it is not needed anymore.
Released in v3.0.1157.