eclipse-archived / ceylon

The Ceylon compiler, language module, and command line tools
http://ceylon-lang.org
Apache License 2.0
399 stars 62 forks source link

Package annotations on `package-info` class #2141

Open CeylonMigrationBot opened 9 years ago

CeylonMigrationBot commented 9 years ago

[@FroMage] Was there a good reason for not compiling our packages to package-info classes so that we can place package annotations like in Java?

[Migrated from ceylon/ceylon-compiler#2141]

CeylonMigrationBot commented 9 years ago

[@quintesse] No idea whatsoever. I can't remember ever having discussed it before (at the time it was implemented I mean).

CeylonMigrationBot commented 9 years ago

[@tombentley] I don't recall. I seem to think there was a reason, though it might not be a good reason.

CeylonMigrationBot commented 9 years ago

[@FroMage] Moving to 1.3

tombentley commented 8 years ago

6608 added support for putting Java annotations on package-info.class, but for the moment we still put Ceylon annotations on a class called $package_.class.

It would be tidier and less ambiguous if they were always put on package-info.class. Doing that would involve:

  1. Changing the metamodel to inspect the Package.
  2. Changing the model loader to set shared according to the annotation on package-info.
  3. Changing the annotation constraint mapping so a OptionalAnnotation<...Package> got mapped to @Target{PACKAGE}
  4. Possibly chaning our metamodel annotation @Target.

It would be a lot of work to do all of this in a binary compatible way.

gavinking commented 7 years ago

If we're going to make this change, then now is best our opportunity!