Skip to content

Provide CLI verion #66

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

Merged
merged 7 commits into from
Oct 1, 2023
Merged

Provide CLI verion #66

merged 7 commits into from
Oct 1, 2023

Conversation

d4c4nf3
Copy link

@d4c4nf3 d4c4nf3 commented Jul 9, 2023

Closes #21
Refactor maven plugin module so that it only contains logic for maven plugin. Migrate code for generating reports to a separate module so it can be reused in maven/gradle plugins or CLI application.

vojislav.cuk added 4 commits July 9, 2023 17:17
extracted html report to a separate module. removed all maven related stuff from html report.
extracted csv report into separate module. removed all maven related stuff rrom csv report
extracted json report to separate module. removed all maven related stuff from json report
removed classes from maven json report after refactor
@ghost
Copy link

ghost commented Jul 9, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@jimbethancourt
Copy link
Collaborator

Hi @vojislav-cuk!
Thank you! It looks like you put quite a bit of work into this! I'm currently working on converting the Maven plugin back into a MavenReport and upgrading the version of Doxia Site Renderer and related dependencies, but I think I can work around what you've done.

The pom.xml in the new report module will need to be source/target Java 8 compatible to remain backwards compatible with Java 8 users. It still makes up probably 40% of the market at this time, and they're the users who could probably benefit from this tool the most. I'm not certain, but it's possible that the CLI version can remain at Java 17 and use Spring Boot 3.

Jim

@d4c4nf3
Copy link
Author

d4c4nf3 commented Jul 12, 2023

Great. With this refactored it should not be hard to create CLI app now.

The pom.xml in the new report module will need to be source/target Java 8 compatible

This is something I wanted to ask. OK, I will change it to use java 8.

Do you have some idea how the CLI command should look like? The name of command and parameters?

Created cli application using picocli and packaged it as executable jar
@jimbethancourt
Copy link
Collaborator

Hi @vojislav-cuk,
I apologize for not getting back to you sooner - it's looking great!
As for the name: It might be a bit cheeky, but having the command as rf would be memorable

@d4c4nf3
Copy link
Author

d4c4nf3 commented Jul 19, 2023

I created it as refirst with this usage
Usage: report [-d] [-b=] [-o=] [-p=]
[-t=] [-v=]
Generate a report
-b, --base-dir= Base directory of the project
-d, --details Show detailed report
-o, --output=
Output directory
-p, --project=
Project name
-t, --type= Report type: HTML, JSON, CSV
-v, --version=
Project version
It should not be hard to change it any way you like. I decided not to use spring boot because it looked like an overkill for one simple command. Please just confirm if you are OK with the way I packaged the executable and named the parameters. I will change command name to rf.

@d4c4nf3
Copy link
Author

d4c4nf3 commented Jul 21, 2023

@jimbethancourt I have changed the command to rf.
I also added reading project name and version from pom.xml file if those arguments are not already set.
During package stage, rf sh script is created as executable jar. Parameters of rf commands are the ones from my message above.

@d4c4nf3 d4c4nf3 marked this pull request as ready for review July 21, 2023 17:12
@jimbethancourt jimbethancourt changed the base branch from main to cli October 1, 2023 20:58
@jimbethancourt jimbethancourt merged commit d7ff11b into refactorfirst:cli Oct 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide CLI version
2 participants