Dylan Bolger
06/04/2024, 12:30 PMapi declared dependencies without digging into the buildscript, but instead referring to the resolution. I understand this won't be foolproof.
The issue I'm having is that when I try to resolve the current project in a detachedConfiguration, it either fails to resolve, or it doesn't show any exposed dependencies, despite having a api dependency on gson.
def detached = project.configurations.detachedConfiguration()
def dep = project.dependencies.project(path: ":${project.path}", configuration: detached)
detached.dependencies.add(dep)Vampire
06/04/2024, 12:34 PM--scan, or the dependencies task.
If this is about investigating whether your dependencies are declared in the "correct" configurations, I recommend using the https://github.com/autonomousapps/dependency-analysis-gradle-pluginDylan Bolger
06/04/2024, 12:36 PMVampire
06/04/2024, 12:37 PMVampire
06/04/2024, 12:38 PMDylan Bolger
06/04/2024, 12:39 PMVampire
06/04/2024, 12:44 PMVampire
06/04/2024, 12:45 PMDylan Bolger
06/04/2024, 12:46 PMVampire
06/04/2024, 12:49 PMrelease, sourceCompatibility, or targetCompatibility). For the Java 11, you just ensure that you run Gradle with Java 11. In Gradle 8.8 is a new incubating feature that you can indeed also use a discovered toolchain for running Gradle.Dylan Bolger
06/04/2024, 12:52 PMDylan Bolger
06/04/2024, 12:53 PMDylan Bolger
06/04/2024, 12:56 PMA dependency was declared on configuration 'configuration ':myProject:detachedConfiguration1'' which is not declared in the descriptor for project :myProject.Dylan Bolger
06/04/2024, 1:17 PMdetached.name as the the configuration for the dependency which seems to resolve now, the only issue is that it seems to be circularly showing up as a dependency when debugging the dependency. Basically the `resolutionResult`'s dependencies has my project reference, but it's dependencies (ResolvedDependencyResult.dependencies) only lists itself.Dylan Bolger
06/04/2024, 1:18 PMdep object I created in the first code block I sent is considered transitive too... so I'm unsure why this wouldn't provide all of the compile dependencies required.Vampire
06/04/2024, 1:23 PMDylan Bolger
06/04/2024, 1:31 PM:myProjectDylan Bolger
06/04/2024, 1:32 PMVampire
06/04/2024, 1:35 PMVampire
06/04/2024, 1:36 PMcompileClasspath configuration for example.Dylan Bolger
06/04/2024, 1:39 PMapi dependency while debugging. I don't see anything that would represent that, but I know sometimes my debugger doesn't report all available objects for some reason.Dylan Bolger
06/04/2024, 1:53 PMapi - API dependencies for the 'main' feature. (n)
\--- com.google.code.gson:gson:2.7 (n)Vampire
06/04/2024, 2:21 PMapi is not a resolvable configuration, so you cannot directly resolve it.
If you want to know what is only in api or the configurations it extends, you probably have to add a new resolvable configuration that only extends from api and has the necessary attributes set.Vampire
06/04/2024, 2:21 PMVampire
06/04/2024, 2:22 PMDylan Bolger
06/04/2024, 2:24 PMapi configuration, rather I just need to know what dependencies are declared in the api configuration. This became much more trivial:
project.configurations.named(JavaPlugin.API_CONFIGURATION_NAME).get().dependenciesDylan Bolger
06/04/2024, 2:26 PMVampire
06/04/2024, 2:31 PM