androidapportablejavascriptcore

compiling Apportable game for Android with JavaScriptCore


How do I go about compling JavaScriptCore based games?

I am hoping I can use the cocos2d-x code given the comments about being able to compile cocos2d-x games on here, by Apportable themselves.

If not that then am I left with the only other option of grabbing the compiled lib file for android (available from the cocos2d-x GIT repository) and writing a stack of bridge definition files?

in which case it is going c++ <-- obj-C <-- java-lib (which seems like a lot to me).

thanks


Solution

  • You could use JavaScriptCoreX from cocos2d-x repository for start. Get the code compiled using ant as the normal build tool of cocos2d-x. We will get libjs.so here.

    However, for apportable, it recommends to use static library. So, Android_jsc.mk need changes to build all static libraries instead. We would get libjs.a and its other dependency libraries, libicuc.a, libicui18n.a, and libstdc++.a.

    Then include these libraries with in apportable/configuration.json and use same header files as iOS version. Don't forget to exclude iOSJavaScriptCore in remove_params/deps.

    There were some changes also need to be made in jsc codes to fix link errors.

    Also, I used older ndk r6 (not the latest as in apportable) to build this code. it seems that its android make files (.mk) are old and not work with latest ndk.

    -Kittipong