Skip to content
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

Rewrite of j2objc_library.bzl to use an aspect to generate build actions for all java_library dependencies, like the native rule does. #1913

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions examples/protobuf/AddressBook/j2objc_main.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,14 @@ int j2objc_main(const char* className, int argc, const char *argv[]) {
IOSClass *clazz = [IOSClass forName:[NSString stringWithUTF8String:className]];
IOSObjectArray *mainArgs = JreEmulationMainArguments(argc, argv);
SEL mainSelector = sel_registerName("mainWithNSStringArray:");
#if __has_feature(objc_arc)
// Avoid a -Warc-performSelector-leaks false-positive warning.
IMP imp = [clazz.objcClass methodForSelector:mainSelector];
void (*func)(id, SEL, id) = (void *)imp;
func(nil, mainSelector, mainArgs);
#else
[clazz.objcClass performSelector:mainSelector withObject:mainArgs];
#endif
}
@catch (JavaLangClassNotFoundException *e) {
fprintf(stderr, "Error: could not find or load main class %s\n", className);
Expand Down