plugins { id("java-library") id("objectbox-publish") } // Note: use release flag instead of sourceCompatibility and targetCompatibility to ensure only JDK 8 API is used. // https://docs.gradle.org/current/userguide/building_java_projects.html#sec:java_cross_compilation tasks.withType { options.release.set(8) } val junitVersion: String by rootProject.extra val mockitoVersion: String by rootProject.extra dependencies { api(project(":objectbox-java")) api("io.reactivex.rxjava2:rxjava:2.2.21") testImplementation("junit:junit:$junitVersion") testImplementation("org.mockito:mockito-core:$mockitoVersion") } val javadocJar by tasks.registering(Jar::class) { dependsOn(tasks.javadoc) archiveClassifier.set("javadoc") from("build/docs/javadoc") } val sourcesJar by tasks.registering(Jar::class) { archiveClassifier.set("sources") from(sourceSets.main.get().allSource) } // Set project-specific properties. publishing { publications { getByName("mavenJava") { from(components["java"]) artifact(sourcesJar) artifact(javadocJar) pom { name.set("ObjectBox RxJava API") description.set("RxJava extension for ObjectBox") } } } }