typescript-generator icon indicating copy to clipboard operation
typescript-generator copied to clipboard

Show a Warning Message without Build Fail

Open mouldiOuni opened this issue 4 years ago • 3 comments

Hello,

I have a problem and i don't really know if it is a bug and how can i pass it. Actually when i try to build my project, if it finds two classes have the same name, the entire build process is failed,

is there a way so it can show a Warning Message telling that the generating of the TypeScript failed and continue the build without Fail, and then i can ignore that message or just use CustomNameMapping. so my basic problem, how to make the plugin fail without affecting the build process.

Thank you so much.

mouldiOuni avatar Aug 26 '19 10:08 mouldiOuni

You can use customTypeNaming parameter (not CustomNameMapping) to specify unique TypeScript names. You can also try customTypeNamingFunction if you have many conflicting names with the same package/name pattern.

However it is not possible ignore problems with conflicting names and just continue with some warning because it would generate invalid TypeScript file.

vojtechhabarta avatar Aug 27 '19 08:08 vojtechhabarta

Yeah i use the parameters that you mentioned, but what i wanted to Say is that when there is a problem like name conflict , the plugin stop the generating of TypeScript (no generating at all ) but it keep the build process without fail. so when i run mvn clean install and there are a problem the plugin stops working but the build continue but without generating the Type Script file.

mouldiOuni avatar Aug 27 '19 09:08 mouldiOuni

Are you using Maven or Gradle?

In Maven some core plugins (maven-compiler-plugin, maven-clean-plugin, maven-javadoc-plugin) have failOnError parameter with default true. Maybe typescript-generator could also use this convention.

What about Gradle? Maybe there is no need to add anything because people just use --continue parameter?

vojtechhabarta avatar Sep 19 '19 10:09 vojtechhabarta