Skip to content

Commit

Permalink
Release/1.0.0 beta05 (#188)
Browse files Browse the repository at this point in the history
* update version to 1.0.0-beta04 (#137)

* Kotest 4.1.0 (#138)

* update Kotest to 4.1.0

* update Kotest to 4.1.0

* update Kotest to 4.1.0

* update Kotest to 4.1.0

* Revert "update Kotest to 4.1.0"

This reverts commit 833c838

* fix version parsing in DocsTasks

* add `release/*` matcher to ci.yml

* dispatch-internal-test-android module (#139)

* add hermit dependency (#140)

* add hermit dependency

* add Hermit to the dependency matchers in DocsTasks

* Lifecycle coroutine scope leak fixes (#141)

* - automatically cancel LifecycleCoroutineScope when lifecycle reaches DESTROYED (fixes #135)
- automatically remove lifecycleScope extension property from cache when lifecycle reaches DESTROYED (fixes #136)

* dispatch-internal-test-android module

* update lifecycle handling

* update lifecycle handling

* update lifecycle handling

* convert LifecycleScopeExtensionTest from Kotest to JUnit5 to fix some weird recursive behavior

* convert LifecycleScopeExtensionTest from Kotest to JUnit5 to fix some weird recursive behavior

* remove workspace.xml backup which shouldn't have been added to git

* update docs from main branch

* update change log (#142)

* Change LifecycleCoroutineScope argument to a CoroutineContext, add LifecycleCoroutineScopeFactory (#145)

* change LifecycleCoroutineScope argument to CoroutineContext

* MainImmediateProvidedContext -> MainImmediateContext

* MainImmediateProvidedContext -> MainImmediateContext

* update docs

* MainImmediateProvidedContext -> MainImmediateContext

* Misc cleanup (#146)

* LifecycleScopeFactory README example cleanup

* remove duplicate dependency declarations in android-lifecycle gradle config

* android-lifecycle sample annotation consolidation

* lifecycleScope extension sample rename

* MainImmediateCoroutineScope factory function formatting

* update docs

* - remove tabs (#147)

- consolidate capitalization for modules and kdoc
- add lifecycle-extensions
- dtekt -> detekt

* update Detekt to 1.10.0 (#148)

* update Knit to 0.1.4 (#149)

* coroutines 1.3.7 -> 1.3.8 (#150)

* Detekt cleanup (#151)

* Detekt cleanup

* add detekt to CI, remove Lint

* add dependency graph generator task

* DefaultDispatcherProvider (#153)

* add DefaultDispatcherProvider singleton holder (fixes #152)

* update docs for DefaultDispatcherProvider

* add resolution strategies for coroutines and dispatch (#155)

* cleanup of LifecycleCoroutineScope samples (#156)

* add ViewLifecycleCoroutineScope (#158)

* add ViewLifecycleCoroutineScope

* add ViewLifecycleCoroutineScope docs

* Lifecycle coroutine scope context parameter (#160)

* Add a CoroutineContext parameter to the Lifecycle launch and suspend functions

* add tests

* update docs

* update gradle to 6.6.1 (#163)

* dependency updates (#164)

- Kotlin 1.4.10
- coroutines 1.3.9
- Kotest 4.2.5

* sortDependencies task (#165)

* add and apply the sortDependencies task

* Update build.gradle.kts

* disable Jetifier (#166)

* update Robolectric to 4.4

* update Detekt to 1.14.1 (#168)

* Add the Dependency Analysis Android Gradle Plugin (#169)

* add the Dependency Analysis Plugin and apply its suggestions

* merge in the Detekt update

* restore the :dispatch:core dependency in :dispatch-android-viewmodel

* merge documentation/site changes from main branch

* add gradle doctor plugin (#171)

* add gradle enterprise plugin (#172)

* add task tree plugin (#173)

* junit test modules README cleanup

* update Kotest to 4.3.0 (#174)

* update to Gradle 6.7 and enable file system watching (#175)

* update androidx versions (#177)

* update kotlin plugin applications (#176)

* make testProvided's receiver a TestProvidedCoroutineScope (#180)

* update JUnit5 to 5.7.0 (#178)

* use currentCoroutineContext to resolve context inside a Flow (#182)

* update coroutines to 1.4.0 (#183)

* update Detekt to 1.4.2 https://github.com/detekt/detekt/releases/tag/v1.14.2 (#184)

* dependency updates (#185)

* DispatchLifecycleScope & DispatchViewModel (#186)

* rename LifecycleCoroutineScope to dispatchLifecycleScope.kt

* CoroutineViewModel -> DispatchViewModel

* CoroutineViewModel -> DispatchViewModel

* CoroutineViewModel -> DispatchViewModel

* remove docs/api from git

* update changelog for 1.0.0-beta05

* set min and target jvm to 8 (#187)

* add KDocs for deprecations
  • Loading branch information
RBusarow committed Nov 1, 2020
1 parent 46cdd94 commit c3ed048
Show file tree
Hide file tree
Showing 314 changed files with 1,103 additions and 84,921 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
/.idea/
/projectFilesBackup/.idea/
!/.idea/scopes/*
/docs/api/
22 changes: 16 additions & 6 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 28 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Change log for Dispatch

## Version 1.0.0-beta05

### Api changes
* [ViewLifecycleCoroutineScope] is a special [DispatchLifecycleScope] meant for binding a scope to a [Fragment]'s **view** lifecycle. ([#179](https://github.com/RBusarow/Dispatch/issues/179))
* Make [testProvided] receive [TestProvidedCoroutineScope] ([#157](https://github.com/RBusarow/Dispatch/issues/157))
* [LifecycleCoroutineScope] has been renamed to [DispatchLifecycleScope], along with its extension function. The old names are still functional with a deprecated typealias. They will be removed in the future. ([#186](https://github.com/RBusarow/Dispatch/pull/186))
* [CoroutineViewModel] has been renamed to [DispatchViewModel]. The old names are still functional with a deprecated typealias. They will be removed in the future. ([#186](https://github.com/RBusarow/Dispatch/pull/186))

### Bug fixes
* Use [currentCoroutineContext] to resolve the inner [CoroutineContext] in `flowOn___` functions. ([#181](https://github.com/RBusarow/Dispatch/issues/181))

### Housekeeping
* Set the project JDK target to 8. This only affects the build environment since all previous builds were done on a JDK 8 machine. ([#187](https://github.com/RBusarow/Dispatch/pull/187))
* Coroutines has been updated to 1.4.0 ([#183](https://github.com/RBusarow/Dispatch/pull/183))
* Detekt has been updated to 1.4.2 ([#184](https://github.com/RBusarow/Dispatch/pull/184))
* JUnit6 has been updated to 5.7.0 ([#178](https://github.com/RBusarow/Dispatch/pull/178))

## Version 1.0.0-beta04

### Features
Expand Down Expand Up @@ -80,6 +97,7 @@
[DefaultDispatcherProvider]: https://rbusarow.github.io/Dispatch/api/dispatch-core/dispatch.core/-default-dispatcher-provider/index.html
<!--- MODULE dispatch-test-->
<!--- INDEX -->
[testProvided]: https://rbusarow.github.io/Dispatch/api/dispatch-test/dispatch.test/test-provided.html
[TestProvidedCoroutineScope]: https://rbusarow.github.io/Dispatch/api/dispatch-test/dispatch.test/-test-provided-coroutine-scope/index.html
<!--- MODULE dispatch-test-junit4-->
<!--- INDEX -->
Expand All @@ -90,15 +108,20 @@
<!--- INDEX -->
<!--- MODULE dispatch-android-lifecycle-->
<!--- INDEX -->
[LifecycleCoroutineScope]: https://rbusarow.github.io/Dispatch/api/dispatch-android-lifecycle/dispatch.android.lifecycle/-lifecycle-coroutine-scope/index.html
[ViewLifecycleCoroutineScope]: https://rbusarow.github.io/Dispatch/api/dispatch-android-lifecycle/dispatch.android.lifecycle/-view-lifecycle-coroutine-scope/index.html
[DispatchLifecycleScope]: https://rbusarow.github.io/Dispatch/api/dispatch-android-lifecycle/dispatch.android.lifecycle/-dispatch-lifecycle-scope/index.html
[LifecycleCoroutineScope]: https://rbusarow.github.io/Dispatch/api/dispatch-android-lifecycle/dispatch.android.lifecycle/index.html#dispatch.android.lifecycle/LifecycleCoroutineScope//PointingToDeclaration/
<!--- MODULE dispatch-android-lifecycle-extensions-->
<!--- INDEX -->
[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-->
<!--- INDEX -->
[viewModelScope]: https://rbusarow.github.io/Dispatch/api/dispatch-android-viewmodel/dispatch.android.viewmodel/-coroutine-view-model/index.html#dispatch.android.viewmodel/CoroutineViewModel/viewModelScope/#/PointingToDeclaration/
[CoroutineViewModel]: https://rbusarow.github.io/Dispatch/api/dispatch-android-viewmodel/dispatch.android.viewmodel/index.html#dispatch.android.viewmodel/CoroutineViewModel//PointingToDeclaration/
[DispatchViewModel]: https://rbusarow.github.io/Dispatch/api/dispatch-android-viewmodel/dispatch.android.viewmodel/-dispatch-view-model/index.html
[viewModelScope]: https://rbusarow.github.io/Dispatch/api/dispatch-android-viewmodel/dispatch.android.viewmodel/-dispatch-view-model/index.html#dispatch.android.viewmodel/DispatchViewModel/viewModelScope/#/PointingToDeclaration/
<!--- END -->

[Fragment]: https://developer.android.com/reference/androidx/fragment/app/Fragment
[Android Lifecycle]: https://developer.android.com/reference/androidx/lifecycle/Lifecycle.html
[androidx-lifecycleScope]: https://cs.android.com/androidx/platform/frameworks/support/+/androidx-master-dev:lifecycle/lifecycle-runtime-ktx/src/main/java/androidx/lifecycle/Lifecycle.kt;l=44
[Detekt]: https://github.com/detekt/detekt
Expand All @@ -111,3 +134,6 @@
[dispatch-test-junit4]: https://rbusarow.github.io/Dispatch/api/dispatch-test-junit4/dispatch.test/index.html
[dispatch-test-junit5]: https://rbusarow.github.io/Dispatch/api/dispatch-test-junit4/dispatch.test/index.html
[IdlingResource]: https://developer.android.com/training/testing/espresso/idling-resource

[CoroutineContext]: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.coroutines/-coroutine-context/
[currentCoroutineContext]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/current-coroutine-context
74 changes: 33 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ interface DispatcherProvider : CoroutineContext.Element {

val someCoroutineScope = CoroutineScope(
Job() + Dispatchers.Main + DispatcherProvider()
)
)
```

The default implementation of this interface simply delegates to that [Dispatchers] singleton,
Expand Down Expand Up @@ -115,7 +115,7 @@ class SomeUIClass(val coroutineScope: MainCoroutineScope) {

fun foo() = coroutineScope.launch {
// because of the dependency type,
// we're guaranteed to be on the main dispatcher even though we didn't specify it
// we're guaranteed to be on the main dispatcher even though we didn't specify it
}

}
Expand Down Expand Up @@ -166,7 +166,7 @@ import kotlinx.coroutines.flow.*
class MyActivity : Activity() {

init {
lifecycleScope.launchOnCreate {
dispatchLifecycleScope.launchOnCreate {
viewModel.someFlow.collect {
channel.send("$it")
}
Expand All @@ -175,7 +175,7 @@ class MyActivity : Activity() {
}
```

The [LifecycleCoroutineScope] may be configured with any dispatcher, since
The [DispatchLifecycleScope][DispatchLifecycleScope-class] may be configured with any dispatcher, since
[MainImmediateCoroutineScope] is just a marker interface. Its lifecycle-aware functions *cancel*
when dropping below a threshold, then automatically restart when entering into the desired lifecycle
state again. This is key to preventing the backpressure leak of the AndroidX version, and it's also
Expand Down Expand Up @@ -271,7 +271,7 @@ class MyViewModel : CoroutineViewModel() {
}
```

The [LifecycleCoroutineScope] may be configured with any dispatcher, since
The [DispatchLifecycleScope][DispatchLifecycleScope-class] may be configured with any dispatcher, since
[MainImmediateCoroutineScope] is just a marker interface. Its lifecycle-aware functions *cancel*
when dropping below a threshold, then automatically restart when entering into the desired lifecycle
state again. This is key to preventing the backpressure leak of the AndroidX version, and it's also
Expand Down Expand Up @@ -338,8 +338,8 @@ fun `sayHello should say hello`() = runBlockingProvided {
| **artifact** | **features** |
| -------------------------------------- | ---------------------------------------------- |
| [dispatch-android-espresso] | [IdlingDispatcher] <p> [IdlingDispatcherProvider]
| [dispatch-android-lifecycle-extensions] | [lifecycleScope]
| [dispatch-android-lifecycle] | [LifecycleCoroutineScope] <p> [launchOnCreate] <p> [launchOnStart] <p> [launchOnResume] <p> [onNextCreate] <p> [onNextStart] <p> [onNextResume]
| [dispatch-android-lifecycle-extensions] | [dispatchLifecycleScope][dispatchLifecycleScope-extension]
| [dispatch-android-lifecycle] | [DispatchLifecycleScope][DispatchLifecycleScope-class] <p> [launchOnCreate] <p> [launchOnStart] <p> [launchOnResume] <p> [onNextCreate] <p> [onNextStart] <p> [onNextResume]
| [dispatch-android-viewmodel] | [CoroutineViewModel] <p> [viewModelScope]
| [dispatch-core] | Dispatcher-specific types and factories <p> Dispatcher-specific coroutine builders
| [dispatch-detekt] | [Detekt] rules for common auto-imported-the-wrong-thing problems
Expand All @@ -361,53 +361,44 @@ dependencies {
*/

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

// 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-beta04")

implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.0")

// 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-beta05")
// LifecycleCoroutineScope for Android Fragments, Activities, etc.
implementation("com.rickbusarow.dispatch:dispatch-android-lifecycle:1.0.0-beta04")

implementation("com.rickbusarow.dispatch:dispatch-android-lifecycle:1.0.0-beta05")
// 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-beta04")

implementation("com.rickbusarow.dispatch:dispatch-android-lifecycle-extensions:1.0.0-beta05")
// ViewModelScope for Android ViewModels
implementation("com.rickbusarow.dispatch:dispatch-android-viewmodel:1.0.0-beta04")


implementation("com.rickbusarow.dispatch:dispatch-android-viewmodel:1.0.0-beta05")

/*
jvm testing
*/

// core coroutines-test
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.3.8")

testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.4.0")
// you only need this if you don't have the -junit4 or -junit5 artifacts
testImplementation("com.rickbusarow.dispatch:dispatch-test:1.0.0-beta04")

testImplementation("com.rickbusarow.dispatch:dispatch-test:1.0.0-beta05")
// 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-beta04")

testImplementation("com.rickbusarow.dispatch:dispatch-test-junit4:1.0.0-beta05")
// 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-junit4:1.0.0-beta04")

testImplementation("com.rickbusarow.dispatch:dispatch-test-junit5:1.0.0-beta05")
/*
Android testing
*/

// core android
androidTestImplementation("androidx.test:runner:1.2.0")
androidTestImplementation("androidx.test.espresso:espresso-core:3.2.0")

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-beta04")
androidTestImplementation("com.rickbusarow.dispatch:dispatch-android-espresso:1.0.0-beta05")
}
```

Expand Down Expand Up @@ -474,21 +465,19 @@ limitations under the License.
[IdlingDispatcherProvider]: https://rbusarow.github.io/Dispatch/api/dispatch-android-espresso/dispatch.android.espresso/-idling-dispatcher-provider/index.html
<!--- MODULE dispatch-android-lifecycle-->
<!--- INDEX -->
[LifecycleCoroutineScope]: https://rbusarow.github.io/Dispatch/api/dispatch-android-lifecycle/dispatch.android.lifecycle/-lifecycle-coroutine-scope/index.html
[launchOnCreate]: https://rbusarow.github.io/Dispatch/api/dispatch-android-lifecycle/dispatch.android.lifecycle/-lifecycle-coroutine-scope/launch-on-create.html
[launchOnStart]: https://rbusarow.github.io/Dispatch/api/dispatch-android-lifecycle/dispatch.android.lifecycle/-lifecycle-coroutine-scope/launch-on-start.html
[launchOnResume]: https://rbusarow.github.io/Dispatch/api/dispatch-android-lifecycle/dispatch.android.lifecycle/-lifecycle-coroutine-scope/launch-on-resume.html
[LifecycleScopeFactory]: https://rbusarow.github.io/Dispatch/api/dispatch-android-lifecycle/dispatch.android.lifecycle/index.html#dispatch.android.lifecycle/LifecycleScopeFactory//PointingToDeclaration/
[launchOnCreate]: https://rbusarow.github.io/Dispatch/api/dispatch-android-lifecycle/dispatch.android.lifecycle/-dispatch-lifecycle-scope/launch-on-create.html
[launchOnStart]: https://rbusarow.github.io/Dispatch/api/dispatch-android-lifecycle/dispatch.android.lifecycle/-dispatch-lifecycle-scope/launch-on-start.html
[launchOnResume]: https://rbusarow.github.io/Dispatch/api/dispatch-android-lifecycle/dispatch.android.lifecycle/-dispatch-lifecycle-scope/launch-on-resume.html
[onNextCreate]: https://rbusarow.github.io/Dispatch/api/dispatch-android-lifecycle/dispatch.android.lifecycle/on-next-create.html
[onNextStart]: https://rbusarow.github.io/Dispatch/api/dispatch-android-lifecycle/dispatch.android.lifecycle/on-next-start.html
[onNextResume]: https://rbusarow.github.io/Dispatch/api/dispatch-android-lifecycle/dispatch.android.lifecycle/on-next-resume.html
<!--- MODULE dispatch-android-lifecycle-extensions-->
<!--- INDEX -->
[LifecycleScopeFactory]: https://rbusarow.github.io/Dispatch/api/dispatch-android-lifecycle-extensions/dispatch.android.lifecycle/-lifecycle-scope-factory/index.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-->
<!--- INDEX -->
[CoroutineViewModel]: https://rbusarow.github.io/Dispatch/api/dispatch-android-viewmodel/dispatch.android.viewmodel/-coroutine-view-model/index.html
[viewModelScope]: https://rbusarow.github.io/Dispatch/api/dispatch-android-viewmodel/dispatch.android.viewmodel/-coroutine-view-model/index.html#dispatch.android.viewmodel/CoroutineViewModel/viewModelScope/#/PointingToDeclaration/
[CoroutineViewModel]: https://rbusarow.github.io/Dispatch/api/dispatch-android-viewmodel/dispatch.android.viewmodel/index.html#dispatch.android.viewmodel/CoroutineViewModel//PointingToDeclaration/
[viewModelScope]: https://rbusarow.github.io/Dispatch/api/dispatch-android-viewmodel/dispatch.android.viewmodel/-dispatch-view-model/index.html#dispatch.android.viewmodel/DispatchViewModel/viewModelScope/#/PointingToDeclaration/
[ViewModelScopeFactory]: https://rbusarow.github.io/Dispatch/api/dispatch-android-viewmodel/dispatch.android.viewmodel/-view-model-scope-factory/index.html
<!--- END -->

Expand Down Expand Up @@ -530,3 +519,6 @@ limitations under the License.
[ViewModel.onCleared]: https://developer.android.com/reference/androidx/lifecycle/ViewModel#onCleared()
[ViewModel]: https://developer.android.com/reference/androidx/lifecycle/ViewModel


[DispatchLifecycleScope-class]: https://rbusarow.github.io/Dispatch/api/dispatch-android-lifecycle/dispatch.android.lifecycle/-dispatch-lifecycle-scope/index.html
[dispatchLifecycleScope-extension]: https://rbusarow.github.io/Dispatch/api/dispatch-android-lifecycle-extensions/dispatch.android.lifecycle/index.html#dispatch.android.lifecycle/dispatchLifecycleScope/androidx.lifecycle.LifecycleOwner#/PointingToDeclaration/
Empty file added api/Dispatch.api
Empty file.
Loading

0 comments on commit c3ed048

Please sign in to comment.