What does the `--distribution-type` option (bin vs all) control when regenerating the wrapper, and when would you choose `all`?
answer
- bin = runtime only
- all = runtime + sources + Javadoc
- distributionUrl -bin.zip vs -all.zip
- all → IDE source navigation
- bin → faster CI downloads
basics
~10 s--distribution-type picks which Gradle download the wrapper uses: bin (runtime only, smaller) or all (runtime plus sources and Javadoc). Choose all so IDEs can offer Gradle API source navigation and autocomplete.
solid answer
~40 sWhen you run `./gradlew wrapper --gradle-version 9.0 --distribution-type all`, the option sets which distribution zip the wrapper downloads. `bin` is the lean runtime-only distribution — fastest to download, ideal for CI. `all` additionally bundles the Gradle API **sources and Javadoc**, which IDEs like IntelliJ use to give you working code navigation and documentation when writing build scripts. The choice is encoded in `distributionUrl` as the `-bin.zip` vs `-all.zip` suffix. Teams that author a lot of custom build logic often prefer `all` for the developer experience; CI-heavy or bandwidth-sensitive setups stick with `bin`. The flag only takes effect during regeneration — you must rerun the `wrapper` task to switch types.
code
bash · 5 lines# Regenerate the wrapper to use the 'all' distribution (sources + Javadoc for IDE)
./gradlew wrapper --gradle-version 9.0 --distribution-type all
# Resulting distributionUrl ends with: gradle-9.0-all.zip
grep distributionUrl gradle/wrapper/gradle-wrapper.propertiesgo deeper
Know bin is smaller/runtime-only and all adds sources, even if hazy on the IDE rationale.
Explain the IDE source-navigation benefit of all, the download/disk trade-off, and that it lives in distributionUrl.
Recommend a policy (e.g. bin on CI, all for local dev), and tie it to where build logic is authored.
Standardize distribution-type conventions across repos and weigh cache/bandwidth cost at fleet scale vs developer ergonomics.
## Two flavors of the Gradle distribution Gradle publishes each release as two downloadable zips: - **`gradle-9.0-bin.zip`** — the runtime: the Gradle binaries needed to actually run builds. Smaller and faster to download. - **`gradle-9.0-all.zip`** — the runtime **plus** the Gradle API source code and Javadoc. The wrapper records which one to fetch in `gradle-wrapper.properties` via the `distributionUrl` suffix (`-bin.zip` or `-all.zip`). ## The `--distribution-type` flag The `wrapper` task exposes this as `--distribution-type` (values `bin` or `all`). It is also settable on the `Wrapper` task type via the `distributionType` property: ```kotlin tasks.wrapper { gradleVersion = "9.0" distributionType = Wrapper.DistributionType.ALL } ``` Running `./gradlew wrapper --gradle-version 9.0 --distribution-type all` writes a `distributionUrl` ending in `gradle-9.0-all.zip`. ## Why choose `all` The practical payoff is **IDE support for build authoring**. With the `all` distribution, IntelliJ IDEA / Android Studio index the bundled Gradle API sources, giving you: - Ctrl-click navigation into Gradle's own classes from your `build.gradle.kts` - Inline Javadoc / quick documentation - Better autocomplete on the Gradle DSL If you frequently write custom tasks, plugins, or non-trivial build logic, `all` makes that work far more pleasant. ## Why choose `bin` `bin` downloads faster and uses less disk and bandwidth in `~/.gradle/wrapper/dists/`. On CI — where nobody navigates source and cold caches are common — `bin` is the sensible default. Many teams use a split: `bin` everywhere, or `all` for local dev only. ## How it takes effect The option only matters during regeneration. Switching from `bin` to `all` (or back) requires rerunning the `wrapper` task; you can't change the live distribution by editing nothing. After regeneration, commit the updated `distributionUrl`.
- Does choosing `all` make your builds run any faster or slower?Runtime build performance is identical — the same engine runs. `all` only costs a larger one-time download and more disk in the dists cache; the extra sources/Javadoc aren't loaded during a build.
- Where is the chosen distribution type recorded?In `gradle-wrapper.properties` as the `distributionUrl` suffix (`-bin.zip` or `-all.zip`). The `wrapper` task writes it during regeneration.
saying these in an interview costs you the question
- Saying `all` makes builds faster — it does not; it only adds sources/Javadoc.
- Claiming you can switch distribution type by editing nothing/by a flag at build time — you must rerun the `wrapper` task.
- Confusing distribution type with the Gradle version selector.