Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
279 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/internal/DependencyGroup.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package de.fayard.refreshVersions.core.internal | ||
|
||
import org.gradle.kotlin.dsl.IsNotADependency | ||
|
||
@InternalRefreshVersionsApi | ||
open class DependencyGroup( | ||
val group: String, | ||
val rule: ArtifactVersionKeyRule? = null, | ||
var usePlatformConstraints: Boolean = false | ||
) : IsNotADependency { | ||
companion object { | ||
val ALL = mutableListOf<DependencyGroup>() | ||
val ALL_RULES: List<ArtifactVersionKeyRule> | ||
get() = ALL.mapNotNull { it.rule } | ||
} | ||
|
||
init { | ||
ALL.add(this) | ||
} | ||
|
||
fun module(module: String): String { | ||
assert(module.trim() == module) | ||
assert(module.contains(":").not()) | ||
return "$group:$module" + if (usePlatformConstraints) "" else ":_" | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
plugins/dependencies/src/main/kotlin/dependencies/Kodein.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
@file:Suppress("PackageDirectoryMismatch", "SpellCheckingInspection", "unused") | ||
|
||
import de.fayard.refreshVersions.core.internal.ArtifactVersionKeyRule | ||
import de.fayard.refreshVersions.core.internal.DependencyGroup | ||
import org.gradle.api.Incubating | ||
|
||
/** | ||
* painless Kotlin dependency injection | ||
* | ||
* - [Official website here](https://kodein.org/di/) | ||
* - GitHub page: [Kodein-Framework/Kodein-DI](https://github.com/Kodein-Framework/Kodein-DI) | ||
* - [GitHub Releases here](https://github.com/Kodein-Framework/Kodein-DI/releases) | ||
*/ | ||
|
||
@Incubating | ||
object Kodein { | ||
|
||
|
||
val di = DI() | ||
|
||
class DI : DependencyGroup( | ||
group = "org.kodein.di", | ||
rule = ArtifactVersionKeyRule( | ||
artifactPattern = " org.kodein.di:kodein-di(-*)", | ||
versionKeyPattern = " ^^^^^^^^^ " | ||
) | ||
) { | ||
val androidCore = module("kodein-di-framework-android-core") | ||
val androidSupport = module("kodein-di-framework-android-support") | ||
val androidx = module("kodein-di-framework-android-x") | ||
val configurableJS = module("kodein-di-conf-js") | ||
val configurableJvm = module("kodein-di-conf-jvm") | ||
val js = module("kodein-di-js") | ||
val jsr330 = module("kodein-di-jxinject-jvm") | ||
val ktor = module("kodein-di-framework-ktor-server-jvm") | ||
val tornadofx = module("kodein-di-framework-tornadofx-jvm") | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package dependencies | ||
|
||
import AndroidX | ||
import COIL | ||
import CashApp | ||
import Firebase | ||
import Google | ||
import JakeWharton | ||
import Kodein | ||
import Kotlin | ||
import KotlinX | ||
import Ktor | ||
import Orchid | ||
import Splitties | ||
import Square | ||
import Testing | ||
|
||
internal val ALL_DEPENDENCIES_NOTATIONS = listOf( | ||
AndroidX, | ||
CashApp, | ||
Google, | ||
JakeWharton, | ||
Firebase, | ||
Kodein, | ||
Kotlin, | ||
KotlinX, | ||
Splitties, | ||
Square, | ||
Ktor, | ||
Testing, | ||
COIL, | ||
Kodein, | ||
Orchid | ||
) |
5 changes: 5 additions & 0 deletions
5
...s/dependencies/src/main/resources/refreshVersions-rules/dependency-groups-alias-rules.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
org.kodein.di:kodein-di(-*) | ||
^^^^^^^^^ | ||
|
||
io.github.javaeden.orchid:* | ||
^^^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,3 @@ io.ktor:* | |
|
||
io.coil-kt:coil(-*) | ||
^^^^^^^ | ||
|
||
io.github.javaeden.orchid:* | ||
^^^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.