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

Add Compact Profile Support #179

Closed
webfolderio opened this issue Aug 31, 2017 · 3 comments
Closed

Add Compact Profile Support #179

webfolderio opened this issue Aug 31, 2017 · 3 comments
Milestone

Comments

@webfolderio
Copy link
Contributor

Hi,

Is it possible to remove Full JRE dependency. Picocli use java.awt.Point which requires Full JRE.

Thanks

jdeps -P picocli-1.0.0.jar

picocli-1.0.0.jar -> C:\Java\jdk1.8.0_141\jre\lib\rt.jar (Full JRE)
   picocli (picocli-1.0.0.jar)
      -> java.awt                                           Full JRE
      -> java.io                                            compact1
      -> java.lang                                          compact1
      -> java.lang.annotation                               compact1
      -> java.lang.reflect                                  compact1
      -> java.math                                          compact1
      -> java.net                                           compact1
      -> java.nio.charset                                   compact1
      -> java.sql                                           compact2
      -> java.text                                          compact1
      -> java.util                                          compact1
      -> java.util.concurrent                               compact1
      -> java.util.regex                                    compact1
@remkop
Copy link
Owner

remkop commented Aug 31, 2017

Ok, I can see the value of doing this.

Two things:

  • TextTable#putValue is a public method in a public inner class, so the class replacing java.awt.Point also needs to be public. (Also, we may take this opportunity to name the class something clearer than Point... Position, Cell, Address, At come to mind. Other suggestions welcome...)
  • this is a breaking API change, so the next version needs to become 2.0.0 since picocli follows semantic versioning

(These are not objections, just noting them)

@remkop
Copy link
Owner

remkop commented Aug 31, 2017

I also noticed that the type converter for java.sql.Time introduces a dependency on compact2, everything else is compact1.

I wonder if it is worth using reflection to avoid a hard dependency on compact2...

Background: there is an outstanding ticket (#83) to support more built-in types. Some of the types I'm planning to support were introduced in java 7 and java 8. At the same time, I would like picocli to continue be compatible with java 5. To solve this, I plan to use reflection to implement type converters for java.time.* classes, java.nio.file.Path, etc.

So if we will be using reflection anyway, why not use reflection for anything other than compact1?
Thoughts?

@webfolderio
Copy link
Contributor Author

webfolderio commented Sep 1, 2017

I wonder if it is worth using reflection to avoid a hard dependency on compact2...

Its OK, there is no big difference between compact 1 and compact2 profile.

Here is JRE 8 size for windows platform:

  • compact1 15MB
  • compact2 20MB
  • cmpact3 23MB
  • j2re-full 54MB

So if we will be using reflection anyway, why not use reflection for anything other than compact1?

I think there is no reason to use reflection. CommandLine.java and common types (Date, Time, BigDecimal...) should depend on compact profile. If a type requires Full JRE you might place them as an extension project.

@remkop remkop added this to the 2.0.0 milestone Sep 23, 2017
@remkop remkop closed this as completed in 7905281 Oct 1, 2017
remkop added a commit that referenced this issue Oct 1, 2017
Fix #179 remove Full JRE dependency.
remkop added a commit that referenced this issue Oct 1, 2017
…pact Profile.

- Rename inner class `picocli.CommandLine.Point` to `picocli.CommandLine.Help.TextTable.Cell`
- Add javadoc, update existing javadoc
- Add to release notes with credit to [webfolderio](https://github.com/webfolderio).
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

2 participants