Skip to content

Better expose entry points for pmd-cli integration#52

Merged
jsotuyod merged 6 commits into
masterfrom
cli-compat
Aug 11, 2022
Merged

Better expose entry points for pmd-cli integration#52
jsotuyod merged 6 commits into
masterfrom
cli-compat

Conversation

@jsotuyod

@jsotuyod jsotuyod commented Aug 10, 2022

Copy link
Copy Markdown
Member
  • Introduce DesignerVersion as a standalone equivalent of PMDVersion. By having access to this POJO outside of Designer it's possible to for pmd-cli to show the designer version (through $ pmd designer --version) without requiring JavaFX to be available.
  • Expose DesignerStarter.startGui so that pmd-cli can invoke it. Have it return the exit code vs performing a System.exit on it's own.
  • Deprecate all internal usages of JCommander, and mark the main as an internal (development) utility.
  • Have development mode enabled not only through -v and --verbose, but also through -D and --debug for compatibility with all other pmd commands supported in pmd-cli.

Comment thread src/main/java/net/sourceforge/pmd/util/fxdesigner/DesignerStarter.java Outdated

@oowekyala oowekyala left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes! I'll leave you merge whenever most convenient for your work on the CLI. I'll merge #51 to make that easier.

 - This allows consumers (ie: pmd-cli) to access the Designer version without requiring JavaFX
 - All other commands allow for --debug and -D on top of --verbose and -v
 - The JCommander usage is deprecated
 - We update debug params for compatibility with all PMD commands
 - We allow to call startGui directly
@jsotuyod jsotuyod merged commit c3ec06c into master Aug 11, 2022
@jsotuyod jsotuyod deleted the cli-compat branch August 11, 2022 17:35
@adangel adangel added this to the next milestone Aug 24, 2022
@adangel

adangel commented Aug 24, 2022

Copy link
Copy Markdown
Member

This landed in the master branch - was with intended? The work in pmd/pmd#4059 is for pmd7...

The only incompatibility seems to be net.sourceforge.pmd.util.fxdesigner.Designer.getCurrentVersion() (and getPmdCoreMinVersion()) - this doesn't exist anymore. Not sure if it's worth to keep it deprecated and forward to net.sourceforge.pmd.util.fxdesigner.DesignerVersion.

Wdyt?

@jsotuyod

Copy link
Copy Markdown
Member Author

Yes, this was intended. The changes are meant to be harmless, and included deprecations / changes to flags that would leave time to people to adapt to, and by minimizing differences between master and pmd7 merge should be easier down the line. Having lost getCurrentVersion() / getPmdCoreMinVersion() was a mistake. I should have kept them as @Deprecated, delegating to DesignerVersion. Thanks for catching that.

jsotuyod added a commit that referenced this pull request Aug 24, 2022
adangel added a commit that referenced this pull request Aug 24, 2022
Fix breaking change introduced to master in #52 #55
jsotuyod added a commit to jsotuyod/pmd that referenced this pull request Oct 15, 2022
 - this depends on pmd/pmd-designer#52 being merged
    into master and then master merged onto compat-7.0
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.

3 participants