Closed serras closed 2 years ago
In addition to your comments, I've added an error for those cases in which we detect that a non-data, non-value class has a @CopyExtensions
annotation. That way we won't deceive users who may expect those to be generated.
I'm marking this as draft because I had another idea. Instead of simply generateAll
vs. @CopyExtensions
, my idea is to offer a generate
option with three options:
all
, the default, which generates the copy
for every class,annotated
, which only generates those with @CopyExtensions
,packages:pk1:pk2:...
, which generates for every class in those packages.That way you can state in your build file "I want copy
for all my domain classes in this package", instead of marking each of them by hand. What do you think, @pablisco?
I'm marking this as draft because I had another idea. Instead of simply
generateAll
vs.@CopyExtensions
, my idea is to offer agenerate
option with three options:
all
, the default, which generates thecopy
for every class,annotated
, which only generates those with@CopyExtensions
,packages:pk1:pk2:...
, which generates for every class in those packages.That way you can state in your build file "I want
copy
for all my domain classes in this package", instead of marking each of them by hand. What do you think, @pablisco?
That sounds perfect. Could we also add regex? 🤞
Ready again for review!
The default is still to generate for all classes. This PR adds the option to process only those marked with
@KopyKat
.In order to educate people about the defaults, I've added a warning when
@KopyKat
is used, but still the plug-in is configured in the "generate all" option. This in turn required some tweaks to the testing framework, because KSP warning messages were no correctly recorded.