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

Add the "framework" compiler target (issue #132) #136

Closed
wants to merge 1 commit into from
Closed

Add the "framework" compiler target (issue #132) #136

wants to merge 1 commit into from

Conversation

fwolff
Copy link
Contributor

@fwolff fwolff commented May 15, 2017

Hello,

Here is a pull request for the "framework" compiler target (i.e. <target>framework</target > in robovm.xml). It replicates the original commercial RoboVM feature, with the following differences:

  • It uses libc++ instead of the deprecated libstdc++.
  • The structure of the framework doesn't have a root Resources directory anymore: the Resources directory is now under a MyFrameworkName.bundle directory, as it should be according to the new Apple policy.
  • Only the iOS OS is supported (i.e. <os>ios</ios> in robovm.xml).
  • It is not a plugin but a core feature of the compiler (see Config.java).

Known issues (help wanted!):

  • The Java VM created in init.m (see sample initialization code in init.m) starts with a wrong classpath because it looks for jars in MyFrameworkName.framework/Resources/MyFrameworkName.bundle/Resources instead of MyFrameworkName.framework/MyFrameworkName.bundle/Resources. As a workaround, one can use this JNI option:
    [NSString stringWithFormat: @"-rvm:ResourcesPath=%@/Frameworks/MyFrameworkName.framework", [[NSBundle mainBundle] resourcePath]]
    Where is initialized the VM classpath and how can I fix this faulty default classpath in the case of frameworks?
  • The AnswerMe sample doesn't work anymore as is because of the above Resources path issue and because, for some strange reason, Retrofit.Builder().baseUrl("http://api.duckduckgo.com") throws an exception (HttpUrl.Builder.host(String) throws an IllegalArgumentException whatever host you pass, unless it is an IPV6 address, as it was already reported here by @omainegra).
  • My framework makes intensive use of Runnable/VoidBlock(n) as callbacks (closures in my Swift code). It works fine unless the blocks are called asynchronously, which ends up with a bad access error. This issue was first reported as #1109 in the original RoboVM project and fixed in 1.11. I can use the workaround found by @alexitelman, but using blocks would be much more convenient... Can any of you fix this issue in this fork?

Thanks,
Franck.

@fwolff
Copy link
Contributor Author

fwolff commented May 15, 2017

Warning!

I just realized that my PR overrides this commit made 6 days ago in Config.java (issue #127).

Do you want me to submit a new PR or can you merge the two modifs?

@fwolff
Copy link
Contributor Author

fwolff commented May 15, 2017

Closing this pull request because it conflicts with another commit. New PR pending...

@fwolff fwolff closed this May 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant