You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/05/28 10:06:52 UTC
[1/7] incubator-ignite git commit: # ignite-456: add more git logs
Repository: incubator-ignite
Updated Branches:
refs/heads/ignite-860 b368ce56d -> 1d6713d0b
# ignite-456: add more git logs
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4be517c8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4be517c8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4be517c8
Branch: refs/heads/ignite-860
Commit: 4be517c868e6798876a6eb44fcbc307ba4451603
Parents: 3a84c4b
Author: null <null>
Authored: Wed May 27 15:19:41 2015 +0300
Committer: null <null>
Committed: Wed May 27 15:19:41 2015 +0300
----------------------------------------------------------------------
dev-tools/src/main/groovy/jiraslurp.groovy | 36 +++++++++++++++++++------
1 file changed, 28 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4be517c8/dev-tools/src/main/groovy/jiraslurp.groovy
----------------------------------------------------------------------
diff --git a/dev-tools/src/main/groovy/jiraslurp.groovy b/dev-tools/src/main/groovy/jiraslurp.groovy
index e1db80f..75a595f 100644
--- a/dev-tools/src/main/groovy/jiraslurp.groovy
+++ b/dev-tools/src/main/groovy/jiraslurp.groovy
@@ -51,6 +51,28 @@ def checkprocess = { process ->
}
}
+def exec = {command, envp, dir ->
+ println "Executing command '$command'..."
+
+ def ps = command.execute(envp, dir)
+
+ try {
+ println "Command output:"
+
+ println ps.text
+ }
+ catch (Throwable e) {
+ // Do nothing.
+ println "Error: could not get caommand output."
+ }
+
+ checkprocess ps
+}
+
+def execGit = {command ->
+ exec(command, null, new File("../"))
+}
+
/**
* Util method to send http request.
*/
@@ -252,8 +274,6 @@ def tryGitAmAbort = {
}
catch (Throwable e) {
println "Error: git am --abort fails: "
-
- e.printStackTrace()
}
}
@@ -278,20 +298,20 @@ def applyPatch = { jira, attachementURL ->
try {
tryGitAmAbort()
- checkprocess "git branch".execute()
+ execGit "git branch"
- checkprocess "git config user.email \"$userEmail\"".execute(null, new File("../"))
- checkprocess "git config user.name \"$userName\"".execute(null, new File("../"))
+ execGit "git config user.email \"$userEmail\""
+ execGit "git config user.name \"$userName\""
// Create a new uniqueue branch to applying patch
def newTestBranch = "test-branch-${jira}-${attachementURL}-${System.currentTimeMillis()}"
- checkprocess "git checkout -b ${newTestBranch}".execute(null, new File("../"))
+ execGit "git checkout -b ${newTestBranch}"
- checkprocess "git branch".execute()
+ execGit "git branch"
println "Trying to apply patch."
- checkprocess "git am dev-tools/${patchFile.name}".execute(null, new File("../"))
+ execGit "git am dev-tools/${patchFile.name}"
println "Patch was applied successfully."
}
[2/7] incubator-ignite git commit: IGNITE-927
Posted by sb...@apache.org.
IGNITE-927
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5ec24072
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5ec24072
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5ec24072
Branch: refs/heads/ignite-860
Commit: 5ec240720429034ed388e2f916b71e04f7437041
Parents: 4be517c
Author: avinogradov <av...@gridgain.com>
Authored: Wed May 27 19:34:03 2015 +0300
Committer: avinogradov <av...@gridgain.com>
Committed: Wed May 27 19:34:03 2015 +0300
----------------------------------------------------------------------
.../licenses/jcraft-revised-bsd.txt | 28 --------------------
1 file changed, 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5ec24072/modules/visor-console/licenses/jcraft-revised-bsd.txt
----------------------------------------------------------------------
diff --git a/modules/visor-console/licenses/jcraft-revised-bsd.txt b/modules/visor-console/licenses/jcraft-revised-bsd.txt
deleted file mode 100644
index 3748f98..0000000
--- a/modules/visor-console/licenses/jcraft-revised-bsd.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-3-clause BSD license
-------------------------------------------------------------------------------
-Copyright (c) 2002-2014 Atsuhiko Yamanaka, JCraft,Inc.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the distribution.
-
- 3. The names of the authors may not be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
-INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
[4/7] incubator-ignite git commit: Merge remote-tracking branch
'origin/ignite-sprint-5' into ignite-sprint-5
Posted by sb...@apache.org.
Merge remote-tracking branch 'origin/ignite-sprint-5' into ignite-sprint-5
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/afe841c6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/afe841c6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/afe841c6
Branch: refs/heads/ignite-860
Commit: afe841c6adcd85edcb0964158dcec914384ea7d7
Parents: 80f4ac2 5ec2407
Author: null <null>
Authored: Wed May 27 21:19:07 2015 +0300
Committer: null <null>
Committed: Wed May 27 21:19:07 2015 +0300
----------------------------------------------------------------------
.../licenses/jcraft-revised-bsd.txt | 28 --------------------
1 file changed, 28 deletions(-)
----------------------------------------------------------------------
[3/7] incubator-ignite git commit: # ignite-456: fix encoding issue
Posted by sb...@apache.org.
# ignite-456: fix encoding issue
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/80f4ac2a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/80f4ac2a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/80f4ac2a
Branch: refs/heads/ignite-860
Commit: 80f4ac2a3e31c681732cb144e14a614f6b8cb963
Parents: 4be517c
Author: null <null>
Authored: Wed May 27 21:18:54 2015 +0300
Committer: null <null>
Committed: Wed May 27 21:18:54 2015 +0300
----------------------------------------------------------------------
dev-tools/slurp.sh | 2 +-
dev-tools/src/main/groovy/jiraslurp.groovy | 73 ++++++++++++++++---------
2 files changed, 47 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/80f4ac2a/dev-tools/slurp.sh
----------------------------------------------------------------------
diff --git a/dev-tools/slurp.sh b/dev-tools/slurp.sh
index 7eb6fdb..7edc776 100755
--- a/dev-tools/slurp.sh
+++ b/dev-tools/slurp.sh
@@ -52,7 +52,7 @@ TASK_RUNNER_USER='task_runner'
TASK_RUNNER_PWD=''
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
-echo "<"$(date +"%H:%M:%S")"> Starting task triggering"
+echo "<"$(date + "%D - %H:%M:%S")"> Starting task triggering"
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
# Useful settings
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/80f4ac2a/dev-tools/src/main/groovy/jiraslurp.groovy
----------------------------------------------------------------------
diff --git a/dev-tools/src/main/groovy/jiraslurp.groovy b/dev-tools/src/main/groovy/jiraslurp.groovy
index 75a595f..3547337 100644
--- a/dev-tools/src/main/groovy/jiraslurp.groovy
+++ b/dev-tools/src/main/groovy/jiraslurp.groovy
@@ -45,7 +45,7 @@ def checkprocess = { process ->
if (process.exitValue() != 0) {
println "Return code: " + process.exitValue()
- println "Errout:\n" + process.err.text
+// println "Errout:\n" + process.err.text
assert process.exitValue() == 0 || process.exitValue() == 128
}
@@ -281,50 +281,69 @@ def tryGitAmAbort = {
* Applys patch from jira to given git state.
*/
def applyPatch = { jira, attachementURL ->
- def userEmail = System.getenv("env.GIT_USER_EMAIL");
- def userName = System.getenv("env.GIT_USER_NAME");
+ // Delete all old IGNITE-*-*.patch files.
+ def directory = new File("./")
+
+ println "Remove IGNITE-*-*.patch files in ${directory.absolutePath} and its subdirectories..."
+
+ def classPattern = ~/.*IGNITE-.*-.*\.patch/
+
+ directory.eachFileRecurse(groovy.io.FileType.FILES)
+ { file ->
+ if (file ==~ classPattern){
+ println "Deleting ${file}..."
+ file.delete()
+ }
+ }
+
+ // Main logic.
println "Patch apllying with jira='$jira' and attachment='$ATTACHMENT_URL/$attachementURL/'."
+ def userEmail = System.getenv("env.GIT_USER_EMAIL");
+ def userName = System.getenv("env.GIT_USER_NAME");
+
def patchFile = new File("${jira}-${attachementURL}.patch")
- try {
- println "Getting patch content."
+ println "Getting patch content."
- patchFile << new URL("$ATTACHMENT_URL/$attachementURL/").text
+ def attachmentUrl = new URL("$ATTACHMENT_URL/$attachementURL/")
- println "Got patch content."
+ HttpURLConnection conn = (HttpURLConnection)attachmentUrl.openConnection();
+ conn.setRequestProperty("Content-Type", "text/x-patch;charset=utf-8");
+ conn.setRequestProperty("X-Content-Type-Options", "nosniff");
+ conn.connect();
- try {
- tryGitAmAbort()
+ patchFile << conn.getInputStream()
- execGit "git branch"
+ println "Got patch content."
- execGit "git config user.email \"$userEmail\""
- execGit "git config user.name \"$userName\""
+ try {
+ tryGitAmAbort()
- // Create a new uniqueue branch to applying patch
- def newTestBranch = "test-branch-${jira}-${attachementURL}-${System.currentTimeMillis()}"
- execGit "git checkout -b ${newTestBranch}"
+ execGit "git branch"
- execGit "git branch"
+ execGit "git config user.email \"$userEmail\""
+ execGit "git config user.name \"$userName\""
- println "Trying to apply patch."
+ // Create a new uniqueue branch to applying patch
+ def newTestBranch = "test-branch-${jira}-${attachementURL}-${System.currentTimeMillis()}"
+ execGit "git checkout -b ${newTestBranch}"
- execGit "git am dev-tools/${patchFile.name}"
+ execGit "git branch"
- println "Patch was applied successfully."
- }
- catch (Throwable e) {
- println "Patch was not applied successfully. Aborting patch applying."
+ println "Trying to apply patch."
- tryGitAmAbort()
+ execGit "git am dev-tools/${patchFile.name}"
- throw e;
- }
+ println "Patch was applied successfully."
}
- finally {
- assert patchFile.delete(), 'Could not delete patch file.'
+ catch (Throwable e) {
+ println "Patch was not applied successfully. Aborting patch applying."
+
+ tryGitAmAbort()
+
+ throw e;
}
}
[7/7] incubator-ignite git commit: Merge remote-tracking branch
'remotes/origin/ignite-sprint-5' into ignite-860
Posted by sb...@apache.org.
Merge remote-tracking branch 'remotes/origin/ignite-sprint-5' into ignite-860
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/1d6713d0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/1d6713d0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/1d6713d0
Branch: refs/heads/ignite-860
Commit: 1d6713d0bfa2950f013d5c9a40d0d02afb91f083
Parents: b368ce5 c3bf803
Author: ivasilinets <iv...@gridgain.com>
Authored: Thu May 28 11:06:30 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Thu May 28 11:06:30 2015 +0300
----------------------------------------------------------------------
dev-tools/gradle/wrapper/gradle-wrapper.jar | Bin 51017 -> 0 bytes
.../gradle/wrapper/gradle-wrapper.properties | 18 +-
dev-tools/gradlew | 163 +++++++++++++------
dev-tools/slurp.sh | 2 +-
dev-tools/src/main/groovy/jiraslurp.groovy | 97 +++++++----
.../cache/IgniteDynamicCacheStartSelfTest.java | 20 ++-
.../licenses/jcraft-revised-bsd.txt | 28 ----
7 files changed, 213 insertions(+), 115 deletions(-)
----------------------------------------------------------------------
[6/7] incubator-ignite git commit: # sprint-5 use vm ip finder in test
Posted by sb...@apache.org.
# sprint-5 use vm ip finder in test
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/c3bf8031
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/c3bf8031
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/c3bf8031
Branch: refs/heads/ignite-860
Commit: c3bf803132c9d048f9f5236339eb71ed24d28625
Parents: e16cb03
Author: sboikov <sb...@gridgain.com>
Authored: Thu May 28 09:06:04 2015 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Thu May 28 09:06:04 2015 +0300
----------------------------------------------------------------------
.../cache/IgniteDynamicCacheStartSelfTest.java | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c3bf8031/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java
index 72b76d7..095221e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteDynamicCacheStartSelfTest.java
@@ -26,6 +26,9 @@ import org.apache.ignite.internal.*;
import org.apache.ignite.internal.managers.discovery.*;
import org.apache.ignite.internal.util.typedef.*;
import org.apache.ignite.lang.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
import org.apache.ignite.testframework.*;
import org.apache.ignite.testframework.junits.common.*;
@@ -40,6 +43,9 @@ import java.util.concurrent.atomic.*;
@SuppressWarnings("unchecked")
public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest {
/** */
+ private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
+ /** */
private static final String DYNAMIC_CACHE_NAME = "TestDynamicCache";
/** */
@@ -51,8 +57,7 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest {
/** */
public static final IgnitePredicate<ClusterNode> NODE_FILTER = new IgnitePredicate<ClusterNode>() {
/** {@inheritDoc} */
- @Override
- public boolean apply(ClusterNode n) {
+ @Override public boolean apply(ClusterNode n) {
Boolean val = n.attribute(TEST_ATTRIBUTE_NAME);
return val != null && val;
@@ -78,6 +83,8 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest {
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
+ ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(ipFinder);
+
cfg.setUserAttributes(F.asMap(TEST_ATTRIBUTE_NAME, testAttribute));
CacheConfiguration cacheCfg = new CacheConfiguration();
@@ -157,8 +164,7 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest {
futs.clear();
GridTestUtils.runMultiThreaded(new Callable<Object>() {
- @Override
- public Object call() throws Exception {
+ @Override public Object call() throws Exception {
futs.add(kernal.context().cache().dynamicStopCache(DYNAMIC_CACHE_NAME));
return null;
@@ -218,8 +224,7 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest {
futs.clear();
GridTestUtils.runMultiThreaded(new Callable<Object>() {
- @Override
- public Object call() throws Exception {
+ @Override public Object call() throws Exception {
IgniteEx kernal = grid(ThreadLocalRandom.current().nextInt(nodeCount()));
futs.add(kernal.context().cache().dynamicStopCache(DYNAMIC_CACHE_NAME));
@@ -940,8 +945,7 @@ public class IgniteDynamicCacheStartSelfTest extends GridCommonAbstractTest {
latches[i] = new CountDownLatch(1);
lsnrs[i] = new IgnitePredicate<CacheEvent>() {
- @Override
- public boolean apply(CacheEvent e) {
+ @Override public boolean apply(CacheEvent e) {
switch (e.type()) {
case EventType.EVT_CACHE_NODES_LEFT:
latches[idx].countDown();
[5/7] incubator-ignite git commit: # ignite-899
Posted by sb...@apache.org.
# 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-860
Commit: e16cb03658bc5ca7c97ac3f45b17bdca3cfae758
Parents: afe841c
Author: null <null>
Authored: Wed May 27 21:19:42 2015 +0300
Committer: null <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 "$@"