Slackbot
01/12/2023, 1:19 AMVampire
01/12/2023, 7:33 AMsubprojects
should be fine too and not disturb project isolation.Eli Graber
01/12/2023, 2:19 PMprojects.foo
With subprojects
I'm using the path to do that.Vampire
01/12/2023, 2:31 PMfoo:projectHealth
to only see the results for foo
project.Eli Graber
01/12/2023, 2:58 PMVampire
01/12/2023, 4:05 PMdependencyAnalysis { dependencies {
just for defining bundles?Eli Graber
01/12/2023, 4:12 PMdependencies {
implementation(projects.foo)
}
The analysis plugin isn't able to remove them if it detects that it is unused, because it looks for project(":foo")
.
So I'm doing:
// Adds the project accessor form to be used when printing advice and rewriting build scripts.
subprojects.forEach { subproject ->
val projectAccessor = <http://CaseFormat.LOWER_HYPHEN.to|CaseFormat.LOWER_HYPHEN.to>(CaseFormat.LOWER_CAMEL, subproject.path.replace(':', '.'))
map.put(subproject.path, "projects$projectAccessor")
}
and now the plugin can properly remove them.Vampire
01/12/2023, 4:37 PMsubprojects
regarding project isolation?
I'd either expect both to work or both to make problems.Vampire
01/12/2023, 4:40 PMEli Graber
01/12/2023, 4:40 PMEli Graber
01/12/2023, 4:40 PMEli Graber
01/12/2023, 4:41 PMVampire
01/12/2023, 4:44 PMVampire
01/12/2023, 4:47 PMexclude
I guess you should open another issue with your problem, so that it can hopefully be fixed at some point within the plugin.
There is no possibility that I'm aware of to list the project accessors, other than using reflection.
For the version catalogs there was initially also no way to list them, but it was added later. So maybe also worth a feature request to Gradle.
But actually I still would assume that either both work with project isolation or both don't. But I didn't do much with project isolation so far, so I don't know.Eli Graber
01/12/2023, 5:21 PMsubprojects.forEach { it.path }
actually a violation of project isolation, or will it become one in the future?Javi
01/12/2023, 5:23 PMallprojects
too)Eli Graber
01/12/2023, 5:26 PMEli Graber
01/12/2023, 5:34 PMVampire
01/12/2023, 5:37 PMprojects::class
.java
.methods
.filter { ProjectDependency::class.java.isAssignableFrom(it.returnType) }
.map { it.name.removePrefix("get").decapitalize() }
Eli Graber
01/12/2023, 5:38 PMVampire
01/12/2023, 5:39 PM