-
1. Re: Recursive class addition
kpiwko Dec 11, 2012 5:44 AM (in response to mmatloka)Prolinking Michal's proof-of-concept implementation. It is available here https://github.com/mmatloka/shrinkwrap/commit/39d5c3aa63a9bb85e6d7b68782879ca10cca273b
-
2. Re: Recursive class addition
mmatloka Jan 15, 2013 4:06 PM (in response to mmatloka)Any comments ?:)
-
3. Re: Recursive class addition
kpiwko Jan 16, 2013 3:43 AM (in response to mmatloka)My only concern is that recursive class addition might cause a class to be present twice on classpath in case that user adds a JAR via Resolver. I think it would make more sense to limit recusion only on classes defined in the project itself.
-
4. Re: Recursive class addition
aslak Jan 16, 2013 4:22 AM (in response to kpiwko)In general I like the idea, but I'm not sure it can be sensible automated at this level.
One problem is as soon as you introduce an interface or di you no longer have any 'link' to follow. At this point you sound worse off then with no help. You have to know the internal rules of how the automated scanning works and your own structure to know what more you have to add to get it to work. Pluss it probably needs Filter support to avoid including Classes from other Archives etc as Karel mentioned.
I think this type of automation fits better in IDE Tooling where you have access to more information and can give the user a choice. Eclipse can answer things like: who implements this interface. And the user can choose which and if the impl should be included. The output of this tooling would be a 'standard' addClass/addPackage created Archive.
HibernateTooling has a similar scanner for Entities.
-
5. Re: Recursive class addition
mmatloka Jan 18, 2013 9:13 AM (in response to kpiwko)Karel Piwko wrote:
My only concern is that recursive class addition might cause a class to be present twice on classpath in case that user adds a JAR via Resolver. I think it would make more sense to limit recusion only on classes defined in the project itself.
Hm, true, that might be a problem. btw Theoretically currently user can manually add on his own both class nad JAR?
Aslak Knutsen wrote:
In general I like the idea, but I'm not sure it can be sensible automated at this level.
One problem is as soon as you introduce an interface or di you no longer have any 'link' to follow. At this point you sound worse off then with no help. You have to know the internal rules of how the automated scanning works and your own structure to know what more you have to add to get it to work. Pluss it probably needs Filter support to avoid including Classes from other Archives etc as Karel mentioned.
I think this type of automation fits better in IDE Tooling where you have access to more information and can give the user a choice. Eclipse can answer things like: who implements this interface. And the user can choose which and if the impl should be included. The output of this tooling would be a 'standard' addClass/addPackage created Archive.
HibernateTooling has a similar scanner for Entities.
Maybe this feature would fit also Forge, e.g. during Arquillian test creation? (of course finding interface implementations would be harder)