-
Notifications
You must be signed in to change notification settings - Fork 68
[ffigen] Generate ResourceIdentifier
s for Objective-C
#1099
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
Comments
ResourceIdentifier
s ResourceIdentifier
s for Objective-C
Tree shaking the ObjC library based on how it's used from Dart? Yeah, probably need to use the same approach as JNIgen. There are only a few Looking at the dylib for one of the ObjC tests in ffigen, we can see entries for the class and the methods. In this case there's a
So it should be fairly straightforward to filter these methods and classes based on the
The class, the methods. Also, whether or not the method is static, since that affects the name in the dylib (note the Probably also the class's super class, so that we retain the super class of any used class. Do we need to include the method's argument types so that we retain those classes too? I guess for both of these cases we could just add the super class/argument class as another ordinary "please retain this class" entry, rather than as metadata on the parent class. What does the |
That's a great point! Yes, there's a free-form So we could generate something like: @ResourceIdentifier({
'ffigen': true,
'objective_c': true,
'objective_c_class' : 'OriginalObjectiveCClassName',
'objective_c_method' : 'OriginalObjectiveCMethodName',
'objective_c_method_static' : true,
'objective_c_super_class' : 'OriginalObjectiveCClassName',
}) |
For tree-shaking we want to generate
ResourceIdentifier
annotations.For C:
@Native
s and@ResourceIdentifier
#1085For JNIgen:
ResourceIdentifier
s #1098Probably for Objective-C (and Swift?) we could or should do something similar. The idea for C code is to compile to a static lib with all symbols in
build.dart
and then call the native linker inlink.dart
and pass the exact list of C symbols to keep based on what@Native
s (annotated with@ResourceIdentifier
) are reachable after TFA. Would a similar approach work for Objective-C @liamappelbe?I presume that for the actual classes in Objective-C we might need something more similar to JNIgen, where we generate
@ResourceIdentifier
s for the classes and instance methods.Same questions to answer here:
The text was updated successfully, but these errors were encountered: