Discussion:
[Ikvm-developers] Convert private Java class to public .Net class?
Daniel Wilson
2016-05-17 16:06:41 UTC
Permalink
Is there a switch to convert one, many, or all private classes in the JAR
to public in the .Net assembly?

I'm guessing there isn't ... but ... I'm also guessing I'm not the first
one to wish there was. All of us using IKVM are in some way extending a
Java library beyond the use its initial designer imagined.

Thanks!
Jeroen Frijters
2016-05-18 05:13:30 UTC
Permalink
Hi Daniel,

As a general principle ikvmc does not do these types of changes, because they are easily done in a standard class file processor and ikvmc is already plenty complicated as it is ;-)

However, you can use InternalsVisibleToAttribute to make non-public classes accessible from your code:

@cli.System.Runtime.CompilerServices.InternalsVisibleToAttribute.Annotation("MyAssembly")
@interface attr { }

ikvmc -r:mscorlib.dll -assemblyattributes:attr.class ...

Regards,
Jeroen
-----Original Message-----
Sent: Tuesday, May 17, 2016 18:07
Subject: [Ikvm-developers] Convert private Java class to public .Net
class?
Is there a switch to convert one, many, or all private classes in the
JAR to public in the .Net assembly?
I'm guessing there isn't ... but ... I'm also guessing I'm not the first
one to wish there was. All of us using IKVM are in some way extending a
Java library beyond the use its initial designer imagined.
Thanks!
Loading...