Skip to content

Commit

Permalink
release v1.0.0-beta10 (#238)
Browse files Browse the repository at this point in the history
* dependency updates (#221)

* dependency updates
- AGP 4.2.1
- coroutines 1.5.0
- spotless 5.12.5

* update artifact versions in documentation samples

Signed-off-by: GitHub Actions <actions@github.com>

* Dispatch bom (#225)

* Bump com.diffplug.spotless from 5.12.4 to 5.12.5 (#220)

* introduce a BOM

* update main project README

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* dependency updates (#229)

* Bump com.diffplug.spotless from 5.12.4 to 5.12.5 (#220)

* introduce a BOM (#222)

* introduce a BOM

* update main project README

* Revert "introduce a BOM (#222)" (#224)

This reverts commit ddf205a.

* Bump io.gitlab.arturbosch.detekt from 1.16.0 to 1.17.0 (#226)

Bumps io.gitlab.arturbosch.detekt from 1.16.0 to 1.17.0.

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump io.gitlab.arturbosch.detekt from 1.17.0 to 1.17.1 (#228)

Bumps io.gitlab.arturbosch.detekt from 1.17.0 to 1.17.1.

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* dependency updates
- detekt 1.17.1
- JUnit 5.7.2
- Kotest 4.6.0
- Kotlin 1.5.10
- Androidx AppCompat 1.3.0
- Androidx core-ktx 1.5.0
- Androidx Fragment 1.3.4

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* remove JUnit from the dispatch-test classpath (#232)

fixes #231

* stop generating a BuildConfig in the Android modules (#234)

fixes #233

* fix coroutineScope cancellation with withViewLifecycle (#237)

* change version to 1.0.0-beta10

* update CHANGELOG

* change library version in docs from RC01 to beta10

* add use of the BOM to junit readmes

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
RBusarow and dependabot[bot] committed Jun 4, 2021
1 parent 7503f73 commit 566bf95
Show file tree
Hide file tree
Showing 45 changed files with 371 additions and 208 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change log for Dispatch

## Version 1.0.0-beta10

* Update coroutines to [1.5.0](https://github.com/Kotlin/kotlinx.coroutines/releases/tag/1.5.0)
* Add a BOM for unified dependency versions ([#219](https://github.com/RBusarow/Dispatch/issues/219))
* Fix permanent cancellation when using [withViewLifecycleScope] ([#236](https://github.com/RBusarow/Dispatch/issues/236))

## Version 1.0.0-beta09

* [CoroutineTestExtension] now creates a new [scope][CoroutineTestExtension.scope] instance for each test.
Expand Down Expand Up @@ -145,6 +151,7 @@
<!--- MODULE dispatch-android-lifecycle-extensions-->
<!--- INDEX -->

[withViewLifecycleScope]: https://rbusarow.github.io/Dispatch/api/dispatch-android-lifecycle-extensions/dispatch.android.lifecycle/with-view-lifecycle-scope.html
[lifecycleScope]: https://rbusarow.github.io/Dispatch/api/dispatch-android-lifecycle-extensions/dispatch.android.lifecycle/index.html#dispatch.android.lifecycle/lifecycleScope/androidx.lifecycle.LifecycleOwner#/PointingToDeclaration/

<!--- MODULE dispatch-android-viewmodel-->
Expand Down
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -361,35 +361,38 @@ dependencies {
*/

// core coroutines
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.3")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0")

// a BOM ensures that all artifacts used from the library are of the same version
implementation(platform("com.rickbusarow.dispatch:dispatch-bom:1.0.0-beta10"))

// everything provides :core via "api", so you only need this if you have no other "implementation" dispatch artifacts
implementation("com.rickbusarow.dispatch:dispatch-core:1.0.0-beta09")
implementation("com.rickbusarow.dispatch:dispatch-core")
// LifecycleCoroutineScope for Android Fragments, Activities, etc.
implementation("com.rickbusarow.dispatch:dispatch-android-lifecycle:1.0.0-beta09")
implementation("com.rickbusarow.dispatch:dispatch-android-lifecycle")
// lifecycleScope extension function with a settable factory. Use this if you don't DI your CoroutineScopes
// This provides :dispatch-android-lifecycle via "api", so you don't need to declare both
implementation("com.rickbusarow.dispatch:dispatch-android-lifecycle-extensions:1.0.0-beta09")
implementation("com.rickbusarow.dispatch:dispatch-android-lifecycle-extensions")
// ViewModelScope for Android ViewModels
implementation("com.rickbusarow.dispatch:dispatch-android-viewmodel:1.0.0-beta09")
implementation("com.rickbusarow.dispatch:dispatch-android-viewmodel")

/*
jvm testing
*/

// core coroutines-test
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.4.3")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.5.0")
// you only need this if you don't have the -junit4 or -junit5 artifacts
testImplementation("com.rickbusarow.dispatch:dispatch-test:1.0.0-beta09")
testImplementation("com.rickbusarow.dispatch:dispatch-test")
// CoroutineTestRule and :dispatch-test
// This provides :dispatch-test via "api", so you don't need to declare both
// This can be used at the same time as :dispatch-test-junit5
testImplementation("com.rickbusarow.dispatch:dispatch-test-junit4:1.0.0-beta09")
testImplementation("com.rickbusarow.dispatch:dispatch-test-junit4")
// CoroutineTest, CoroutineTestExtension, and :dispatch-test
// This provides :dispatch-test via "api", so you don't need to declare both
// This can be used at the same time as :dispatch-test-junit4
testImplementation("com.rickbusarow.dispatch:dispatch-test-junit5:1.0.0-beta09")
testImplementation("com.rickbusarow.dispatch:dispatch-test-junit5")
/*
Android testing
*/
Expand All @@ -398,7 +401,7 @@ dependencies {
androidTestImplementation("androidx.test:runner:1.3.0")
androidTestImplementation("androidx.test.espresso:espresso-core:3.3.0")
// IdlingDispatcher, IdlingDispatcherProvider, and IdlingCoroutineScope
androidTestImplementation("com.rickbusarow.dispatch:dispatch-android-espresso:1.0.0-beta09")
androidTestImplementation("com.rickbusarow.dispatch:dispatch-android-espresso")
}
```

Expand Down
7 changes: 2 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import org.jetbrains.kotlin.gradle.tasks.*

buildscript {
dependencies {
classpath("com.android.tools.build:gradle:4.2.0")
classpath("com.android.tools.build:gradle:4.2.1")
classpath("org.jetbrains.kotlinx:atomicfu-gradle-plugin:0.16.1")
classpath("org.jetbrains.kotlinx:binary-compatibility-validator:0.5.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10")
classpath("com.vanniktech:gradle-maven-publish-plugin:0.15.1")
classpath("org.jetbrains.kotlinx:kotlinx-knit:0.2.3")
}
Expand All @@ -43,9 +43,6 @@ plugins {
id("com.dorongold.task-tree") version "1.5"
id("com.diffplug.spotless") version "5.12.5"
base
// can be removed for Kotlin Gradle Plugin 1.5.10
// workaround for https://youtrack.jetbrains.com/issue/KT-46368#focus=Comments-27-4868598.0-0
id("dev.zacsweers.kgp-150-leak-patcher") version "1.1.0"
}

tasks.dokkaHtmlMultiModule.configure {
Expand Down
3 changes: 1 addition & 2 deletions buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pluginManagement {
resolutionStrategy {
eachPlugin {
when {
requested.id.id.startsWith("org.jetbrains.kotlin") -> useVersion("1.5.0")
requested.id.id.startsWith("org.jetbrains.kotlin") -> useVersion("1.5.10")
}
}
}
Expand All @@ -38,7 +38,6 @@ dependencyResolutionManagement {
// dokka
includeGroup("org.jetbrains.dokka")
includeModule("org.jetbrains", "markdown")
// Detekt && dokka
includeModule("org.jetbrains.kotlinx", "kotlinx-html-jvm")
// https://youtrack.jetbrains.com/issue/IDEA-261387
includeModule("org.jetbrains.trove4j", "trove4j")
Expand Down
8 changes: 4 additions & 4 deletions buildSrc/src/main/kotlin/Common.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ fun Project.common() {
configurations.all {
resolutionStrategy {
force(
"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3",
"org.jetbrains.kotlinx:kotlinx-coroutines-test:1.4.3",
"org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.3"
"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0",
"org.jetbrains.kotlinx:kotlinx-coroutines-test:1.5.0",
"org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0"
)
eachDependency {
when {
requested.group == "org.jetbrains.kotlin" -> useVersion("1.5.0")
requested.group == "org.jetbrains.kotlin" -> useVersion("1.5.10")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/CommonAndroid.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fun Project.commonAndroid() {
defaultConfig {
minSdkVersion(21)
targetSdkVersion(30)
versionName = "1.0.0-beta09"
versionName = "1.0.0-beta10"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
39 changes: 20 additions & 19 deletions buildSrc/src/main/kotlin/DocsTasks.kt
Original file line number Diff line number Diff line change
Expand Up @@ -152,30 +152,31 @@ fun File.updateLibraryVersions(): File {
"androidx.lifecycle:lifecycle-viewmodel:2.3.1".toDependencyMatcher(),
"androidx.test:runner:1.3.0".toDependencyMatcher(),
"androidx.test.espresso:espresso-core:3.3.0".toDependencyMatcher(),
"io.gitlab.arturbosch.detekt:detekt-api:1.16.0".toDependencyMatcher(),
"io.gitlab.arturbosch.detekt:detekt-cli:1.16.0".toDependencyMatcher(),
"io.gitlab.arturbosch.detekt:detekt-formatting:1.16.0".toDependencyMatcher(),
"io.gitlab.arturbosch.detekt:detekt-test:1.16.0".toDependencyMatcher(),
"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3".toDependencyMatcher(),
"org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.3".toDependencyMatcher(),
"org.jetbrains.kotlinx:kotlinx-coroutines-test:1.4.3".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-detekt:1.0.0-beta09".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-android-espresso:1.0.0-beta09".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-android-lifecycle:1.0.0-beta09".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-android-lifecycle-extensions:1.0.0-beta09".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-android-viewmodel:1.0.0-beta09".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-test:1.0.0-beta09".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-test-junit4:1.0.0-beta09".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-test-junit5:1.0.0-beta09".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-core:1.0.0-beta09".toDependencyMatcher(),
"io.gitlab.arturbosch.detekt:detekt-api:1.17.1".toDependencyMatcher(),
"io.gitlab.arturbosch.detekt:detekt-cli:1.17.1".toDependencyMatcher(),
"io.gitlab.arturbosch.detekt:detekt-formatting:1.17.1".toDependencyMatcher(),
"io.gitlab.arturbosch.detekt:detekt-test:1.17.1".toDependencyMatcher(),
"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0".toDependencyMatcher(),
"org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0".toDependencyMatcher(),
"org.jetbrains.kotlinx:kotlinx-coroutines-test:1.5.0".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-detekt:1.0.0-beta10".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-android-espresso:1.0.0-beta10".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-android-lifecycle:1.0.0-beta10".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-android-lifecycle-extensions:1.0.0-beta10".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-android-viewmodel:1.0.0-beta10".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-test:1.0.0-beta10".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-test-junit4:1.0.0-beta10".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-test-junit5:1.0.0-beta10".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-bom:1.0.0-beta10".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-core:1.0.0-beta10".toDependencyMatcher(),
"com.rickbusarow.hermit:hermit-core:0.9.2".toDependencyMatcher(),
"com.rickbusarow.hermit:hermit-junit4:0.9.2".toDependencyMatcher(),
"com.rickbusarow.hermit:hermit-junit5:0.9.2".toDependencyMatcher(),
"com.rickbusarow.hermit:hermit-mockk:0.9.2".toDependencyMatcher(),
"com.rickbusarow.hermit:hermit-coroutines:0.9.2".toDependencyMatcher(),
"io.kotest:kotest-assertions-core-jvm:4.4.3".toDependencyMatcher(),
"io.kotest:kotest-property-jvm:4.4.3".toDependencyMatcher(),
"io.kotest:kotest-runner-junit5-jvm:4.4.3".toDependencyMatcher()
"io.kotest:kotest-assertions-core-jvm:4.6.0".toDependencyMatcher(),
"io.kotest:kotest-property-jvm:4.6.0".toDependencyMatcher(),
"io.kotest:kotest-runner-junit5-jvm:4.6.0".toDependencyMatcher()
)

forEachLine { originalLine ->
Expand Down
1 change: 1 addition & 0 deletions buildSrc/src/main/kotlin/Modules.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ object Modules {
":dispatch-android-lifecycle:samples",
":dispatch-android-viewmodel",
":dispatch-android-viewmodel:samples",
":dispatch-bom",
":dispatch-core",
":dispatch-core:samples",
":dispatch-detekt",
Expand Down
7 changes: 7 additions & 0 deletions buildSrc/src/main/kotlin/androidLibrary.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* limitations under the License.
*/

import com.android.build.gradle.*
import org.jetbrains.kotlin.gradle.dsl.*

/*
Expand All @@ -36,6 +37,12 @@ apply(plugin = "org.jetbrains.kotlin.android")
commonAndroid()
common()

configure<LibraryExtension> {
buildFeatures {
buildConfig = false
}
}

val testJvm by tasks.registering {
dependsOn("testDebugUnitTest")
}
Expand Down
9 changes: 5 additions & 4 deletions dispatch-android-espresso/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,12 @@ repositories {
dependencies {

// core
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.3")
implementation("com.rickbusarow.dispatch:dispatch-core:1.0.0-beta09")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0")
implementation(platform("com.rickbusarow.dispatch:dispatch-bom:1.0.0-beta10"))
implementation("com.rickbusarow.dispatch:dispatch-core")

androidTestImplementation("com.rickbusarow.dispatch:dispatch-android-espresso:1.0.0-beta09")
androidTestImplementation("com.rickbusarow.dispatch:dispatch-android-espresso")

// android
androidTestImplementation("androidx.test:runner:1.3.0")
Expand Down
7 changes: 0 additions & 7 deletions dispatch-android-espresso/api/dispatch-android-espresso.api
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
public final class dispatch/android/espresso/BuildConfig {
public static final field BUILD_TYPE Ljava/lang/String;
public static final field DEBUG Z
public static final field LIBRARY_PACKAGE_NAME Ljava/lang/String;
public fun <init> ()V
}

public abstract interface class dispatch/android/espresso/DefaultIdlingCoroutineScope : dispatch/android/espresso/IdlingCoroutineScope, dispatch/core/DefaultCoroutineScope {
}

Expand Down
7 changes: 4 additions & 3 deletions dispatch-android-lifecycle-extensions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,10 @@ repositories {

dependencies {

implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.3")
implementation("com.rickbusarow.dispatch:dispatch-android-lifecycle-extensions:1.0.0-beta09")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0")
implementation(platform("com.rickbusarow.dispatch:dispatch-bom:1.0.0-beta10"))
implementation("com.rickbusarow.dispatch:dispatch-android-lifecycle-extensions")

implementation("androidx.lifecycle:lifecycle-common:2.3.1")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,3 @@ public final class dispatch/android/lifecycle/WithViewLifecycleScopeKt {
public static final fun withViewLifecycleScope (Landroidx/fragment/app/Fragment;Lkotlin/jvm/functions/Function1;)Lkotlinx/coroutines/Job;
}

public final class dispatch/android/lifecycle/extensions/BuildConfig {
public static final field BUILD_TYPE Ljava/lang/String;
public static final field DEBUG Z
public static final field LIBRARY_PACKAGE_NAME Ljava/lang/String;
public static final field VERSION_CODE I
public static final field VERSION_NAME Ljava/lang/String;
public fun <init> ()V
}

7 changes: 4 additions & 3 deletions dispatch-android-lifecycle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ repositories {

dependencies {

implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.3")
implementation("com.rickbusarow.dispatch:dispatch-android-lifecycle:1.0.0-beta09")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0")
implementation(platform("com.rickbusarow.dispatch:dispatch-bom:1.0.0-beta10"))
implementation("com.rickbusarow.dispatch:dispatch-android-lifecycle")
implementation("androidx.lifecycle:lifecycle-common:2.3.1")
}
```
Expand Down
7 changes: 0 additions & 7 deletions dispatch-android-lifecycle/api/dispatch-android-lifecycle.api
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
public final class dispatch/android/lifecycle/BuildConfig {
public static final field BUILD_TYPE Ljava/lang/String;
public static final field DEBUG Z
public static final field LIBRARY_PACKAGE_NAME Ljava/lang/String;
public fun <init> ()V
}

public class dispatch/android/lifecycle/DispatchLifecycleScope : dispatch/core/MainImmediateCoroutineScope {
public static final field Companion Ldispatch/android/lifecycle/DispatchLifecycleScope$Companion;
public fun <init> (Landroidx/lifecycle/Lifecycle;Lkotlin/coroutines/CoroutineContext;)V
Expand Down
1 change: 1 addition & 0 deletions dispatch-android-lifecycle/samples/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ dependencies {
implementation(libs.androidx.lifecycle.viewModel)
implementation(libs.junit.junit4)
implementation(libs.junit.api)
implementation(libs.kotlinx.coroutines.android)
implementation(libs.kotlinx.coroutines.core)

implementation(projects.dispatchAndroidLifecycle)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import dispatch.android.lifecycle.*
import dispatch.core.*
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.*
import kotlin.coroutines.*

@ExperimentalCoroutinesApi
internal fun bindViewLifecycleCoroutineScope(
Expand All @@ -34,20 +33,23 @@ internal fun bindViewLifecycleCoroutineScope(
.onEachLatest { owner: LifecycleOwner? ->

if (owner != null) {
coroutineScope {
launch {
/*
Create a new ViewLifecycleCoroutineScope for each update to the LiveData.
/*
Create a new ViewLifecycleCoroutineScope for each update to the LiveData.
This new scope has the same CoroutineContext as the "receiverScope" parent,
except that its Job is automatically cancelled for each new LiveData event
without affecting the Job contained in the receiver scope.
*/
val viewScope = ViewLifecycleCoroutineScope(
lifecycle = owner.lifecycle,
coroutineContext = coroutineContext
)

This new scope has the same CoroutineContext as the "receiverScope" parent,
except that its Job is automatically cancelled for each new LiveData event
without affecting the Job contained in the receiver scope.
*/
val viewScope = ViewLifecycleCoroutineScope(
lifecycle = owner.lifecycle,
coroutineContext = coroutineContext
)

viewScope.block()
viewScope.block()
}
}
}
}.flowOnMainImmediate()
.launchIn(receiverScope)
Expand Down
Loading

0 comments on commit 566bf95

Please sign in to comment.