-
Notifications
You must be signed in to change notification settings - Fork 71
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
Allow ignoring package private classes #53
Comments
Thanks Patrick! Side note, this is a duplicate of #34, but #34 may actually have a larger scope. Also, the title here describes very well what is the sought after feature, making it discoverable for other users. Hence, I think we can keep both tickets opened for the moment. This ticket is also related to #1. |
I needed to learn more about how scala encodes this stuff so I wrote a Note sure where this would fit in most naturally to MIMA... On Wed, Feb 19, 2014 at 1:20 AM, Mirco Dotta notifications@github.comwrote:
|
Looks like a good start to me.
Have a look at ClassfileParser. This class reads the bytecode and build the in-memory model of the classfiles. One way I see to implement this is to parse the signature and build the model retaining the visibility access information that were present in the source code. This means you'll likely have to extend MemberInfo and ClassInfo classes. Also, it would be important to decide sooner than later how do we want to expose this functionality to users. Would you have any thought about this? |
Mmmm, I was too naive in my comment. MiMa parses the bytecode and creates its own representation. Meaning that it doesn't rely on compiler's symbol and reflection. In fact, with the current architecture, we replicate in MiMa some of the compiler's logic. So, while your example is conceptually good, I'm afraid it won't work. |
@dotta Why does Mima use it's own parsers rather than relying on the compiler? Is there not a way to depend on the scala compiler itself? How does the current approach work if, e.g. using different versions of scala with different binary formats? Or is the class file format in Scala stable across versions? |
In this case the package visibility seems only available inside of the scalasig annotation and parsing this by hand seems complicated and like it might depend on the pickling used in the particular version of Scala (or is pickling also compatible across scala versions)? Can you think of a way to allow use to read this without either (a) implementing a sig parser by hand or (b) refactoring Mima to rely on the scala compiler instead of forking it? Neither of these seems super desirable... |
How private is a package private? Not very:
That makes things... harder. |
It would be great if users could signify they want to ignore all class which are private[X] for some value of X. This is common practice in large projects which have code that is internally visible but not intended for public consumption.
The text was updated successfully, but these errors were encountered: