Skip to content

Commit

Permalink
introduce a BOM (#222)
Browse files Browse the repository at this point in the history
* introduce a BOM

* update main project README
  • Loading branch information
RBusarow committed May 17, 2021
1 parent 84e791e commit ddf205a
Show file tree
Hide file tree
Showing 29 changed files with 169 additions and 65 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-RC01

* 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))

## Version 1.0.0-beta09

* [CoroutineTestExtension] now creates a new [scope][CoroutineTestExtension.scope] instance for each test.
Expand Down
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,16 +363,19 @@ dependencies {
// core coroutines
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.3")

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

// 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
Expand All @@ -381,15 +384,15 @@ dependencies {
// core coroutines-test
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.4.3")
// 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
19 changes: 10 additions & 9 deletions buildSrc/src/main/kotlin/DocsTasks.kt
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,16 @@ fun File.updateLibraryVersions(): File {
"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(),
"com.rickbusarow.dispatch:dispatch-detekt:1.0.0-RC01".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-android-espresso:1.0.0-RC01".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-android-lifecycle:1.0.0-RC01".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-android-lifecycle-extensions:1.0.0-RC01".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-android-viewmodel:1.0.0-RC01".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-test:1.0.0-RC01".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-test-junit4:1.0.0-RC01".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-test-junit5:1.0.0-RC01".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-bom:1.0.0-RC01".toDependencyMatcher(),
"com.rickbusarow.dispatch:dispatch-core:1.0.0-RC01".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(),
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
5 changes: 3 additions & 2 deletions dispatch-android-espresso/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,10 @@ 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(platform("com.rickbusarow.dispatch:dispatch-bom:1.0.0-RC01"))
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
3 changes: 2 additions & 1 deletion dispatch-android-lifecycle-extensions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ 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(platform("com.rickbusarow.dispatch:dispatch-bom:1.0.0-RC01"))
implementation("com.rickbusarow.dispatch:dispatch-android-lifecycle-extensions")

implementation("androidx.lifecycle:lifecycle-common:2.3.1")
}
Expand Down
3 changes: 2 additions & 1 deletion dispatch-android-lifecycle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ 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(platform("com.rickbusarow.dispatch:dispatch-bom:1.0.0-RC01"))
implementation("com.rickbusarow.dispatch:dispatch-android-lifecycle")
implementation("androidx.lifecycle:lifecycle-common:2.3.1")
}
```
Expand Down
3 changes: 2 additions & 1 deletion dispatch-android-viewmodel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ 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-viewmodel:1.0.0-beta09")
implementation(platform("com.rickbusarow.dispatch:dispatch-bom:1.0.0-RC01"))
implementation("com.rickbusarow.dispatch:dispatch-android-viewmodel")
}
```

Expand Down
50 changes: 50 additions & 0 deletions dispatch-bom/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Copyright (C) 2021 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 {
`java-platform`
id("com.vanniktech.maven.publish")
}

version = libs.versions.versionName.get()

val bomProject = project

rootProject
.subprojects
.filter { it.includeInBom() }
.forEach { bomProject.evaluationDependsOn(it.path) }

dependencies {
constraints {
rootProject
.subprojects
.filter { it.includeInBom() }
.forEach { api(project(it.path)) }
}
}

publishing {
publications {
create<MavenPublication>("DispatchBom") {
from(components["javaPlatform"])
}
}
}


fun Project.includeInBom() = !path.contains("sample") &&
!path.contains("internal") &&
this != bomProject
17 changes: 17 additions & 0 deletions dispatch-bom/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#
# Copyright (C) 2021 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.
#
POM_ARTIFACT_ID=dispatch-bom
POM_NAME=dispatch-bom
POM_PACKAGING=jar
3 changes: 2 additions & 1 deletion dispatch-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ 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-core:1.0.0-beta09")
implementation(platform("com.rickbusarow.dispatch:dispatch-bom:1.0.0-RC01"))
implementation("com.rickbusarow.dispatch:dispatch-core")
}
```

Expand Down
3 changes: 2 additions & 1 deletion dispatch-detekt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ allprojects {
dependencies {
detekt("io.gitlab.arturbosch.detekt:detekt-cli:1.16.0")

detektPlugins("com.rickbusarow.dispatch:dispatch-detekt:1.0.0-beta09")
implementation(platform("com.rickbusarow.dispatch:dispatch-bom:1.0.0-RC01"))
detektPlugins("com.rickbusarow.dispatch:dispatch-detekt")
}
}
```
Expand Down
11 changes: 6 additions & 5 deletions dispatch-test-junit4/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ 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(platform("com.rickbusarow.dispatch:dispatch-bom:1.0.0-RC01"))
implementation("com.rickbusarow.dispatch:dispatch-core")

// the junit4 artifact also provides the dispatch-test artifact
testImplementation("com.rickbusarow.dispatch:dispatch-test-junit4:1.0.0-beta09")
testImplementation("com.rickbusarow.dispatch:dispatch-test-junit4")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.4.3")
}
```
Expand All @@ -97,11 +98,11 @@ 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("com.rickbusarow.dispatch:dispatch-core:1.0.0-RC01")

// the junit4 and junit5 artifacts also provides the dispatch-test artifact
testImplementation("com.rickbusarow.dispatch:dispatch-test-junit4:1.0.0-beta09")
testImplementation("com.rickbusarow.dispatch:dispatch-test-junit5:1.0.0-beta09")
testImplementation("com.rickbusarow.dispatch:dispatch-test-junit4:1.0.0-RC01")
testImplementation("com.rickbusarow.dispatch:dispatch-test-junit5:1.0.0-RC01")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.4.3")
}
```
Expand Down
11 changes: 6 additions & 5 deletions dispatch-test-junit5/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,11 @@ 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(platform("com.rickbusarow.dispatch:dispatch-bom:1.0.0-RC01"))
implementation("com.rickbusarow.dispatch:dispatch-core")

// the junit5 artifact also provides the dispatch-test artifact
testImplementation("com.rickbusarow.dispatch:dispatch-test-junit5:1.0.0-beta09")
testImplementation("com.rickbusarow.dispatch:dispatch-test-junit5")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.4.3")
testImplementation("org.junit.jupiter:junit-jupiter:5.7.1")
}
Expand All @@ -128,11 +129,11 @@ 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("com.rickbusarow.dispatch:dispatch-core:1.0.0-RC01")

// the junit4 and junit5 artifacts also provides the dispatch-test artifact
testImplementation("com.rickbusarow.dispatch:dispatch-test-junit4:1.0.0-beta09")
testImplementation("com.rickbusarow.dispatch:dispatch-test-junit5:1.0.0-beta09")
testImplementation("com.rickbusarow.dispatch:dispatch-test-junit4:1.0.0-RC01")
testImplementation("com.rickbusarow.dispatch:dispatch-test-junit5:1.0.0-RC01")
testImplementation("org.junit.jupiter:junit-jupiter:5.7.1")
testImplementation("org.junit.vintage:junit-vintage-engine:5.7.1")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.4.3")
Expand Down
5 changes: 3 additions & 2 deletions dispatch-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,10 @@ 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(platform("com.rickbusarow.dispatch:dispatch-bom:1.0.0-RC01"))
implementation("com.rickbusarow.dispatch:dispatch-core")

testImplementation("com.rickbusarow.dispatch:dispatch-test:1.0.0-beta09")
testImplementation("com.rickbusarow.dispatch:dispatch-test")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.4.3")
}
```
Expand Down
5 changes: 5 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change log for Dispatch

## Version 1.0.0-RC01

* 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))

## Version 1.0.0-beta09

* [CoroutineTestExtension] now creates a new [scope][CoroutineTestExtension.scope] instance for each test.
Expand Down
5 changes: 3 additions & 2 deletions docs/dispatch-android-espresso.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,10 @@ 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(platform("com.rickbusarow.dispatch:dispatch-bom:1.0.0-RC01"))
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
3 changes: 2 additions & 1 deletion docs/dispatch-android-lifecycle-extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ 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(platform("com.rickbusarow.dispatch:dispatch-bom:1.0.0-RC01"))
implementation("com.rickbusarow.dispatch:dispatch-android-lifecycle-extensions")

implementation("androidx.lifecycle:lifecycle-common:2.3.1")
}
Expand Down
3 changes: 2 additions & 1 deletion docs/dispatch-android-lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ 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(platform("com.rickbusarow.dispatch:dispatch-bom:1.0.0-RC01"))
implementation("com.rickbusarow.dispatch:dispatch-android-lifecycle")
implementation("androidx.lifecycle:lifecycle-common:2.3.1")
}
```
Expand Down
3 changes: 2 additions & 1 deletion docs/dispatch-android-viewmodel.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ 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-viewmodel:1.0.0-beta09")
implementation(platform("com.rickbusarow.dispatch:dispatch-bom:1.0.0-RC01"))
implementation("com.rickbusarow.dispatch:dispatch-android-viewmodel")
}
```

Expand Down
3 changes: 2 additions & 1 deletion docs/dispatch-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ 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-core:1.0.0-beta09")
implementation(platform("com.rickbusarow.dispatch:dispatch-bom:1.0.0-RC01"))
implementation("com.rickbusarow.dispatch:dispatch-core")
}
```

Expand Down
3 changes: 2 additions & 1 deletion docs/dispatch-detekt.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ allprojects {
dependencies {
detekt("io.gitlab.arturbosch.detekt:detekt-cli:1.16.0")

detektPlugins("com.rickbusarow.dispatch:dispatch-detekt:1.0.0-beta09")
implementation(platform("com.rickbusarow.dispatch:dispatch-bom:1.0.0-RC01"))
detektPlugins("com.rickbusarow.dispatch:dispatch-detekt")
}
}
```
Expand Down
Loading

0 comments on commit ddf205a

Please sign in to comment.