rules_android icon indicating copy to clipboard operation
rules_android copied to clipboard

Use realm in Bazel Android Project

Open Kadanza opened this issue 7 years ago • 4 comments

I want use Realm in my android project. In gradle Realm requires using annotation and some classes. You can see this in link, section "Manual setup" https://realm.io/docs/java/latest/#how-do-i-customize-dependecies-defined-by-the-realm-gradle-plugin

import io.realm.transformer.RealmTransformer
android.registerTransform(new RealmTransformer(project))

dependencies {
  api "io.realm:realm-annotations:$realm_version"
  api "io.realm:realm-android-library:$realm_version"
  api "io.realm:realm-android-kotlin-extensions:$realm_version"
  kapt "io.realm:realm-annotations-processor:$realm_version"
}

In gradle realm has import of class and annotation "kapt".

I dont know how to use annotation in Bazel. Dagger generate classes such realm, but doesn't have annotation in bazel config file. Dagger just has http_archive.

https://github.com/google/dagger#bazel

How to use Realm in Bazel ?

Kadanza avatar Sep 21 '18 13:09 Kadanza

I'll assign myself to this because the problem space (side effects of plugin application) is similar to what we did for Firebase, and doing now for Crashlytics in https://github.com/bazelbuild/bazel/issues/7159. It's possible that we can come up with generic solution here.

https://realm.io/docs/java/latest/

jin avatar Jan 18 '19 00:01 jin

Unassigning myself because I don't have the bandwidth to work on this for the moment.

jin avatar Apr 18 '19 16:04 jin

Why is this a rules_kotlin issue? This feels like a bazel/maven integration issue, as it seems associated with setting up an annotation processor (e.g. a java_plugin) in bazel, which depends on how you bring in third_party deps.

cgruber avatar Oct 25 '19 19:10 cgruber

@cgruber right, makes sense. I'll move this over to rules_android.

jin avatar Oct 25 '19 20:10 jin