Hmm, “exact” does not seem to be quite right either. For example, the file at ~/.gradle/wrapper/dists/gradle-6.3-all/b4awcolw9l59x95tu1obfh9i8/gradle-6.3/lib/gradle-wrapper-6.3.jar is quite a bit smaller than the file in my project at gradle/wrapper/gradle-wrapper.jar even after running ./gradlew wrapper --gradle-version=6.3 --distribution-type=all twice. So I assume the latter is some kind of Fat-JAR version of the former?
That’s a good point, I should investigate how exactly the action works.
That use-case actually seems quite bogus to me. Starting from scratch to me means I have to Gradle installed at all in the system. In fact, that’s how I’ve always been working with Gradle: I have no global Gradle in PATH which is installed in the system, but only projects with committed Gradle wrappers.
Indeed. But frankly, this behavior seems quite dumb to me. In my case, I wanted to upgrade a project from using Gradle 6.0.1 to use Gradle 6.3. But the 6.0.1 distribution was not present in ~/.gradle/wrapper/dists yet. So when running ./gradlew wrapper --gradle-version=6.3 --distribution-type=all, first Gradle 6.0.1 is downloaded, even though it’s clear that I never want to use that version, just to use that version to update gradle-wrapper.properties.
At least for the case when the distribution initially specified in gradle-wrapper.properties is not present on the system, I would have expected the wrapper to be smarter and download the wanted distribution right away and update both gradle-wrapper.properties and gradle-wrapper.jar accordingly.
I don’t see that behavior being clearly documented, unfortunately, but it clearly should be. I’ll probably file an according PR.