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
Add --version tag to show the version of the jar of RepoSense #503
Comments
Removing this requirement. |
let's add another requirement, print the version in the report as well. |
For users running RepoSense using |
Printing out the commit hash will be a little bit difficult to implement. For the release version, we only need to keep a variable that stores the version of RepoSense. But for commit hash, we cannot store it. There is one way that may solve the problem, the |
I think we could get the version information pushed into the Jar manifest. 🤔 |
@yong24s But we will need it to be included in our generated report right? It should be better to let it be a variable. |
I believe you can access manifest values at runtime. 🤔
Building Jar
META-INF\MANIFEST.MF
|
Where would you proposed to keep the version variable? If its inside the source code then we have to make a new commit to update the version value every time we release. I would like to minimize trivial commits to the repository. This approach also makes it hard to track the commit hash.
Yes, something like this workflow. My suggested workflow would be:
At this point of time, I don't think our code needs to know anything about versions. |
OK, I will investigate how to access manifest values at runtime. |
Also at frontend we can just take the version and plug it in
|
A little nit, then, we are unable to have a default version for our project. |
|
I found a way to get the version of our project correctly using s.getClass().getPackage().getImplementationVersion() |
Hmm, it worked for you? I only got the installed Java version in my system I'm okay with When needed, a well documented/maintained library can be used, if it simplifies development. Just don't pick a library that is clearly an overkill. |
@yong24s I have implemented the solution. |
However, I still leave a default version number in my implementation, which is not so necessary. |
perhaps try out using |
Users may want to figure out whether the jar file they download is the correct version of RepoSense they want to use. The users cannot verify it because we do not have a 'version' tag, and the generated report do not contain such information. Let's add a -version tag to show the version of jar file of RepoSense, and include it in the generated report. The version can be passed in to RepoSense using -Pversion for both run and shadowJar. Otherwise, latest git tag will be used instead.
As, title. The users may not know the jar file they download is the correct version of RepoSensse or not and they cannot verify it.
Let's add a -version tag to show the version of jar file of RepoSense.
The text was updated successfully, but these errors were encountered: