Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run google-java-format after project generation #26

Closed
sivaprasadreddy opened this issue Mar 5, 2021 · 2 comments
Closed

Run google-java-format after project generation #26

sivaprasadreddy opened this issue Mar 5, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@sivaprasadreddy
Copy link
Owner

Formatting the templates as per google java format manually is a painful process especially when rendering something conditionally. So, a better approach could be running google java format goal after project code generation depending on selected build tool.

@sivaprasadreddy
Copy link
Owner Author

More info to get started:

To get an overview on how yeoman generator works see https://www.sivalabs.in/2020/01/creating-yeoman-based-springboot-generator/

We have already configured https://github.com/diffplug/spotless/tree/main/plugin-maven#google-java-format plugin for Maven and https://github.com/sherter/google-java-format-gradle-plugin for Gradle.

We need to run ./mvnw spotless:apply or ./gradlew googleJavaFormat commands during install or end lifecycle callbacks in server and controller generators.

We can use Shelljs (https://www.npmjs.com/package/shelljs) to run these commands.

@matheusemm
Copy link
Contributor

I'll work on it. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants