is it "safe" to have a composite build included in...
# refreshversions
n
is it "safe" to have a composite build included in which i use the
versions.properties
file of the outer project?
Copy code
bootstrapRefreshVersions(
    listOf(rootDir.parentFile.resolve("buildSrc/dependencies-rules.txt").readText()),
    rootDir.parentFile.resolve("versions.properties")
)
l
Only if the main project or one of it's subprojects (the one that includes the other builds) uses these dependencies. Otherwise, running refreshVersions will remove them since their usage from the included build will not be detected. Note that I'd like to support includedBuilds. If you want to speed up its release, feel free to explore options or give ideas on how to do it, considering it's worth your time relative to your priorities.
n
the included build only uses a subset of the depednencies from the main project, all plugin dependencies i mght need to add kotlin-poet though, which i have no use for in the main project
l
@Nikky You can create an unused configuration and add the dependency in it in the main project.
n
true, the main project also never gets compiled or published itself
@louiscad does refreshVersion add any dummy configuration or so ? if not which one would you recommend for this usecase ?
l
@Nikky No it doesn't (it used to do a long time ago). You can name it "mark_dependencies_used_in_included_builds_for_refreshVersions_until_proper_support"
Or something shorter 😄
n
i named it
dummy
Copy code
val dummy = configurations.create("dummy") {
    isCanBeConsumed = true
}

dependencies {
    add(dummy.name, "com.squareup:kotlinpoet:_")
}
not sure why that works but it does and i don't question gradle weirdness anymore
l
You can (should?) probably add an exploanatory comment next to it linking here: https://github.com/jmfayard/refreshVersions/issues/205