`

Gradle installation

 
阅读更多



script to install gradle automaticly

#!/usr/bin/bash -x
function _install {

#wget  http://services.gradle.org/distributions/$installation_file 

if [ ! -d $gradle_home ]; then 
  mkdir -p $gradle_home
fi

unzip -q $installation_file "gradle-$version/*" -d $gradle_home/..

#set GRADLE_HOME as env variable
echo "seting up GRADLE_HOME ..."
grep '^GRADLE_HOME=' $profile_file
if [ $? != 0 ]; then 
  echo "export GRADLE_HOME=$gradle_home" >> $profile_file
else 
  sed -in "/^GRADLE_HOME=/c GRADLE_HOME=$gradle_home"  $profile_file
fi
#add gradle/bin into PATH
grep '^PATH=.*\$GRADLE_HOME' $profile_file
if [ $? != 0 ]; then
 echo 'PATH=$PATH:$GRADLE_HOME/bin' >> $profile_file
fi

source $profile_file

echo "done"
}

function _uninstall {
  #rm -rf $installation_file
  rm -rf $gradle_home
  sed -in "GRADLE_HOME=/d"  $profile_file
}

function usage {
  echo "-h, show help messsage"
  echo "-i, install "
  echo "-u, uninstall"
}

function shell_main {
   echo hello
     while getopts "hui" arg; do
      case $arg in
        h)
          usage
          ;;
        u)
		  
		  echo "uninstall..."
		  _uninstall
		  ;;
         
		i)
		  echo "install..."
		  _install
          ;;
		*)
		  echo "plz enter an option: -i for install, -u for unintall, more information plz enter -h"
		  ;;
      esac
    done
}

version=1.10
installation_file=gradle-$version-all.zip
gradle_home=/cygdrive/c/dev/gradle-$version
profile_file=~/.bashrc
echo hello
[[ $(basename $0) == "gradle_commands.sh" ]] && shell_main "$@"
 

 


 

分享到:
评论

相关推荐

    将 Gradle.zip 解压到 “C:\\User\你的用户名\.gradle\wrapper\dists”

    在Android开发过程中,Gradle是一个不可或缺的构建工具。它提供了灵活的构建脚本,使得开发者可以轻松地管理项目依赖和构建过程。本文将详细介绍如何将`Gradle.zip`解压到指定目录,并讨论其在Android开发中的作用...

    解决gradle下载失败问题.doc

    首先,错误提示"Error: Could not run build action using Gradle installation (gradle 2.4, android studio)"表明Android Studio无法使用已安装的Gradle 2.4版本执行构建操作。这可能是因为Gradle的下载或更新过程...

    Android代码-kotlinter-gradle

    Installation Available on the Gradle Plugins Portal: https://plugins.gradle.org/plugin/org.jmailen.kotlinter Single module Kotlin plugins { id("org.jmailen.kotlinter") version "1.21.0" } Groovy ...

    gradle-5.4.1-all.zip 文件下载

    https://developer.harmonyos.com/cn/docs/documentation/doc-guides/faq-installation-0000001050697674 进入.gradle > wrapper > dists > gradle-5.4.1-all目录,将下载的“gradle-5.4.1-all.zip”拷贝到该目录下...

    spring-boot-reference.pdf

    10.1.2. Gradle Installation 10.2. Installing the Spring Boot CLI 10.2.1. Manual Installation 10.2.2. Installation with SDKMAN! 10.2.3. OSX Homebrew Installation 10.2.4. MacPorts Installation 10.2.5. ...

    Android Studio使用新的Gradle构建工具配置NDK环境

    ndk.dir=/path/to/your/ndk/installation ``` 2. **更新Gradle插件**:Android Studio使用Gradle作为构建系统。为了使用实验性的Gradle插件支持NDK,你需要在项目的`build.gradle`(Project级别)文件中添加以下...

    Android代码-gradle-java-preprocessor-plugin

    gradle-java-preprocessor-plugin ...Installation Add the following to your build.gradle: buildscript { repositories { jcenter() } dependencies { classpath 'wang.dannyhe.tools:plugin:latest.re

    java-hello-world-with-gradle:带有gradle的Java hello世界示例

    你需要什么最喜欢的文本编辑器或IDE JDK 6或更高版本安装Gradle安装Gradle 在Unix上$ sudo add-apt-repository ppa:cwchien/gradle$ sudo apt-get update$ sudo apt-get install gradle在Mac OS X上brew install ...

    GradleUserGuide

    除此之外,还包括了如何运行并测试安装(Running and testing your installation),以及JVM相关选项(JVM options)的配置。这部分内容对于任何想要开始使用Gradle的开发者来说都是基础且关键的。 在故障排除...

    Android代码-适用于Android的自定义导航抽屉库

    Installation Gradle Add it in your root build.gradle at the end of repositories: allprojects { repositories { ... maven { url 'https://jitpack.io' } } } Add the dependency in your app build....

    Android代码-一个快速方便地访问Android Shared preferences 库。

    Installation Gradle Add jitpack.io to your root gradle file (project level) : allprojects { repositories { ... maven { url 'https://jitpack.io' } } } Add the dependency in your app ...

    Android代码-mathjs-android

    Installation Gradle Mathjs is available on jitpack. Add jitpack to your root build.gradle: allprojects { repositories { ... maven { url "https://jitpack.io" } } } Add the library to app build....

    Android代码-Animated-Icons

    Installation Add this to your module build.gradle file: dependencies { ... compile "com.github.tarek360:Animated-Icons:1.2.0" } Add this to your root build.gradle file (not your module build....

    Android代码-自定义安全键盘

    Installation Gradle Step 1. Add it in your root build.gradle at the end of repositories: allprojects { repositories { ... maven { url 'https://jitpack.io' } } } Step 2. Add the dependency ...

    Android代码-自定义View组织机构图 和层次图

    Installation Gradle Step 1. Add it in your root build.gradle at the end of repositories: allprojects { repositories { maven { url 'https://jitpack.io' } } } Step 2. Add the dependency dependencies...

    Android代码-用美丽的方式描述Android应用程序的持续时间。

    Duration View Duration View allows you ...Installation Gradle Add JitPack in your root build.gradle at the end of repositories: allprojects { repositories { ... maven { url 'https://jitpack.io' } } }

    imhotep-server:服务器端存储库,用于实施棋盘游戏

    SoPra RESTful服务模板 Sprint Boot 文档: : 指南: : ...Gradle安装: http : //gradle.org/installation 带有Homebrew的Mac OS X: brew install gradle 跑步 gradle bootRun 测试 gradle

    Android代码-Android PinCode 密码输入效果

    Installation Edit your master gradle.build file and add maven { url 'https://jitpack.io' } to your current repositories block content (if you use other jitpack hosted libraries, then this step can be ...

    Android代码-onedrive-sdk-android

    1. Installation 1.1 Install AAR via Gradle Add the maven central repository to your projects build.gradle file then add a compile dependency for com.onedrive.sdk:onedrive-sdk-android:1.3 repository {...

Global site tag (gtag.js) - Google Analytics