{"action":"created","issue":{"url":"https://api.github.com/repos/google/j2objc/issues/674","repository_url":"https://api.github.com/repos/google/j2objc","labels_url":"https://api.github.com/repos/google/j2objc/issues/674/labels{/name}","comments_url":"https://api.github.com/repos/google/j2objc/issues/674/comments","events_url":"https://api.github.com/repos/google/j2objc/issues/674/events","html_url":"https://github.com/google/j2objc/issues/674","id":120854954,"number":674,"title":"Multiple classes in one Java file causing issues.","user":{"login":"ScottPierce","id":871169,"avatar_url":"https://avatars3.githubusercontent.com/u/871169?v=3","gravatar_id":"","url":"https://api.github.com/users/ScottPierce","html_url":"https://github.com/ScottPierce","followers_url":"https://api.github.com/users/ScottPierce/followers","following_url":"https://api.github.com/users/ScottPierce/following{/other_user}","gists_url":"https://api.github.com/users/ScottPierce/gists{/gist_id}","starred_url":"https://api.github.com/users/ScottPierce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScottPierce/subscriptions","organizations_url":"https://api.github.com/users/ScottPierce/orgs","repos_url":"https://api.github.com/users/ScottPierce/repos","events_url":"https://api.github.com/users/ScottPierce/events{/privacy}","received_events_url":"https://api.github.com/users/ScottPierce/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2015-12-07T19:59:38Z","updated_at":"2017-03-16T20:16:47Z","closed_at":null,"body":"[Sources](https://github.com/google/j2objc/files/54471/rxjava-1.1.0-sources.zip)\n[ObjC Transpiled Sources](https://github.com/google/j2objc/files/54470/rxjava-j2objc.zip)\n\nI'm seeing what I believe to be a bug. Included above are the sources to reproduce.\n1. I'm using the command `j2objc -use-arc --doc-comments -d ./out ./rxjava-1.1.0-sources.jar` to get the above transpiled sources.\n2. I'm then using the command to compile the transpiled sources:\n   `j2objcc -g -ObjC -fobjc-arc -I./out `find ./out/*``\n3. I get the following errors:\n\n```\n./out/rx/internal/util/unsafe/MpscLinkedQueue.m:10:10: fatal error: \n      'rx/internal/util/unsafe/BaseLinkedQueueConsumerNodeRef.h' file not found\n#include \"rx/internal/util/unsafe/BaseLinkedQueueConsumerNodeRef.h\"\n         ^\n1 error generated.\n./out/rx/internal/util/unsafe/SpscLinkedQueue.m:11:10: fatal error: \n      'rx/internal/util/unsafe/BaseLinkedQueueConsumerNodeRef.h' file not found\n#include \"rx/internal/util/unsafe/BaseLinkedQueueConsumerNodeRef.h\"\n         ^\n1 error generated.\n```\n\nI diagnosed the first error: When examining the java source you can see that `MpscLinkedQueue` extends the abstract class `BaseLinkedQueue`, which extends the abstract class `BaseLinkedQueueConsumerNodeRef`.\n\nBoth `BaseLinkedQueue` and the `BaseLinkedQueueConsumerNodeRef` seem to be classes in the BaseLinkedQueue.java file, but aren't inner classes. j2ObjC seems to be handling this incorrectly and not generating a file for the class, or if it is generating the class, it's looking for it in the wrong place.\n"},"comment":{"url":"https://api.github.com/repos/google/j2objc/issues/comments/287178268","html_url":"https://github.com/google/j2objc/issues/674#issuecomment-287178268","issue_url":"https://api.github.com/repos/google/j2objc/issues/674","id":287178268,"user":{"login":"tomball","id":2991279,"avatar_url":"https://avatars2.githubusercontent.com/u/2991279?v=3","gravatar_id":"","url":"https://api.github.com/users/tomball","html_url":"https://github.com/tomball","followers_url":"https://api.github.com/users/tomball/followers","following_url":"https://api.github.com/users/tomball/following{/other_user}","gists_url":"https://api.github.com/users/tomball/gists{/gist_id}","starred_url":"https://api.github.com/users/tomball/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomball/subscriptions","organizations_url":"https://api.github.com/users/tomball/orgs","repos_url":"https://api.github.com/users/tomball/repos","events_url":"https://api.github.com/users/tomball/events{/privacy}","received_events_url":"https://api.github.com/users/tomball/received_events","type":"User","site_admin":false},"created_at":"2017-03-16T20:16:47Z","updated_at":"2017-03-16T20:16:47Z","body":"We haven't found any workable solution. Java tools like Gradle and Maven avoid the unknown-number-of-classes-per-source issue blocking on all Java compilation for a library before starting dependent steps.\r\n\r\nHowever, tools like Xcode and [Bazel](https://bazel.build/) want to be able to determine all build artifacts before running, rather than discover bonus artifacts as they're running (that's why [our Xcode rule defines ${INPUT_FILE_BASE}.h and ${INPUT_FILE_BASE}.m outputs](http://j2objc.org/images/xcode-build-rules.png)).  In Bazel's case, requiring a determinant build graph improves its cache opportunities significantly, resulting in shorter and more accurate builds.\r\n\r\nIn theory we could fix this issue by emitting additional header files for each package-private type in a shared source file, but that doesn't work because of build tool requirements. If you or anyone else has a better suggestion that will work with determinate build tools, we'd love to hear your ideas!"}}
{"actor":{"display_login":"tomball"}}