0

I have a java project "shared" which is my main project and another java project "core". In "shared" project, it has some classes that implements interfaces from "core" project.

So i want all the classes from "core" as well as form "shared" get converted into j2objc at one single place

Hitesh
  • 59
  • 4
  • 15
  • Are they separate projects, or modules? Seems like if "shared" has a dependency on "core" then core would have to be included in the translation. – Patrick Jackson Apr 21 '16 at 16:08

1 Answers1

1

Java jar files are similar in concept and function to native static libraries, and j2objc was designed to support that model (notice how many static libraries are in its distribution lib/ directory). Java apps are generally created by including several library jars in the app's classpath, rather than creating them into one single super-jar. Your iOS build can follow that same pattern, listing static libraries generated from each jar when linking the app.

I recommend you create "shared" and "core" static library projects in Xcode or using Gradle, one from each Java project. Then put the iOS native code in a new app project, and add the library projects as its dependencies. Keeping the same project structure across platforms will make it easier to maintain that code in the future.

tball
  • 1,984
  • 11
  • 21