Tooling and Project Concepts
Dependency Scope Model
Dependency scope records whether a library is needed by production code, tests, or both.
Dependency Scope Model
DependencyScopeModel.kt
fun main() {
val scope =
val dependency = mapOf(
"group" to "org.example",
"name" to "toolkit",
"version" to "1.2.0"
)
val coordinate = "${dependency["group"]}:${dependency["name"]}:${dependency["version"]}"
val packaged = scope == "implementation" || scope == "runtimeOnly"
println("scope=$scope")
println("coordinate=$coordinate")
println("packaged=$packaged")
}
fun main() {
val scope =
val dependency = mapOf(
"group" to "org.example",
"name" to "toolkit",
"version" to "1.2.0"
)
val coordinate = "${dependency["group"]}:${dependency["name"]}:${dependency["version"]}"
val packaged = scope == "implementation" || scope == "runtimeOnly"
println("scope=$scope")
println("coordinate=$coordinate")
println("packaged=$packaged")
}
fun main() {
val scope =
val dependency = mapOf(
"group" to "org.example",
"name" to "toolkit",
"version" to "1.2.0"
)
val coordinate = "${dependency["group"]}:${dependency["name"]}:${dependency["version"]}"
val packaged = scope == "implementation" || scope == "runtimeOnly"
println("scope=$scope")
println("coordinate=$coordinate")
println("packaged=$packaged")
}
dependency scope
Scope keeps dependency intent visible so a test helper does not become part of the runtime artifact.