What does this library depend on when developing on Android or in a JVM language such as Java? You often think that, right?
How do you guys check?
I think there are various things such as looking at sites such as https://mvnrepository.com/ and checking with ./gradlew dependencies
.
Today, I would like to introduce a CLI tool called Coursier written in Scala that was useful. https://get-coursier.io/
You can check it on the terminal like coursier resolve maven_artifact
$ coursier resolve io.circe:circe-core_2.12:0.10.0
io.circe:circe-core_2.12:0.10.0:default
io.circe:circe-numbers_2.12:0.10.0:default
org.scala-lang:scala-library:2.12.6:default
org.scala-lang:scala-reflect:2.12.6:default
org.typelevel:cats-core_2.12:1.4.0:default
org.typelevel:cats-kernel_2.12:1.4.0:default
org.typelevel:cats-macros_2.12:1.4.0:default
org.typelevel:machinist_2.12:0.6.5:default
You can also check the dependencies in a tree shape with -t
.
$ cs resolve -t io.circe::circe-generic:0.12.3
Result:
└─ io.circe:circe-generic_2.13:0.12.3
├─ com.chuusai:shapeless_2.13:2.3.3
│ └─ org.scala-lang:scala-library:2.13.0
├─ io.circe:circe-core_2.13:0.12.3
│ ├─ io.circe:circe-numbers_2.13:0.12.3
│ │ └─ org.scala-lang:scala-library:2.13.0
│ ├─ org.scala-lang:scala-library:2.13.0
It seems that you can install it on Mac as follows. https://get-coursier.io/docs/cli-installation
brew install coursier/formulas/coursier
To see the Google Maven Reposiotry, which is indispensable for Android development, do the following.
cs resolve -t -r https://maven.google.com -r https://jcenter.bintray.com androidx.ui:ui-livedata:0.1.0-dev12|view -
└─ androidx.ui:ui-livedata:0.1.0-dev12
├─ androidx.compose:compose-runtime:0.1.0-dev12
│ ├─ androidx.annotation:annotation:1.1.0
│ ├─ org.jetbrains.kotlin:kotlin-stdlib:^[[33m1.3.70 -> 1.3.71^[[0m
│ │ ├─ org.jetbrains:annotations:13.0
│ │ └─ org.jetbrains.kotlin:kotlin-stdlib-common:1.3.71
│ ├─ org.jetbrains.kotlin:kotlin-stdlib-common:^[[33m1.3.70 -> 1.3.71^[[0m
│ ├─ org.jetbrains.kotlinx:kotlinx-collections-immutable-jvm:0.3
│ │ ├─ org.jetbrains.kotlin:kotlin-stdlib:^[[33m1.3.50 -> 1.3.71^[[0m
│ │ │ ├─ org.jetbrains:annotations:13.0
│ │ │ └─ org.jetbrains.kotlin:kotlin-stdlib-common:1.3.71
│ │ └─ org.jetbrains.kotlin:kotlin-stdlib-common:^[[33m1.3.50 -> 1.3.71^[[0m
│ ├─ org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.6
│ │ ├─ org.jetbrains.kotlin:kotlin-stdlib:1.3.71
│ │ │ ├─ org.jetbrains:annotations:13.0
It seemed convenient because it was easy to check when checking the dependency. In addition to checking the dependencies, it was convenient because there was a function to make it into a jar and a function to start it, so please check the official website. https://get-coursier.io/docs/overview
Recommended Posts