is it possible to refresh changing dependencies ex...
# community-support
c
is it possible to refresh changing dependencies explicitly without refreshing everything? I don't see an option documented here https://docs.gradle.org/current/userguide/dynamic_versions.html#sec:controlling_dependency_caching_command_line
v
Set their cache period to 0
c
that's not great, and doesn't actually do what I want
it's a workaround for what I want
v
What do you want?
c
to say expire now, this one time, but only these
otherwise retain default behavior
v
Set their cache period to 0 for that one time
c
that means I have to change the code
v
Use an init script
c
this shouldn't require a code change
v
Use an init script if there is no option
c
sigh ok, I know like nothing about those
other than I've been asked if that's the source of my problem 😉
well, in the gradle context. I was working with init scripts before systemd was conceptualized 😉
v
🙄
😄
c
init scripts in gradle sound like regular expressions
v
They are not
c
I had a problem, I wrote an init script, now I have 2 problems
v
Then you did it wrongly obviously 🙂
c
the regular expression too
is it possible to have a SNAPSHOT locked/treated like a dynamic version instead? like, can I give the full timestamped version somehow?
v
TIAS?
c
herm...
what do I call this on? I'm not sure where I would actually do thatI Gradle is flexible enough to treat any version as changing version e.g. if you wanted to model snapshot behavior for an Ivy module. All you need to do is to set the property ExternalModuleDependency.setChanging(boolean) to true.
v
Do what?
c
found it
v
Btw. for the init script usage as a Bash oneliner:
Copy code
[ ! -e init.gradle ] && echo 'allprojects { configurations.all { resolutionStrategy { cacheChangingModulesFor(0, "seconds") } } }' >init.gradle && ./gradlew -I init.gradle -m && rm init.gradle
c
well, this didn't work
Copy code
testFixturesImplementation(libs.java.tools) {
    isChanging = false
  }
yeah, but that init script also doesn't seem great for fixing the problem in CI
v
That will just not look again whether there is something else to resolver under the same version, setting changing to false
I highly doubt that is what you want
c
I'm gonna go write a feature request where I'll be told I'm an idiot and it'll get closed. Because I'm happy to be angry
v
CI is exactly what init scripts are for
c
what?
v
what what?
Init scripts are for injecting logic into a build from outside the project. For example that a CI server can inject some config, or IDE can inject something or similar.
c
that sounds like a terrible idea
v
Only if you abuse it
Anyway, need to get some sleep now, cu
c
i'm reminded of the WAT video. I assume you've seen that 😉
have a good 'un