beryx / badass-runtime-plugin

Create a custom runtime image of your non-modular application
https://badass-runtime-plugin.beryx.org
Apache License 2.0
161 stars 21 forks source link

Make `TargetPlatform` a managed type #140

Closed fourlastor closed 1 year ago

fourlastor commented 1 year ago

This PR converts TargetPlatform to use managed properties.

In short, this means that TargetPlatform is not instantiated directly in the codebase, but by Gradle (which fill in the various properties for us)

In addition, I changed the holding type for RuntimePluginExtension.targetPlatforms to NamedDomainObjectContainer which is basically the default "map like" container for gradle plugins.

fourlastor commented 1 year ago

After testing it, I had to change a few things:

  1. abstract class is not good enough to be able to define abstract properties, it would need to be an interface (it fails when trying to run the task). I reverted the changes here and made it back as a concrete class which is instantiated
  2. TargetPlatform is not Serializable anymore (as Property appears to be not serializable), I removed the interface implementation and used the @Nested annotation for the tasks input, which in short looks at properties annotated with @Input and similar to determine the task inputs/outputs
hakanai commented 1 year ago

If you're fine with the current state, I think we're good to go?

fourlastor commented 1 year ago

Yep, good to go for me 👍🏻