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

Make Picocli version providers unremovable classes #38083

Merged
merged 1 commit into from
Jan 9, 2024

Conversation

geoand
Copy link
Contributor

@geoand geoand commented Jan 8, 2024

@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@maxandersen
Copy link
Contributor

related to #38077

@quarkus-bot

This comment has been minimized.

@quarkus-bot
Copy link

quarkus-bot bot commented Jan 9, 2024

✔️ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

@@ -99,6 +101,17 @@ void picocliRunner(ApplicationIndexBuildItem applicationIndex,
additionalBean.produce(AdditionalBeanBuildItem.unremovableOf(DefaultPicocliCommandLineFactory.class));
quarkusApplicationClass.produce(new QuarkusApplicationClassBuildItem(PicocliRunner.class));
}

// Make all classes that can be instantiated by IFactory unremovable
unremovableBean.produce(UnremovableBeanBuildItem.beanTypes(CommandLine.ITypeConverter.class,
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok - so this is doing it for all instances even if not referenced by picocli config.

Just curious why you do it this way when we only have to do it for those pointed to by users annotation?

Ease of coding in quarkus or that you don't believe it will matter enough in extra memory used ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok - so this is doing it for all instances even if not referenced by picocli config.

All it does it make beans of this type unremovable - nothing more

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just curious why you do it this way when we only have to do it for those pointed to by users annotation?

This way is much much cleaner and also makes chances of copy-paste errors in the code far lower.

geoand added a commit to geoand/quarkus that referenced this pull request Jan 9, 2024
This makes the IDE warn extension authors when
they have created a build item but have not used
it.
I encountered this in quarkusio#38083
when I wrote something like:

```java
UnremovableBeanBuildItem.beanTypes(Foo.class, Bar.class)
```

in a hurry and didn't stop to consider
that the build item was never being
produced
@gsmet gsmet merged commit 37db001 into quarkusio:main Jan 9, 2024
19 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.7 - main milestone Jan 9, 2024
@quarkus-bot quarkus-bot bot added the kind/enhancement New feature or request label Jan 9, 2024
@gsmet gsmet added triage/backport? and removed kind/enhancement New feature or request labels Jan 9, 2024
@geoand geoand deleted the #38077 branch January 9, 2024 09:59
@gsmet gsmet modified the milestones: 3.7 - main, 3.6.5 Jan 9, 2024
holly-cummins pushed a commit to holly-cummins/quarkus that referenced this pull request Jul 31, 2024
This makes the IDE warn extension authors when
they have created a build item but have not used
it.
I encountered this in quarkusio#38083
when I wrote something like:

```java
UnremovableBeanBuildItem.beanTypes(Foo.class, Bar.class)
```

in a hurry and didn't stop to consider
that the build item was never being
produced
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

picocli should be able to mark its annotation dependent classes as unremovable
4 participants