Gradle 在他們的檔案中描述了他們的安裝:
https://docs.gradle.org/current/userguide/installation.html
但是,檔案需要使用特定版本,并且沒有簡單的方法可以說“獲取當前版本”。
我想做類似的事情:
export GRADLE_VERSION=`curl https://services.gradle.org/current-version`
curl -sSLO https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip \
&& unzip -q -d /opt/gradle gradle-*.zip \
&& echo "PATH=$PATH:/opt/gradle/gradle-${GRADLE_VERSION}/bin" > ~/.bashrc
顯然沒有像/current-version. 你將如何實作這一目標?
uj5u.com熱心網友回復:
我建議:
curl -s 'https://services.gradle.org/versions/current' | jq -r '.version'
輸出:
7.3.1
或者
curl -s 'https://services.gradle.org/versions/current' | jq -r '.downloadUrl'
輸出:
https://services.gradle.org/distributions/gradle-7.3.1-bin.zip
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/382357.html
上一篇:無法生成在androidstudio中使用reactnative制作的apk專案
下一篇:在路徑“lib/arm64-v8a/libnode.so”中找到2個檔案-nodejs-mobile-react-native的jniLibs問題
