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

Support generating simple Java class #47

Closed
analytically opened this issue Feb 6, 2015 · 8 comments
Closed

Support generating simple Java class #47

analytically opened this issue Feb 6, 2015 · 8 comments

Comments

@analytically
Copy link

It'd be great if there would be a way to generate a simple Java class containing the build information.

@eungjun-yi
Copy link

+1.

Or I want to know any Java-way to get the values from the Scala class generated by sbt-buildinfo.

@eungjun-yi
Copy link

Oops, It seems be already generating a Java class. I can get the values by Java code such as hello.BuildInfo.version();

@peter-fu
Copy link

@analytically Do you mean a Java source code or a compiled Java class?

Currently sbt-buildinfo (version 0.5.0 as the time writing) doesn't generate Java source code containing the build information. It generates Scala source code only, which will be compiled into some Java class in the compile stage and can be used in all Java/Scala code.

As noted in https://github.com/sbt/sbt-buildinfo/blob/master/notes/0.5.0.markdown, it is possible to enhance sbt-buildinfo and make it generate Java source code by providing a JavaClassRenderer, but I don't see use case for it yet. Would be great if you can provide some.

@axos88
Copy link
Contributor

axos88 commented Jan 6, 2017

See PR: #98. All you need to do is write your own renderer.

@analytically
Copy link
Author

analytically commented Jan 6, 2017

It allows for sbt to be used for Java projects if it comes built-in :-).

@axos88
Copy link
Contributor

axos88 commented Jan 6, 2017

Awesome. I don't think anybody prevents you from creating a PR with the renderer ;)

@arixmkii
Copy link
Contributor

I created PR #167 which addresses this issue.

@SethTisue
Copy link
Member

looks like this was fixed a while back by #167

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants