Skip to content

Commit

Permalink
1.0.0 beta08 (#201)
Browse files Browse the repository at this point in the history
* remove FlowCancellationException - fixes #196 (#197)

* update Gradle to 6.8 rc1 (#198)

* Platform convention plugins (#199)

* update Gradle to 6.8 rc1

* add platform convention plugins

* update Kotlin to 1.4.21 (#200)

* update version to 1.0.0-beta08

* Update CHANGELOG.md
  • Loading branch information
RBusarow committed Dec 14, 2020
1 parent c739609 commit 10366e0
Show file tree
Hide file tree
Showing 52 changed files with 316 additions and 346 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change log for Dispatch

## Version 1.0.0-beta08

* Remove FlowCancellationException ([#196](https://github.com/RBusarow/Dispatch/issues/196))
* Update Kotlin to [1.4.21](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md#1421)

## Version 1.0.0-beta07

* Update to coroutines to [1.4.2](https://github.com/Kotlin/kotlinx.coroutines/releases/tag/1.4.2)
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,14 +365,14 @@ dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.2")

// 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-beta07")
implementation("com.rickbusarow.dispatch:dispatch-core:1.0.0-beta08")
// LifecycleCoroutineScope for Android Fragments, Activities, etc.
implementation("com.rickbusarow.dispatch:dispatch-android-lifecycle:1.0.0-beta07")
implementation("com.rickbusarow.dispatch:dispatch-android-lifecycle:1.0.0-beta08")
// 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-beta07")
implementation("com.rickbusarow.dispatch:dispatch-android-lifecycle-extensions:1.0.0-beta08")
// ViewModelScope for Android ViewModels
implementation("com.rickbusarow.dispatch:dispatch-android-viewmodel:1.0.0-beta07")
implementation("com.rickbusarow.dispatch:dispatch-android-viewmodel:1.0.0-beta08")

/*
jvm testing
Expand All @@ -381,15 +381,15 @@ dependencies {
// core coroutines-test
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.4.2")
// you only need this if you don't have the -junit4 or -junit5 artifacts
testImplementation("com.rickbusarow.dispatch:dispatch-test:1.0.0-beta07")
testImplementation("com.rickbusarow.dispatch:dispatch-test:1.0.0-beta08")
// 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-beta07")
testImplementation("com.rickbusarow.dispatch:dispatch-test-junit4:1.0.0-beta08")
// 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-beta07")
testImplementation("com.rickbusarow.dispatch:dispatch-test-junit5:1.0.0-beta08")
/*
Android testing
*/
Expand All @@ -398,7 +398,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-beta07")
androidTestImplementation("com.rickbusarow.dispatch:dispatch-android-espresso:1.0.0-beta08")
}
```

Expand Down
57 changes: 0 additions & 57 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -136,37 +136,6 @@ subprojects {
}
}

allprojects {
// force Java 8 source when building java-only artifacts. This is different than the Kotlin jvm target.
pluginManager.withPlugin("java") {
configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
}


subprojects {
tasks.withType<KotlinCompile>()
.configureEach {

kotlinOptions {
allWarningsAsErrors = true

jvmTarget = "1.8"

// https://youtrack.jetbrains.com/issue/KT-24946
// freeCompilerArgs = listOf(
// "-progressive",
// "-Xskip-runtime-version-check",
// "-Xdisable-default-scripting-plugin",
// "-Xuse-experimental=kotlin.Experimental"
// )
}
}
}

val cleanDocs by tasks.registering {

description = "cleans /docs"
Expand Down Expand Up @@ -292,32 +261,6 @@ val sortDependencies by tasks.registering {
}
}

subprojects {

// force update all transitive dependencies (prevents some library leaking an old version)
configurations.all {
resolutionStrategy {
force(
Libs.Kotlin.reflect,
// androidx is currently leaking coroutines 1.1.1 everywhere
Libs.Kotlinx.Coroutines.core,
Libs.Kotlinx.Coroutines.test,
Libs.Kotlinx.Coroutines.android,
// prevent dependency libraries from leaking their own old version of this library
Libs.RickBusarow.Dispatch.core,
Libs.RickBusarow.Dispatch.detekt,
Libs.RickBusarow.Dispatch.espresso,
Libs.RickBusarow.Dispatch.lifecycle,
Libs.RickBusarow.Dispatch.lifecycleExtensions,
Libs.RickBusarow.Dispatch.viewModel,
Libs.RickBusarow.Dispatch.Test.core,
Libs.RickBusarow.Dispatch.Test.jUnit4,
Libs.RickBusarow.Dispatch.Test.jUnit5
)
}
}
}

dependencyAnalysis {
issues {
all {
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies {

compileOnly(gradleApi())

implementation("org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.20") // update Dependencies.kt as well
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.20") // update Dependencies.kt as well
implementation("org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.21") // update Dependencies.kt as well
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21") // update Dependencies.kt as well
implementation("com.android.tools.build:gradle:4.1.0") // update Dependencies.kt as well
}
58 changes: 58 additions & 0 deletions buildSrc/src/main/kotlin/Common.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Copyright (C) 2020 Rick Busarow
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

@file:Suppress("LongMethod", "TopLevelPropertyNaming")

import org.gradle.api.*
import org.gradle.kotlin.dsl.*
import org.jetbrains.kotlin.gradle.tasks.*

fun Project.common() {

tasks.withType<KotlinCompile>()
.configureEach {

kotlinOptions {

allWarningsAsErrors = true

jvmTarget = "1.8"
}
}

// force update all transitive dependencies (prevents some library leaking an old version)
configurations.all {
resolutionStrategy {
force(
Libs.Kotlin.reflect,
// androidx is currently leaking coroutines 1.1.1 everywhere
Libs.Kotlinx.Coroutines.core,
Libs.Kotlinx.Coroutines.test,
Libs.Kotlinx.Coroutines.android,
// prevent dependency libraries from leaking their own old version of this library
Libs.RickBusarow.Dispatch.core,
Libs.RickBusarow.Dispatch.detekt,
Libs.RickBusarow.Dispatch.espresso,
Libs.RickBusarow.Dispatch.lifecycle,
Libs.RickBusarow.Dispatch.lifecycleExtensions,
Libs.RickBusarow.Dispatch.viewModel,
Libs.RickBusarow.Dispatch.Test.core,
Libs.RickBusarow.Dispatch.Test.jUnit4,
Libs.RickBusarow.Dispatch.Test.jUnit5
)
}
}

}
68 changes: 68 additions & 0 deletions buildSrc/src/main/kotlin/CommonAndroid.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Copyright (C) 2020 Rick Busarow
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

@file:Suppress("LongMethod")

import com.android.build.gradle.*
import org.gradle.api.*
import org.gradle.api.JavaVersion.*
import org.gradle.kotlin.dsl.*
import java.io.*

fun Project.commonAndroid() {

configure<TestedExtension> {
compileSdkVersion(Versions.compileSdk)

defaultConfig {
minSdkVersion(Versions.minSdk)
targetSdkVersion(Versions.targetSdk)
versionName = Versions.versionName

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}

compileOptions {
sourceCompatibility = VERSION_1_8
targetCompatibility = VERSION_1_8
}

lintOptions {
disable("ObsoleteLintCustomCheck")
disable("MissingTranslation")
enable("InvalidPackage")
enable("Interoperability")
isAbortOnError = true
baselineFile = File("$projectDir/lint-baseline.xml")
}

testOptions {
unitTests.isIncludeAndroidResources = true
unitTests.isReturnDefaultValues = true
animationsDisabled = true
}
}
}

4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ object Versions {
const val benManes = "0.33.0"
const val gradleWrapper = "4.1.0"
const val dagger = "2.25.2"
const val kotlin = "1.4.20"
const val kotlin = "1.4.21"
const val mavenPublish = "0.13.0"

const val taskTree = "1.5"
const val versionName = "1.0.0-beta07"
const val versionName = "1.0.0-beta08"
}

object BuildPlugins {
Expand Down
28 changes: 28 additions & 0 deletions buildSrc/src/main/kotlin/androidLibrary.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright (C) 2020 Rick Busarow
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

apply(plugin = "com.android.library")
apply(plugin = "org.jetbrains.kotlin.android")

commonAndroid()
common()

val testJvm by tasks.registering {
dependsOn("testDebugUnitTest")
}

val buildTests by tasks.registering {
dependsOn("assembleDebugUnitTest")
}
41 changes: 41 additions & 0 deletions buildSrc/src/main/kotlin/javaLibrary.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright (C) 2020 Rick Busarow
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

plugins {
kotlin("jvm")
}

common()

java {
// force Java 8 source when building java-only artifacts.
// This is different than the Kotlin jvm target.
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

val testJvm by tasks.registering {
dependsOn("test")
}

val buildTests by tasks.registering {
dependsOn("testClasses")
}

dependencies {

api(Libs.Kotlinx.Coroutines.core)
api(Libs.Kotlinx.Coroutines.coreJvm)
}
4 changes: 2 additions & 2 deletions dispatch-android-espresso/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ dependencies {
// core
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.2")
implementation("com.rickbusarow.dispatch:dispatch-core:1.0.0-beta07")
implementation("com.rickbusarow.dispatch:dispatch-core:1.0.0-beta08")

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

// android
androidTestImplementation("androidx.test:runner:1.3.0")
Expand Down
22 changes: 1 addition & 21 deletions dispatch-android-espresso/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,11 @@
*/

plugins {
id(Plugins.androidLibrary)
kotlin("android")
androidLibrary
id(Plugins.mavenPublish)
id(Plugins.dokka)
}

android {
compileSdkVersion(Versions.compileSdk)

defaultConfig {
minSdkVersion(Versions.minSdk)
targetSdkVersion(Versions.targetSdk)
versionName = Versions.versionName

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
}

dependencies {

api(Libs.AndroidX.Test.Espresso.idlingResource)
Expand Down

0 comments on commit 10366e0

Please sign in to comment.