j2objc-contrib / j2objc-common-libs-e2e-test

End-to-end tests for translating, compiling, and linking common Java libraries into Objective C using j2objc
https://github.com/j2objc-contrib
Apache License 2.0
12 stars 5 forks source link

io.reactivex:rxjava:1.X - J2ObjC continuous build #43

Open brunobowden opened 8 years ago

brunobowden commented 8 years ago

Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.

@benjchristensen, @zsxwing, @akarnokd - FYI for you all - no need to take action. This concerns supporting translation of the RxJava library to Objective-C such that it can be used on iOS. This issue is specifically for testing the translation as part of a continuous build using Google's Java to Objective-C conversion tool, known as "J2ObjC".

Since you're using the Netflix Nebula testing framework. I'd suggest looking at the newly release Gradle TestKit which was heavily influenced by Nebula: https://docs.gradle.org/2.6-rc-1/userguide/test_kit.html

@advayDev1 - What's easier about RxJava is that it already uses a Gradle Build. Since the 2.0 release isn't finalized, I'd suggest supporting the 1.0.14 release. It also has the benefit of having no external dependencies except for testing:

From their 1.0.14 build.gradle: https://github.com/ReactiveX/RxJava/blob/v1.0.14/build.gradle

buildscript {
  repositories { jcenter() }
  dependencies { classpath 'com.netflix.nebula:gradle-rxjava-project-plugin:2.2.3' }
}

description = 'RxJava: Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.'

apply plugin: 'rxjava-project'
apply plugin: 'java'

dependencies {
    testCompile 'junit:junit-dep:4.10'
    testCompile 'org.mockito:mockito-core:1.8.5'
}
...
akarnokd commented 8 years ago

Sounds great. How will you manage the unsafe/regular distinction in our code? If not too much burden, I'd like to know how well the 2.0 branch translates to Objective-C (in its current state).

brunobowden commented 8 years ago

Someone was trying to use RxJava and reported a crash with sun.misc.Unsafe https://groups.google.com/forum/#!searchin/j2objc-discuss/RxJava/j2objc-discuss/LjunwVJs2O0/gV5sMU08EwAJ

Quoting @tomball: "Please retry with the very latest source. Keith recently updated sun.misc.Unsafe https://github.com/google/j2objc/commits/master/jre_emul/Classes/sun/misc/Unsafe.java to use c11 atomic intrinsics, which should make that class both more correct and stable."

I'll ping the thread to ask if the problem was resolved. We really need to get all the unit tests running as well if you want to have confidence in the output.

On Thu, Oct 1, 2015 at 12:05 AM David Karnok notifications@github.com wrote:

Sounds great. How will you manage the unsafe/regular distinction in our code? If not too much burden, I'd like to know how well the 2.0 branch translates to Objective-C (in its current state).

— Reply to this email directly or view it on GitHub https://github.com/j2objc-contrib/j2objc-common-libs-e2e-test/issues/43#issuecomment-144639261 .