Slackbot
12/05/2023, 4:30 PMVampire
12/05/2023, 4:43 PMwrapper task once.
The distribution URL you should be able to configure in the build script or via argument as far as I remember to not need the sed.
But why do you need to update the lock files when upgrading Gradle? Those actions shouldn't be directly related, should they?Caleb Cushing
12/05/2023, 4:49 PMCaleb Cushing
12/05/2023, 4:49 PMCaleb Cushing
12/05/2023, 4:49 PMCaleb Cushing
12/05/2023, 4:50 PMVampire
12/05/2023, 4:52 PMtasks.wrapper {
distributionUrl = ...
}
and / or
gw wrapper --gradle-distribution-url ...Caleb Cushing
12/05/2023, 5:11 PM+ ./gradlew wrapper --write-locks --gradle-version 8.5 --gradle-distribution-url <https://myorg.jfrog.io/artifactory/gradle-distributions/>
Exception in thread "main" java.lang.RuntimeException: Downloaded distribution file /Users/ccushing/.gradle/wrapper/dists/gradle-distributions/1pbmfpj97mcv4jv8t62lgs5qp/gradle-distributions is no valid zip file.
at org.gradle.wrapper.Install$1.call(SourceFile:26)
at org.gradle.wrapper.GradleWrapperMain.main(SourceFile:67)Vampire
12/05/2023, 5:18 PMdistributionUrl = gradleVersion.map { "<https://myorg.jfrog.io/artifactory/gradle-distributions/gradle-$it-bin.zip>" } in the build script and then again just use --gradle-versionCaleb Cushing
12/05/2023, 5:20 PMdistributionUrlBaseCaleb Cushing
12/05/2023, 5:20 PMCaleb Cushing
12/05/2023, 5:22 PMCaleb Cushing
12/05/2023, 5:22 PMVampire
12/05/2023, 5:27 PMHEAD request before writing it to the file or similar to verify the URL at least return something valid.Caleb Cushing
12/05/2023, 5:39 PMCaleb Cushing
12/05/2023, 5:41 PMCaleb Cushing
12/05/2023, 5:41 PMCaleb Cushing
12/05/2023, 5:41 PMVampire
12/05/2023, 5:58 PMVampire
12/05/2023, 5:58 PMCaleb Cushing
12/05/2023, 6:10 PMCaleb Cushing
12/05/2023, 6:10 PMVampire
12/05/2023, 6:14 PMBefore starting to work on a feature or a bug fix, please open an issue to discuss the use case or bug with us. This can save everyone a lot of time and frustration.
Caleb Cushing
12/05/2023, 6:33 PMCaleb Cushing
12/05/2023, 6:33 PMCaleb Cushing
12/05/2023, 6:33 PMCaleb Cushing
12/05/2023, 6:34 PMCaleb Cushing
12/05/2023, 6:34 PMVampire
12/05/2023, 6:45 PMVampire
12/05/2023, 6:49 PMfile:/// or ftp:// it would be URLs.
URL = Uniform Resource Locator
So if the "thing" allows to locate a resource like a file, it is an URL.
An URI is a Uniform Resource Identifier
These can be things that are also valid for an URL or can just look similar or also look completely different and do not necessarily allow to locate a resource,
but just to identify a resource.
For example the entity id in a SAML login process typically is an URI. It often is also a valid URL where the respective entity can be accessed, but it does not have to be. 🙂Caleb Cushing
12/05/2023, 7:01 PMCaleb Cushing
12/05/2023, 7:01 PMCaleb Cushing
12/05/2023, 7:02 PMCaleb Cushing
12/05/2023, 7:05 PMCaleb Cushing
12/05/2023, 7:26 PMVampire
12/05/2023, 7:27 PMCaleb Cushing
12/05/2023, 7:27 PMCaleb Cushing
12/05/2023, 7:32 PMCaleb Cushing
12/05/2023, 7:44 PMCaleb Cushing
12/05/2023, 7:46 PMCaleb Cushing
12/05/2023, 7:47 PMCaleb Cushing
12/05/2023, 7:49 PMCaleb Cushing
12/05/2023, 7:50 PMCaleb Cushing
12/05/2023, 7:54 PMCaleb Cushing
12/05/2023, 8:29 PMgradle wrapper by itself it'll update the distribution urlCaleb Cushing
12/05/2023, 8:29 PMCaleb Cushing
12/05/2023, 8:30 PMVampire
12/05/2023, 8:30 PMCaleb Cushing
12/05/2023, 8:31 PMVampire
12/05/2023, 8:31 PMwrapper task overwrites the file.Caleb Cushing
12/05/2023, 8:31 PMVampire
12/05/2023, 8:32 PMVampire
12/05/2023, 8:32 PMCaleb Cushing
12/05/2023, 8:32 PMCaleb Cushing
12/05/2023, 8:32 PMCaleb Cushing
12/05/2023, 8:32 PMVampire
12/05/2023, 8:33 PMwrapper taskCaleb Cushing
12/05/2023, 8:33 PMCaleb Cushing
12/05/2023, 8:33 PMVampire
12/05/2023, 8:33 PMCaleb Cushing
12/05/2023, 8:34 PMVampire
12/05/2023, 8:35 PMclasspath configuration of the buildscript block, I wouldn't expect to get something into the lock files due to Kotlin DSLCaleb Cushing
12/05/2023, 8:36 PMCaleb Cushing
12/05/2023, 8:37 PMCaleb Cushing
12/05/2023, 8:39 PMCaleb Cushing
12/05/2023, 8:40 PMCaleb Cushing
12/05/2023, 8:41 PMbuildSrc:dependencies --write-locks?Vampire
12/05/2023, 8:47 PMCaleb Cushing
12/05/2023, 8:51 PMCaleb Cushing
12/05/2023, 8:54 PM❯ ./gradlew buildSrc:dependencies
Calculating task graph as no configuration cache is available for tasks: buildSrc:dependencies
Type-safe project accessors is an incubating feature.
The Daemon will expire after the build after running out of JVM Metaspace.
The project memory settings are likely not configured or are configured to an insufficient value.
The daemon will restart for the next build, which may increase subsequent build times.
These settings can be adjusted by setting 'org.gradle.jvmargs' in 'gradle.properties'.
The currently configured max heap space is '512 MiB' and the configured max metaspace is '384 MiB'.
For more information on how to set these values, please refer to <https://docs.gradle.org/8.4/userguide/build_environment.html#sec:configuring_jvm_memory> in the Gradle documentation.
To disable this warning, set 'org.gradle.daemon.performance.disable-logging=true'.
Daemon will be stopped at the end of the build after running out of JVM Metaspace
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/ccushing/IdeaProjects/ai-wh40k/module/game/build.gradle.kts' line: 14
* What went wrong:
Metaspace
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at <https://help.gradle.org>.
that's a fun error... but running it a second time works...Vampire
12/05/2023, 8:55 PMVampire
12/06/2023, 5:54 PMHEAD request is not necessary.
The wrapper task already does that if you provide a custom distribution url with http or https, so it should not actually write invalid distribution urls to the properties file unless the HEAD request indeed was successful.Caleb Cushing
12/06/2023, 7:26 PMCaleb Cushing
12/06/2023, 7:26 PMCaleb Cushing
12/06/2023, 7:26 PMCaleb Cushing
12/06/2023, 7:27 PMCaleb Cushing
12/06/2023, 7:27 PMCaleb Cushing
12/06/2023, 7:31 PMCaleb Cushing
12/07/2023, 2:13 PMVampire
12/07/2023, 2:34 PMwrapper task needs extremely significant more time. And usually you can just revert the changes, or at worst delete the file and regenerate. I guess it is not worth really downloading the wohle file just to verify the URL.Caleb Cushing
12/07/2023, 3:22 PMCaleb Cushing
12/07/2023, 3:23 PMCaleb Cushing
12/07/2023, 3:24 PMVampire
12/07/2023, 3:26 PMyou'd need to download it anyways right?No, why?
Caleb Cushing
12/07/2023, 3:39 PMCaleb Cushing
12/07/2023, 3:40 PMCaleb Cushing
12/07/2023, 3:40 PMCaleb Cushing
12/07/2023, 3:41 PMVampire
12/07/2023, 3:44 PMCaleb Cushing
12/07/2023, 3:47 PMCaleb Cushing
12/07/2023, 3:47 PMCaleb Cushing
12/07/2023, 3:47 PMCaleb Cushing
12/07/2023, 3:48 PMVampire
12/07/2023, 3:52 PMwrapper excecution does not download anything, so your description is wrong anyway.
It uses a HEAD request as a minimal measure to validate the given URL.
The download is happening on the second command that will then try to download and use that distribution and fail.
So there is nothing that could be validated before writing the properties file, unless the whole distribution indeed is downloaded on wrapper task execution which would be pretty bad, as I said before.Caleb Cushing
12/07/2023, 4:03 PM./gradlew wrapper --gradle-distribution-url https\:<//services.gradle.org/distributions/whatever-the-zip-actually-8.5.zip>will not upgrade my distribution until I run
./gradlew againCaleb Cushing
12/07/2023, 4:04 PMCaleb Cushing
12/07/2023, 4:04 PMVampire
12/07/2023, 4:04 PMwill not upgrade my distribution until I runCorrect, it will update the properties file and generate the start scripts and jar from the version currently runningagain./gradlew
Vampire
12/07/2023, 4:05 PMwrapper task a second time if you want the jar and start scritps from the new versionCaleb Cushing
12/07/2023, 4:05 PMVampire
12/07/2023, 4:05 PMCaleb Cushing
12/07/2023, 4:05 PMCaleb Cushing
12/07/2023, 4:05 PMVampire
12/07/2023, 4:06 PMCaleb Cushing
12/07/2023, 4:06 PMVampire
12/07/2023, 4:07 PMCaleb Cushing
12/07/2023, 4:07 PMVampire
12/07/2023, 4:07 PMCaleb Cushing
12/07/2023, 4:07 PMVampire
12/07/2023, 4:08 PMCaleb Cushing
12/07/2023, 4:08 PMVampire
12/07/2023, 4:08 PMVampire
12/07/2023, 4:08 PMCaleb Cushing
12/07/2023, 4:08 PMVampire
12/07/2023, 4:08 PMCaleb Cushing
12/07/2023, 4:09 PMGiven you right now executed Gradle to break it, the distribution is still there and you can just call it to generate fresh filesI have no idea how to do that, because I don't know where that jar lives
Caleb Cushing
12/07/2023, 4:09 PMCaleb Cushing
12/07/2023, 4:09 PMVampire
12/07/2023, 4:10 PMwrapper/distsCaleb Cushing
12/07/2023, 4:10 PMVampire
12/07/2023, 4:10 PMCaleb Cushing
12/07/2023, 4:10 PMCaleb Cushing
12/07/2023, 4:10 PMVampire
12/07/2023, 4:10 PMgradlew files.Caleb Cushing
12/07/2023, 4:11 PMVampire
12/07/2023, 4:11 PMCaleb Cushing
12/07/2023, 4:11 PMVampire
12/07/2023, 4:11 PM./gradlewCaleb Cushing
12/07/2023, 4:11 PMVampire
12/07/2023, 4:12 PMCaleb Cushing
12/07/2023, 4:12 PMCaleb Cushing
12/07/2023, 4:12 PMCaleb Cushing
12/07/2023, 4:12 PMVampire
12/07/2023, 4:13 PMVampire
12/07/2023, 4:14 PMVampire
12/07/2023, 4:14 PMCaleb Cushing
12/07/2023, 4:14 PMCaleb Cushing
12/07/2023, 4:14 PMVampire
12/07/2023, 4:15 PMCaleb Cushing
12/07/2023, 4:15 PMCaleb Cushing
12/07/2023, 4:15 PMVampire
12/07/2023, 4:15 PMCaleb Cushing
12/07/2023, 4:15 PMCaleb Cushing
12/07/2023, 4:16 PMVampire
12/07/2023, 4:16 PMCaleb Cushing
12/07/2023, 4:17 PMCaleb Cushing
12/07/2023, 4:17 PMCaleb Cushing
12/07/2023, 4:17 PMCaleb Cushing
12/07/2023, 4:17 PMVampire
12/07/2023, 4:17 PMCaleb Cushing
12/07/2023, 4:18 PMVampire
12/07/2023, 4:18 PMCaleb Cushing
12/07/2023, 4:19 PMCaleb Cushing
12/07/2023, 4:19 PMCaleb Cushing
12/07/2023, 4:21 PMCaleb Cushing
12/07/2023, 4:21 PMVampire
12/07/2023, 5:40 PMI only know how to execute ./gradlew because that's what's documented
digging into wrapper/dists is notJust for completeness and because I indeed just accidentally stumbled over it, it is documented what can be found that directory and that there the downloaded distributions are. 🙂 https://docs.gradle.org/current/userguide/directory_layout.html
Caleb Cushing
12/07/2023, 5:48 PMCaleb Cushing
12/07/2023, 5:52 PMCaleb Cushing
12/07/2023, 5:52 PMCaleb Cushing
12/07/2023, 5:53 PMCaleb Cushing
12/07/2023, 5:53 PMCaleb Cushing
12/07/2023, 5:54 PMVampire
12/07/2023, 6:22 PMVampire
12/07/2023, 6:22 PMCaleb Cushing
12/07/2023, 7:11 PMCaleb Cushing
12/11/2023, 5:04 PMCaleb Cushing
12/11/2023, 5:05 PMCaleb Cushing
12/11/2023, 5:06 PMwrapper --write-locks that's not a buggy behavior it's just needed. Since locks are used though it's necessary to show it being run.Caleb Cushing
12/11/2023, 5:06 PMVampire
12/12/2023, 8:46 AMCaleb Cushing
12/12/2023, 2:11 PMCaleb Cushing
12/12/2023, 2:11 PMVampire
12/12/2023, 2:16 PMCaleb Cushing
12/12/2023, 2:18 PMCaleb Cushing
12/12/2023, 2:18 PMCaleb Cushing
12/12/2023, 2:18 PMCaleb Cushing
12/12/2023, 2:19 PM