Hi there, I'm one of the maintainers of the <OSS R...
# kotlin-toolchain
s
Hi there, I'm one of the maintainers of the OSS Review Toolikit (ORT), an open-source suite of tools to automate software compliance checks. One of ORT's features is to perform Software Composition Analysis (SCA) für various build systems / package managers. With us maintainers being Kotlin fans (Did I mention that ORT is written in 100% Kotlin?), I'm interested in adding Amper support to ORT's analyzer. As Amper is supposed to have a focus on tooling, I wonder, are there any means yet in Amper to get the dependency graph and metadata about the used dependencies in a machine readable format? FYI, the data that ORT's analyzer collects about projects looks similar to this.
j
Hi! Thanks for your interest, that's an interesting topic. There are mainly 2 ways to go about this: 1.
./amper show dependencies
is currently for humans, but we'll add some truly machine-readable format too (maybe JSON). Not yet available. cc @abarsov 2. If you're using kotlin, you could technically use the Amper frontend libraries to parse the config files and get the model, and if you need dependency resolution to get the full graph, it's also in the form of a library. This approach is a bit more involved, and might change a bit unexpectedly for now (not a stable API), but also gives more complete info.
s
Regarding 2., is Amper internally using the maven-resolver library or such?
j
We have implemented our own resolution that also knows Kotlin multiplatform, and is fully parallel
s
Interesting. I guess that's the "it's also in the form of a library" thing you were talking about... is this library already published on Maven Central?
j
Not to maven central (yet?) but to our public repo: https://packages.jetbrains.team/maven/p/amper/amper
👍🏻 1
s
Thanks, I need to investigate this some more, e.g. how you've implemented version conflict resolution, Maven-style (nearest) or Gradle-style (latest), etc.
j
Conflict resolution is "highest version wins", so like Gradle does
Here are the coordinates by the way:
Copy code
org.jetbrains.amper:dependency-resolution:0.10.0-dev-3534
We haven't polished the API, and we didn't prepare it for external use yet, so I have to add a disclaimer that it won't be documented and might change without notice.
👍🏻 1
Just to make sure this is clear, we definitely intend to provide machine-readable dependency info, especially for the purpose of auditing security and licensing issues. This will be in the form of some extra option(s) to
./amper show dependencies
.
s
Great. Is this also something where you would accept contribution to Amper, or something that you'd prefer to design yourself, at least initially?
j
I think it would be easier to wait for a little bit. We have a bunch of parts that are quickly changing, and slowly moving into place, and external contributions will be hard to process in this context. We also haven't setup the CI for GitHub PRs yet, and we have limited bandwidth, so it would be quite slow. We'll make it easier to contribute directly in the medium term. But at the moment the best way to contribute is rather to open issues or voice your needs here, exactly like you did. It's quite valuable!
👍🏻 1