Uploaded image for project: 'Realm Java SDK'
  1. Realm Java SDK
  2. RJAVA-82

Support Java on JVM

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None

      First task before we can add support for Java JVM is making sure our internal module structure/CI/deployment supports it.

      Preliminary TODO list (we need to revisit this before starting development):

      First task before we can add support for Java JVM is making sure our internal module structure/CI/deployment supports it.

      Preliminary TODO list (we need to revisit this before starting development):

      Required

      • [ ] CI support to build core and sync binaries for different platforms. Needed for #2256 and #1867 as well.
        • [x] Android (Already working)
        • [x] Windows + Sync
        • [x] MacOS + Sync
        • [x] Linux + Sync (different variants?)
      • [ ] We need to modify the build scripts to be able to generate versions for both Android and JVM.
        • [ ] We need to be able to build our JNI binding on multiple platforms. How to parallelize our Jenkinsfile to do this? Will also require specific mac support. Can we reuse how Core is doing it?
      • [ ] CMake & reusing existing JNI code (current code is coupled with NDK toolchain)
        • [ ] OpenSSL currently downloading the prebuilt package libcrypto.a for Android from https://github.com/realm/openssl-android [do] we need to adapt for macOS/Linux/Win?
        • [ ] Android specific flag ANDROID_NO_UNDEFINED, ABI_CXX_FLAGS, LINKER_FLAGS, jni_impl/android_logger.cpp
        • [ ] keep GCC 4.9 or use CLANG
        • [ ] Android Prebuilt Libraries (linkage): -llog -landroid -latomic
        • [ ] STL library libc++/gnustl
      • [ ] realm-gradle-plugin need to support two modes: realm-android and realm-java.
        • [ ] Rewrite in Kotlin?
      • [ ] Split existing code into 3 modules: realm-java-core, realm-java-android, realm-java-jvm (names up for debate).
        • [ ] Need a new build.gradle for realm-java-jvm
        • [ ] Figure out how much code should live in each module
      • [ ] Figure out how to run JavaAssist without the Transform API which is Android only.
        • [ ] How to share as much as possible between Transform API and JVM implementation?
        • [ ] Rewrite in Kotlin?
      • [ ] All android dependencies need to be hidden behind interfaces.
        • [ ] Context needs to be abstracted away. Already begun in https://github.com/realm/realm-java/pull/3692.
        • [ ] Our streaming Json support depends on Android classes as well
        • [ ] NetworkStateReceiver
        • [ ] @RunTestInLooperThread
        • [ ] We have quite a few unit tests with android dependencies.
      • [ ] We need to figure out which run loops to support on the JVM, since the Looper does not exist. As a minimum, we need to provide our own.
        • [ ] Support for Spring event loop
        • [ ] Custom event loop for stand alone apps, e.g. Global Notifier
        • [ ] Web containers like Tomcat and friends don't have that concept. Just ignore them?

      Optional

      • [ ] Determine the need for a Maven plugin. If yes, we need to make that as well.
      • [ ] Determine if API should be similar on JVM vs. Android. This especially impacts how much code can live in realm-java-core

            Assignee:
            Unassigned Unassigned
            Reporter:
            brian.munkholm@mongodb.com Brian Munkholm (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: