feat: add GRADLE_DISTRIBUTION_URL

#14
This commit is contained in:
Huber Elias (TECH V) 2023-02-22 17:41:46 +01:00
parent e47df002ad
commit c698919361
3 changed files with 20 additions and 9 deletions

View File

@ -6,7 +6,7 @@
## Install
```
```sh
asdf plugin-add gradle https://github.com/rfrancis/asdf-gradle.git
```
@ -15,15 +15,19 @@ asdf plugin-add gradle https://github.com/rfrancis/asdf-gradle.git
Check out the [asdf](https://github.com/asdf-vm/asdf) readme for instructions on how to install and manage versions of other tools.
When installing Gradle using `asdf install` if you not wish to have it check the package signature for whatever reason, you can set `no` using `export GRADLE_SIGNATURE_CHECK=no` example:
```
```sh
export GRADLE_SIGNATURE_CHECK=no
```
If you want to use a custom distribution url, for example in a corporate setting you can set this:
```sh
export GRADLE_DISTRIBUTION_URL=https://services.gradle.org/distributions
```
Observation:
* `GRADLE_SIGNATURE_CHECK` - `yes` (for yes, check the signature) is the default
NEEDED: Someone to take over maintenance of this plugin.

View File

@ -1,5 +1,7 @@
#!/bin/bash
export GRADLE_DISTRIBUTION_URL=${GRADLE_DISTRIBUTION_URL:=https://services.gradle.org/distributions}
checkShasum ()
{
local archive_file_name="${1}"
@ -30,8 +32,8 @@ installGradleSig()
echo "start install $ASDF_INSTALL_VERSION"
mkdir -p "$ASDF_INSTALL_PATH"
cd "$ASDF_INSTALL_PATH" || exit 1
curl -OJL https://services.gradle.org/distributions/gradle-${ASDF_INSTALL_VERSION}-bin.zip
curl -OJL https://services.gradle.org/distributions/gradle-${ASDF_INSTALL_VERSION}-bin.zip.sha256
curl -OJL ${GRADLE_DISTRIBUTION_URL}/gradle-${ASDF_INSTALL_VERSION}-bin.zip
curl -OJL ${GRADLE_DISTRIBUTION_URL}/gradle-${ASDF_INSTALL_VERSION}-bin.zip.sha256
archive_file_name=$PWD/gradle-${ASDF_INSTALL_VERSION}-bin.zip
authentic_checksum_file=$archive_file_name.sha256
authentic_checksum=$(cat $authentic_checksum_file)
@ -58,7 +60,7 @@ installGradleNoSign()
else
mkdir -p "$ASDF_INSTALL_PATH"
cd "$ASDF_INSTALL_PATH" || exit 1
curl -OJL https://services.gradle.org/distributions/gradle-${ASDF_INSTALL_VERSION}-bin.zip
curl -OJL ${GRADLE_DISTRIBUTION_URL}/gradle-${ASDF_INSTALL_VERSION}-bin.zip
unzip gradle-${ASDF_INSTALL_VERSION}-bin.zip
rm gradle-${ASDF_INSTALL_VERSION}-bin.zip
mv gradle-${ASDF_INSTALL_VERSION}/* .

View File

@ -1,5 +1,10 @@
#!/bin/sh
export LC_ALL=C
export GRADLE_DISTRIBUTION_URL=${GRADLE_DISTRIBUTION_URL:=https://services.gradle.org/distributions}
curl -s https://services.gradle.org/distributions/ | grep -e "distributions.*-bin.zip\"" | sed -e "s#^.*distributions/gradle-##" -e "s#-bin.zip.*##" | sort -t. -n | paste -s -d" " -
curl -s ${GRADLE_DISTRIBUTION_URL}/ |
grep -e "gradle.*-bin.zip\"" |
sed -e "s#^.*gradle-##" -e "s#-bin.zip.*##" |
sort -t. -n |
paste -s -d" " -