`

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 "$@"
 

 


 

分享到:
评论

相关推荐

    SoupUI测试指南

    Gradle: A Gradle wrapper was used in all examples, which indicates that Gradle installation is unnecessary but can be done (version 2.2 was used). Browsers: Any browser should work; the main testing ...

    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代码-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 ...

    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 {...

    Android代码-Rss-Manager

    Installation Add this to your project level build.gradle file. repositories { maven { url "https://jitpack.io" } } Add this to your app level build.gradle file. dependencies { compile ('...

    Android代码-EasyTabs

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

    Android代码-SplashScreen

    Installation Up to now, the library is only available in JitPack. Please add this code to your build.gradle file on project level: allprojects { repositories { ... maven { url '...

    Android代码-DBC-Android

    Installation Add the JitPack repository to your root build.gradle: allprojects { repositories { ... maven { url "https://jitpack.io" } } } In your module's build.gradle file, add the dependency: ...

Global site tag (gtag.js) - Google Analytics