package io.realm.gradle

import com.neenbedankt.gradle.androidapt.AndroidAptPlugin
import org.gradle.api.Plugin
import org.gradle.api.Project

class Realm implements Plugin<Project> {

    @Override
    void apply(Project project) {
        project.plugins.apply(AndroidAptPlugin)
        project.repositories.add(project.getRepositories().jcenter())
        project.repositories.add(project.repositories.maven { url "https://jitpack.io" })
        project.dependencies.add("compile", "io.realm:realm-android:${Version.VERSION}@aar")
        project.dependencies.add("compile", "io.realm:realm-annotations:${Version.VERSION}")
        project.dependencies.add("apt", "io.realm:realm-annotations-processor:${Version.VERSION}")
    }
}

package io.realm.gradle

import com.neenbedankt.gradle.androidapt.AndroidAptPlugin
import org.gradle.api.Plugin
import org.gradle.api.Project

class Realm implements Plugin<Project> {

    @Override
    void apply(Project project) {
        project.plugins.apply(AndroidAptPlugin)
        project.repositories.add(project.getRepositories().jcenter())
        project.repositories.add(project.repositories.maven { url "https://jitpack.io" })
        project.dependencies.add("compile", "io.realm:realm-android:${Version.VERSION}")
        project.dependencies.add("compile", "io.realm:realm-annotations:${Version.VERSION}")
        project.dependencies.add("apt", "io.realm:realm-annotations-processor:${Version.VERSION}")
    }
}

Fix the transitive dependency issue
Fix the transitive dependency issue

Adding @aar at the end of a dependency turns off the transitive
dependencies.
See https://docs.gradle.org/current/userguide/dependency_management.html
, specifically the "Artifact only notation" section
