Homebrew and Gradle install/update with different directory structures

(John Hake) #1

When I use brew install gradle Homebrew installs with a directory structure gradle/X.Y that is different than what Gradle typically uses. Why doesn’t Homebrew install with the native Gradle gradle/wrapper/dists directory structure?
TIA, details below.

Homebrew 1.8.6-124-g6cd4c31
macOS 10.14.2

For example, Homebrew installs to /usr/local/Cellar/gradle, and puts the gradle installation at the root:

└── 5.1
    ├── bin
    └── libexec

However, if I run a Gradle build that requires, say Gradle 5.0, and
$GRADLE_USER_HOME=/usr/local/Cellar/gradle and the project uses:

: cat gradle-wrapper.properties

Gradle installs/updates to wrapper/dists like this:

└── 5.1                    # V5.1 Installed by Homebrew
├── caches
│   ├── 5.0
├── daemon
│   ├── 5.0
├── native
├── notifications
│   ├── 5.0
└── wrapper
    └── dists
        └── gradle-5.0-bin       # V5.0 Installed by Gradle

If I set distributionPath=GRADLE_USER_HOME then Gradle creats a subdirectory with that name. If I leave it blank then it draws an error.

(Sean Molenaar) #2

Gradle isn’t the same as gradle wrapper though afaik. And their usage isn’t interchangable either.