-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow injection of dependency versions from command line for central declaration of dependencies #17251
Comments
I think because
And the So the |
I am currently doing this: // gradle.properties
javierscGradlePlugins=0.1.0-alpha.30 // buildSrc/settings.gradle.kts
val input = FileInputStream(file("../gradle.properties"))
val properties = Properties().apply { load(input) }
input.close()
val javierscGradlePlugins: String = properties.getProperty("javierscGradlePlugins")
dependencyResolutionManagement {
repositories {
mavenCentral()
}
versionCatalogs {
create("pluginLibs") {
from(files("../plugins-catalog/build/catalogs/libs.versions.toml"))
version("javierscGradlePlugins", javierscGradlePlugins)
}
}
} In my case I am not overriding it via CLI, but `./gradlew build -P"javierscGradlePlugins"="0.1.0-alpha.29" should work. In the root // gradle.properties
massiveCatalogs=0.1.0-alpha.29 // settings.gradle.kts
dependencyResolutionManagement {
repositories {
mavenCentral()
google()
gradlePluginPortal()
}
versionCatalogs {
val massiveCatalogs: String by settings
create("libs") { from("com.javiersc.massive-catalogs:libs-catalog:$massiveCatalogs") }
create("pluginLibs") {
from("com.javiersc.massive-catalogs:plugins-catalog:$massiveCatalogs")
}
}
} EDIT: well I am using it for settings the version of the catalog itself, not a version inside it, but I could use the |
This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution. |
How can we prevent this feature from being closed? I think the easiest solution is to have some convention for this, like for gradle properties, something like GRADLE_VERSION_CATALOG_$catalogName_$versionName It's pretty common requirement, when we want to run tests on CI with updated version of some library |
Editor integrations, such as Cider and Calva (maybe others), rely on being able to inject dependencies when starting nREPL in order to ensure they have all of the capabilities their editors use. Eventually, this could be supported natively by Gradle via [1], but this has been a long-nagging issue with Gradle that made for a poorer user experience than Leiningen, Boot, tools.deps, etc. Since this is just a Gradle property, it can be provided by editors even if the project isn't using Clojurephant (or the right version of Clojurephant), meaning a graceful degradation to the old experience of requiring the user to have put the right deps on the nREPL classpath. [1] gradle/gradle#17251
Editor integrations, such as Cider and Calva (maybe others), rely on being able to inject dependencies when starting nREPL in order to ensure they have all of the capabilities their editors use. Eventually, this could be supported natively by Gradle via [1], but this has been a long-nagging issue with Gradle that made for a poorer user experience than Leiningen, Boot, tools.deps, etc. Since this is just a Gradle property, it can be provided by editors even if the project isn't using Clojurephant (or the right version of Clojurephant), meaning a graceful degradation to the old experience of requiring the user to have put the right deps on the nREPL classpath. [1] gradle/gradle#17251 This fixes Clojurephant's side of #78.
Editor integrations, such as Cider and Calva (maybe others), rely on being able to inject dependencies when starting nREPL in order to ensure they have all of the capabilities their editors use. Eventually, this could be supported natively by Gradle via [1], but this has been a long-nagging issue with Gradle that made for a poorer user experience than Leiningen, Boot, tools.deps, etc. Since this is just a Gradle property, it can be provided by editors even if the project isn't using Clojurephant (or the right version of Clojurephant), meaning a graceful degradation to the old experience of requiring the user to have put the right deps on the nREPL classpath. [1] gradle/gradle#17251 This fixes Clojurephant's side of #78.
Central declaration of dependencies is an awesome feature! However, we have the need to inject different values via
local.properties
/gradle.properties
/command line#15352 (comment)
We currently have something like:
// gradle.properties ANDROID_GRADLE_PLUGIN=4.1.2
But AGP released a new version! So I would like to test it via
// local.properties ANDROID_GRADLE_PLUGIN=4.1.2
or command line (more useful for CI):
We would like to see both these use cases supported officially with the Central Declaration of Dependencies.
The text was updated successfully, but these errors were encountered: