Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E354118048 for ; Thu, 28 May 2015 14:21:26 +0000 (UTC) Received: (qmail 5169 invoked by uid 500); 28 May 2015 14:21:23 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 5138 invoked by uid 500); 28 May 2015 14:21:23 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 5129 invoked by uid 99); 28 May 2015 14:21:23 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2015 14:21:23 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 4AF761A3F84 for ; Thu, 28 May 2015 14:21:23 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.791 X-Spam-Level: * X-Spam-Status: No, score=1.791 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Dsr2aH6Pkh1R for ; Thu, 28 May 2015 14:21:11 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id 7BA7924A5F for ; Thu, 28 May 2015 14:21:09 +0000 (UTC) Received: (qmail 2852 invoked by uid 99); 28 May 2015 14:21:08 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2015 14:21:08 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 851FEE10A6; Thu, 28 May 2015 14:21:08 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: yzhdanov@apache.org To: commits@ignite.incubator.apache.org Date: Thu, 28 May 2015 14:21:11 -0000 Message-Id: In-Reply-To: <2f03c7172ac64686a044610b57df8595@git.apache.org> References: <2f03c7172ac64686a044610b57df8595@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [04/10] incubator-ignite git commit: # ignite-899 # ignite-899 Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e16cb036 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e16cb036 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e16cb036 Branch: refs/heads/ignite-857 Commit: e16cb03658bc5ca7c97ac3f45b17bdca3cfae758 Parents: afe841c Author: null Authored: Wed May 27 21:19:42 2015 +0300 Committer: null Committed: Wed May 27 21:19:42 2015 +0300 ---------------------------------------------------------------------- dev-tools/gradle/wrapper/gradle-wrapper.jar | Bin 51017 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties | 18 +- dev-tools/gradlew | 163 +++++++++++++------ 3 files changed, 132 insertions(+), 49 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e16cb036/dev-tools/gradle/wrapper/gradle-wrapper.jar ---------------------------------------------------------------------- diff --git a/dev-tools/gradle/wrapper/gradle-wrapper.jar b/dev-tools/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index b761216..0000000 Binary files a/dev-tools/gradle/wrapper/gradle-wrapper.jar and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e16cb036/dev-tools/gradle/wrapper/gradle-wrapper.properties ---------------------------------------------------------------------- diff --git a/dev-tools/gradle/wrapper/gradle-wrapper.properties b/dev-tools/gradle/wrapper/gradle-wrapper.properties index 3111cd7..b85fc63 100644 --- a/dev-tools/gradle/wrapper/gradle-wrapper.properties +++ b/dev-tools/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,20 @@ -#Tue Feb 24 21:36:05 PST 2015 +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-bin.zip http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e16cb036/dev-tools/gradlew ---------------------------------------------------------------------- diff --git a/dev-tools/gradlew b/dev-tools/gradlew index 91a7e26..aa08fcb 100755 --- a/dev-tools/gradlew +++ b/dev-tools/gradlew @@ -1,8 +1,26 @@ #!/usr/bin/env bash -############################################################################## +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +## +## Tries to recreate Gradle's gradlew command in pure bash. +## This way you don't have to worry about binaries in your build. ## -## Gradle start up script for UN*X +## Depdencies +## unzip ## ############################################################################## @@ -15,6 +33,22 @@ APP_BASE_NAME=`basename "$0"` # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" +bin=`dirname "$0"` +bin=`cd "$bin">/dev/null; pwd` + +if [ -e "$bin/gradle/wrapper/gradle-wrapper.properties" ]; then + . "$bin/gradle/wrapper/gradle-wrapper.properties" +else + # the location that the wrapper is at doesn't have a properties + # check PWD, gradlew may be shared + if [ -e "$PWD/gradle/wrapper/gradle-wrapper.properties" ]; then + . "$PWD/gradle/wrapper/gradle-wrapper.properties" + else + echo "Unable to locate gradle-wrapper.properties. Not at $PWD/gradle/wrapper/gradle-wrapper.properties or $bin/gradle/wrapper/gradle-wrapper.properties" 1>&2 + exit 1 + fi +fi + warn ( ) { echo "$*" } @@ -110,55 +144,90 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi +# does not match gradle's hash +# waiting for http://stackoverflow.com/questions/26642077/java-biginteger-in-bash-rewrite-gradlew +hash() { + local input="$1" + if $darwin; then + md5 -q -s "$1" + else + echo -n "$1" | md5sum | cut -d" " -f1 + fi +} + +dist_path() { + local dir=$(basename $distributionUrl | sed 's;.zip;;g') + local id=$(hash "$distributionUrl") + + echo "$HOME/.gradle/${distributionPath:-wrapper/dists}/$dir/$id" +} + +zip_path() { + local dir=$(basename $distributionUrl | sed 's;.zip;;g') + local id=$(hash "$distributionUrl") + + echo "$HOME/.gradle/${zipStorePath:-wrapper/dists}/$dir/$id" +} + +download() { + local base_path=$(dist_path) + local file_name=$(basename $distributionUrl) + local dir_name=$(echo "$file_name" | sed 's;-bin.zip;;g' | sed 's;-src.zip;;g' |sed 's;-all.zip;;g') + + if [ ! -d "$base_path" ]; then + mkdir -p "$base_path" + else + # if data already exists, it means we failed to do this before + # so cleanup last run and try again + rm -rf $base_path/* + fi + + # download dist. curl on mac doesn't like the cert provided... + local zip_path=$(zip_path) + curl --insecure -L -o "$zip_path/$file_name" "$distributionUrl" + + pushd "$base_path" + touch "$file_name.lck" + unzip "$zip_path/$file_name" 1> /dev/null + touch "$file_name.ok" + popd +} + +is_cached() { + local file_name=$(basename $distributionUrl) + + [ -e "$(dist_path)/$file_name.ok" ] +} + +lib_path() { + local base_path=$(dist_path) + local file_name=$(basename $distributionUrl | sed 's;-bin.zip;;g' | sed 's;-src.zip;;g' |sed 's;-all.zip;;g') + + echo "$base_path/$file_name/lib" +} + +classpath() { + local dir=$(lib_path) + local cp=$(ls -1 $dir/*.jar | tr '\n' ':') + echo "$dir:$cp" +} # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules function splitJvmOpts() { - JVM_OPTS=("$@") + JVM_OPTS=("$@") +} + +main() { + if ! is_cached; then + download + fi + + eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS + + exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath $(classpath) org.gradle.launcher.GradleMain "$@" + #$JAVACMD "${JVM_OPTS[@]}" -cp $(classpath) org.gradle.launcher.GradleMain "$@" } eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" +main "$@"