I've created new Kotlin project under Gradle. By default it sets this dependencies to the Kotlin-library project. And I wonder what does this kotlin-bom lib do ?
dependencies {
// Align versions of all Kotlin components
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
// Use the Kotlin JDK 8 standard library.
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
// Use the Kotlin test library.
testImplementation("org.jetbrains.kotlin:kotlin-test")
// Use the Kotlin JUnit integration.
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
}
Kotlin Libraries Bill of Materials Kotlin is a statically typed programming language that compiles to JVM byte codes and JavaScript. License. Apache 2.0. Tags. bomkotlin.
An Android library is structurally the same as an Android app module. It can include everything needed to build an app, including source code, resource files, and an Android manifest.
The kotlin-bom
artifact is a dependency-only POM that aligns all the Kotlin SDK libraries with the same version.
See the POM content for version 1.5.31 for an example. It uses the POM's dependencyManagement
section to depend on the same version of all the Kotlin SDK artifacts, like kotlin-stdlib
, kotlin-stdlib-jdk8
, kotlin-reflect
, kotlin-test
, etc.
Description of a BOM:
Software bill of materials (BOMs) don’t specify a dependency on a module or file, but instead are a list of version constraints for other components. They define what is called a platform, which is basically a list of components with specific versions that are known to play well together and/or form a useful unit of functionality. It’s worth mentioning that not all of the dependencies listed in the BOM actually have to be included in your projects — it’s basically a way of saying “If you use any of these modules, use this version”.
-- A deep dive into an initial Kotlin build.gradle.kts
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With