Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Kotlin extension functions to main artifact #339

Merged
merged 6 commits into from
Apr 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ build/
# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Lint
lint-report.html
lint-report_files/
Expand Down
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,6 @@ implementation 'com.uber.autodispose:autodispose-rxlifecycle3:x.y.z'

Kotlin extensions:

`autodispose-ktx` [![Maven Central](https://img.shields.io/maven-central/v/com.uber.autodispose/autodispose-ktx.svg)](https://mvnrepository.com/artifact/com.uber.autodispose/autodispose-ktx)
```gradle
implementation 'com.uber.autodispose:autodispose-ktx:x.y.z'
```

`autodispose-android-ktx` [![Maven Central](https://img.shields.io/maven-central/v/com.uber.autodispose/autodispose-android-ktx.svg)](https://mvnrepository.com/artifact/com.uber.autodispose/autodispose-android-ktx)
```gradle
implementation 'com.uber.autodispose:autodispose-android-ktx:x.y.z'
Expand Down
7 changes: 0 additions & 7 deletions autodispose-ktx/Module.md

This file was deleted.

23 changes: 0 additions & 23 deletions autodispose-ktx/build.gradle

This file was deleted.

3 changes: 0 additions & 3 deletions autodispose-ktx/gradle.properties

This file was deleted.

1 change: 1 addition & 0 deletions autodispose/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ lintOptions {

dependencies {
api deps.rx.java
implementation deps.kotlin.stdlib

signature deps.build.animalSniffer
lintChecks project(':static-analysis:autodispose-lint')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

@file:Suppress("NOTHING_TO_INLINE")
@file:JvmName("KotlinExtensions")

package com.uber.autodispose

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Top-level functions that can only be used by Kotlin.
-dontwarn com.uber.autodispose.KotlinExtensions
13 changes: 9 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,23 @@ buildscript {
}
}

Set<String> mixedSourcesArtifacts = [
"autodispose"
]
subprojects {
repositories {
google()
mavenCentral()
jcenter()
}

boolean isMixedSourceSet = project.name in mixedSourcesArtifacts
boolean isAndroidLibrary = project.path.startsWith(":android:")
boolean isLint = project.path.endsWith("-lint")
boolean isKotlin = project.path.endsWith("-ktx") || isLint
boolean isKotlin = project.path.endsWith("-ktx") || isLint || isMixedSourceSet
boolean isSample = project.name == "sample"
boolean isJavaLibrary = !isAndroidLibrary && !isKotlin && !isSample
boolean usesErrorProne = !isKotlin && !isSample
boolean isJavaLibrary = !isAndroidLibrary && !isKotlin && !isSample || isMixedSourceSet
boolean usesErrorProne = !isKotlin && !isSample || isMixedSourceSet
if (isAndroidLibrary) {
project.apply plugin: 'com.android.library'
project.android {
Expand Down Expand Up @@ -81,7 +85,8 @@ subprojects {
project.apply plugin: 'org.jetbrains.kotlin.jvm'
project.apply plugin: 'org.jetbrains.dokka'
}
if (!isLint) {
// Lint must be compileOnly, mixed source sets (for now) must manually specify depending on needs
if (!(isLint || isMixedSourceSet)) {
project.dependencies {
api deps.kotlin.stdlib
}
Expand Down
1 change: 0 additions & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ dependencies {
implementation project(':android:autodispose-android')
implementation project(':android:autodispose-android-archcomponents')
implementation project(':autodispose')
implementation project(':autodispose-ktx')
implementation project(':lifecycle:autodispose-lifecycle')
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
Expand Down
1 change: 0 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ if (System.getenv("ANDROID_HOME") != null) {
include ':sample'
}
include ':autodispose'
include ':autodispose-ktx'
include ':lifecycle:autodispose-lifecycle'
include ':lifecycle:autodispose-lifecycle-jdk8'
include ':lifecycle:autodispose-lifecycle-ktx'
Expand Down