embulk-executor-remoteserver 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. checksums.yaml +7 -0
  2. data/.circleci/config.yml +42 -0
  3. data/.gitignore +14 -0
  4. data/Dockerfile +14 -0
  5. data/LICENSE +21 -0
  6. data/README.md +30 -0
  7. data/build.gradle +70 -0
  8. data/docker-compose.yml +24 -0
  9. data/docker/run_embulk_server.sh +3 -0
  10. data/gradle.properties +1 -0
  11. data/gradle/dependency-locks/compileClasspath.lockfile +40 -0
  12. data/gradle/dependency-locks/testCompileClasspath.lockfile +49 -0
  13. data/gradle/wrapper/gradle-wrapper.jar +0 -0
  14. data/gradle/wrapper/gradle-wrapper.properties +5 -0
  15. data/gradlew +172 -0
  16. data/gradlew.bat +84 -0
  17. data/lib/embulk/executor/remoteserver.rb +3 -0
  18. data/settings.gradle +1 -0
  19. data/src/main/java/org/embulk/executor/remoteserver/EmbulkClient.java +111 -0
  20. data/src/main/java/org/embulk/executor/remoteserver/EmbulkServer.java +32 -0
  21. data/src/main/java/org/embulk/executor/remoteserver/Host.java +32 -0
  22. data/src/main/java/org/embulk/executor/remoteserver/InitializeSessionCommand.java +94 -0
  23. data/src/main/java/org/embulk/executor/remoteserver/Launcher.java +25 -0
  24. data/src/main/java/org/embulk/executor/remoteserver/NotifyTaskStateCommand.java +23 -0
  25. data/src/main/java/org/embulk/executor/remoteserver/PluginArchive.java +170 -0
  26. data/src/main/java/org/embulk/executor/remoteserver/RemoteServerExecutor.java +131 -0
  27. data/src/main/java/org/embulk/executor/remoteserver/RemoveSessionCommand.java +24 -0
  28. data/src/main/java/org/embulk/executor/remoteserver/Session.java +177 -0
  29. data/src/main/java/org/embulk/executor/remoteserver/SessionManager.java +37 -0
  30. data/src/main/java/org/embulk/executor/remoteserver/SessionState.java +143 -0
  31. data/src/main/java/org/embulk/executor/remoteserver/StartTaskCommand.java +51 -0
  32. data/src/main/java/org/embulk/executor/remoteserver/TaskExecutionException.java +11 -0
  33. data/src/main/java/org/embulk/executor/remoteserver/TaskState.java +5 -0
  34. data/src/main/java/org/embulk/executor/remoteserver/UpdateTaskStateData.java +55 -0
  35. data/src/main/resources/logback.xml +11 -0
  36. data/src/test/java/org/embulk/executor/remoteserver/TestRemoteServerExecutor.java +80 -0
  37. data/src/test/resources/json/test1.json +1 -0
  38. data/src/test/resources/json/test2.json +1 -0
  39. data/test/Gemfile +4 -0
  40. data/test/Gemfile.lock +20 -0
  41. data/test/setup.sh +8 -0
  42. metadata +119 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 471122040cf026eb287627d106e4b7b014bde970
4
+ data.tar.gz: cda196374b2e6737d73bbccb3ec5e33826cf8f45
5
+ SHA512:
6
+ metadata.gz: 0bba4418aaf83000aec6cad419e32c28eef1598a2a25441400e165527b5558956df2d28d7bd6a1eb1fb3c19a5d7f961470b7c5fd5a3dc42b5ca6315f5ba50a58
7
+ data.tar.gz: 8f28f104c3d2ba6424e5534adc62b95be593433cf77ad3a70bd4703263f6974e3fa72ed8afffed0390b3334b398c9817089efaaab2e9c8851e7f12f8ad7c66ce
@@ -0,0 +1,42 @@
1
+ version: 2
2
+ jobs:
3
+ build:
4
+ machine:
5
+ enabled: true
6
+ steps:
7
+ - checkout
8
+ - restore_cache:
9
+ keys:
10
+ - v1-gradle-{{ checksum "gradle/dependency-locks/compileClasspath.lockfile" }}-{{ checksum "gradle/dependency-locks/testCompileClasspath.lockfile" }}
11
+ - v1-gradle-
12
+ - run: ./test/setup.sh
13
+ - run: ./gradlew check --info
14
+ - run:
15
+ name: Save test results
16
+ command: |
17
+ mkdir -p ~/junit/
18
+ find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/junit/ \;
19
+ when: always
20
+ - store_test_results:
21
+ path: ~/junit
22
+ - store_artifacts:
23
+ path: ~/junit
24
+
25
+ - save_cache:
26
+ paths:
27
+ - "~/.gradle"
28
+ - "~/.m2"
29
+ key: v1-gradle-{{ checksum "gradle/dependency-locks/compileClasspath.lockfile" }}-{{ checksum "gradle/dependency-locks/testCompileClasspath.lockfile" }}
30
+
31
+ - deploy:
32
+ name: Push Gem to RubyGems.org and bump up
33
+ command: |
34
+ if [ "${CIRCLE_BRANCH}" == "release" ]; then
35
+ mkdir -p ~/.gem
36
+ curl -f -u ${RUBYGEMS_USER}:${RUBYGEMS_PASSWORD} https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials; chmod 0600 ~/.gem/credentials
37
+ git config --global user.email "shiketaudonko41@gmail.com"
38
+ git config --global user.name "kamatama41"
39
+ git checkout master
40
+ git reset --hard origin/master
41
+ ./gradlew release -Prelease.useAutomaticVersion=true
42
+ fi
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ *~
2
+ /pkg/
3
+ /tmp/
4
+ *.gemspec
5
+ .gradle/
6
+ /classpath/
7
+ build/
8
+ .idea
9
+ /.settings/
10
+ /.metadata/
11
+ .classpath
12
+ .project
13
+ *.iml
14
+ .bundle
data/Dockerfile ADDED
@@ -0,0 +1,14 @@
1
+ FROM openjdk:8
2
+ WORKDIR /usr/src/app
3
+ COPY build.gradle settings.gradle gradlew gradle.properties ./
4
+ COPY ./gradle ./gradle
5
+ COPY ./src ./src
6
+ COPY ./.git ./.git
7
+ RUN ./gradlew --no-daemon executableEmbulkServer
8
+
9
+ FROM openjdk:8-jre
10
+ WORKDIR /root/
11
+ COPY ./docker .
12
+ COPY --from=0 /usr/src/app/build/libs/embulk-server-*.jar ./embulk-server.jar
13
+ ENTRYPOINT ["/root/run_embulk_server.sh"]
14
+ EXPOSE 30001
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Shinichi Ishimura
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # Remote server executor plugin for Embulk
2
+
3
+ Embulk executor plugin to run plugins on remote server.
4
+
5
+ ## Overview
6
+
7
+ * **Plugin type**: executor
8
+
9
+ ## Configuration
10
+
11
+ - **hosts**: List of remote servers. If not specified, the executor runs as local mode, which start Embulk server on its own process (array of string)
12
+ - **timeout_seconds**: Timeout seconds of the whole execution (integer, default: `3600`)
13
+
14
+ ## Example
15
+
16
+ ```yaml
17
+ exec:
18
+ type: remoteserver
19
+ hosts:
20
+ - {name:remote-server1.com, port:30001}
21
+ - {name:remote-server2.com, port:30001}
22
+ timeout_seconds: 86400
23
+ ```
24
+
25
+
26
+ ## Build
27
+
28
+ ```
29
+ $ ./gradlew gem # -t to watch change of files and rebuild continuously
30
+ ```
data/build.gradle ADDED
@@ -0,0 +1,70 @@
1
+ plugins {
2
+ id "java"
3
+ id "com.github.kamatama41.embulk" version "0.5.2"
4
+ id "net.researchgate.release" version "2.8.0"
5
+ }
6
+
7
+ sourceCompatibility = 1.8
8
+ targetCompatibility = 1.8
9
+
10
+ repositories {
11
+ maven { url 'http://kamatama41.github.com/maven-repository/repository' }
12
+ }
13
+
14
+ configurations {
15
+ serverRuntime
16
+ serverRuntime.extendsFrom runtime, testRuntime
17
+
18
+ [compileClasspath, testCompileClasspath].each {
19
+ it.resolutionStrategy.activateDependencyLocking()
20
+ }
21
+ }
22
+
23
+ dependencies {
24
+ compile("com.github.kamatama41:nsocket:0.2.10") {
25
+ // Use embulk-core's Jackson (2.6.7) instead
26
+ exclude group: "com.fasterxml.jackson.core", module: "jackson-databind"
27
+ }
28
+ // Followings are needed for running EmbulkServer
29
+ implementation "org.embulk:embulk-standards:0.9.16"
30
+ serverRuntime "org.embulk:embulk-standards:0.9.16"
31
+ implementation "ch.qos.logback:logback-classic:1.2.3"
32
+ serverRuntime "ch.qos.logback:logback-classic:1.2.3"
33
+ implementation "ch.qos.logback:logback-core:1.2.3"
34
+ serverRuntime "ch.qos.logback:logback-core:1.2.3"
35
+
36
+ testImplementation "org.embulk:embulk-standards:0.9.16"
37
+ testImplementation "org.embulk:embulk-test:0.9.16"
38
+ testImplementation "com.github.kamatama41:embulk-test-helpers:0.8.0"
39
+ testImplementation "org.junit.jupiter:junit-jupiter-api:5.3.2"
40
+ testRuntime "org.junit.jupiter:junit-jupiter-engine:5.3.2"
41
+ }
42
+
43
+ task executableEmbulkServer(type: Jar) {
44
+ manifest {
45
+ attributes 'Main-Class': "org.embulk.executor.remoteserver.Launcher"
46
+ }
47
+ baseName = 'embulk-server'
48
+ from { (sourceSets.main.output + configurations.serverRuntime).collect { it.isDirectory() ? it : zipTree(it) } }
49
+ with jar
50
+ }
51
+
52
+ embulk {
53
+ version = "0.9.16"
54
+ category = "executor"
55
+ name = "docker"
56
+ authors = ["Shinichi Ishimura"]
57
+ email = "shiketaudonko41@gmail.com"
58
+ description = "Embulk executor plugin to run plugins on remote server."
59
+ licenses = ["MIT"]
60
+ homepage = "https://github.com/kamatama41/embulk-executor-remoteserver"
61
+ }
62
+
63
+ test {
64
+ useJUnitPlatform()
65
+ }
66
+
67
+ release {
68
+ git { requireBranch = 'master' }
69
+ }
70
+ afterReleaseBuild.dependsOn gemPush
@@ -0,0 +1,24 @@
1
+ version: '3.2'
2
+ services:
3
+ server1:
4
+ build:
5
+ context: .
6
+ dockerfile: Dockerfile
7
+ environment:
8
+ LOG_LEVEL: debug
9
+ ports:
10
+ - "24224:30001"
11
+ volumes:
12
+ - ./tmp/output:/output
13
+ - ./src/test/resources/json:/root/src/test/resources/json
14
+ server2:
15
+ build:
16
+ context: .
17
+ dockerfile: Dockerfile
18
+ environment:
19
+ LOG_LEVEL: debug
20
+ ports:
21
+ - "24225:30001"
22
+ volumes:
23
+ - ./tmp/output:/output
24
+ - ./src/test/resources/json:/root/src/test/resources/json
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+ cmd="java ${JVM_OPTS} -jar /root/embulk-server.jar"
3
+ exec ${cmd}
data/gradle.properties ADDED
@@ -0,0 +1 @@
1
+ version=0.1.0
@@ -0,0 +1,40 @@
1
+ # This is a Gradle generated file for dependency locking.
2
+ # Manual edits can break the build and are not advised.
3
+ # This file is expected to be part of source control.
4
+ aopalliance:aopalliance:1.0
5
+ ch.qos.logback:logback-classic:1.2.3
6
+ ch.qos.logback:logback-core:1.2.3
7
+ com.fasterxml.jackson.core:jackson-annotations:2.6.7
8
+ com.fasterxml.jackson.core:jackson-core:2.6.7
9
+ com.fasterxml.jackson.core:jackson-databind:2.6.7
10
+ com.fasterxml.jackson.datatype:jackson-datatype-guava:2.6.7
11
+ com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.6.7
12
+ com.fasterxml.jackson.datatype:jackson-datatype-joda:2.6.7
13
+ com.fasterxml.jackson.module:jackson-module-guice:2.6.7
14
+ com.github.kamatama41:nsocket:0.2.10
15
+ com.google.code.findbugs:annotations:3.0.0
16
+ com.google.guava:guava:18.0
17
+ com.google.inject.extensions:guice-multibindings:4.0
18
+ com.google.inject:guice:4.0
19
+ com.ibm.icu:icu4j:54.1.1
20
+ commons-beanutils:commons-beanutils-core:1.8.3
21
+ commons-cli:commons-cli:1.3.1
22
+ commons-collections:commons-collections:3.2.1
23
+ commons-lang:commons-lang:2.4
24
+ io.airlift:slice:0.9
25
+ io.netty:netty-buffer:4.0.44.Final
26
+ io.netty:netty-common:4.0.44.Final
27
+ javax.inject:javax.inject:1
28
+ javax.validation:validation-api:1.1.0.Final
29
+ joda-time:joda-time:2.9.2
30
+ org.apache.bval:bval-core:0.5
31
+ org.apache.bval:bval-jsr303:0.5
32
+ org.apache.commons:commons-compress:1.10
33
+ org.apache.commons:commons-lang3:3.4
34
+ org.apache.velocity:velocity:1.7
35
+ org.embulk:embulk-core:0.9.16
36
+ org.embulk:embulk-standards:0.9.16
37
+ org.jruby:jruby-complete:9.1.15.0
38
+ org.msgpack:msgpack-core:0.8.11
39
+ org.slf4j:slf4j-api:1.7.25
40
+ org.yaml:snakeyaml:1.18
@@ -0,0 +1,49 @@
1
+ # This is a Gradle generated file for dependency locking.
2
+ # Manual edits can break the build and are not advised.
3
+ # This file is expected to be part of source control.
4
+ aopalliance:aopalliance:1.0
5
+ ch.qos.logback:logback-classic:1.2.3
6
+ ch.qos.logback:logback-core:1.2.3
7
+ com.fasterxml.jackson.core:jackson-annotations:2.6.7
8
+ com.fasterxml.jackson.core:jackson-core:2.6.7
9
+ com.fasterxml.jackson.core:jackson-databind:2.6.7
10
+ com.fasterxml.jackson.datatype:jackson-datatype-guava:2.6.7
11
+ com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.6.7
12
+ com.fasterxml.jackson.datatype:jackson-datatype-joda:2.6.7
13
+ com.fasterxml.jackson.module:jackson-module-guice:2.6.7
14
+ com.github.kamatama41:embulk-test-helpers:0.8.0
15
+ com.github.kamatama41:nsocket:0.2.10
16
+ com.google.code.findbugs:annotations:3.0.0
17
+ com.google.guava:guava:18.0
18
+ com.google.inject.extensions:guice-multibindings:4.0
19
+ com.google.inject:guice:4.0
20
+ com.ibm.icu:icu4j:54.1.1
21
+ commons-beanutils:commons-beanutils-core:1.8.3
22
+ commons-cli:commons-cli:1.3.1
23
+ commons-collections:commons-collections:3.2.1
24
+ commons-lang:commons-lang:2.4
25
+ io.airlift:slice:0.9
26
+ io.netty:netty-buffer:4.0.44.Final
27
+ io.netty:netty-common:4.0.44.Final
28
+ javax.inject:javax.inject:1
29
+ javax.validation:validation-api:1.1.0.Final
30
+ joda-time:joda-time:2.9.2
31
+ junit:junit:4.12
32
+ org.apache.bval:bval-core:0.5
33
+ org.apache.bval:bval-jsr303:0.5
34
+ org.apache.commons:commons-compress:1.10
35
+ org.apache.commons:commons-lang3:3.4
36
+ org.apache.velocity:velocity:1.7
37
+ org.apiguardian:apiguardian-api:1.0.0
38
+ org.embulk:embulk-core:0.9.16
39
+ org.embulk:embulk-standards:0.9.16
40
+ org.embulk:embulk-test:0.9.16
41
+ org.hamcrest:hamcrest-core:1.3
42
+ org.hamcrest:hamcrest-library:1.3
43
+ org.jruby:jruby-complete:9.1.15.0
44
+ org.junit.jupiter:junit-jupiter-api:5.3.2
45
+ org.junit.platform:junit-platform-commons:1.3.2
46
+ org.msgpack:msgpack-core:0.8.11
47
+ org.opentest4j:opentest4j:1.1.1
48
+ org.slf4j:slf4j-api:1.7.25
49
+ org.yaml:snakeyaml:1.18
Binary file
@@ -0,0 +1,5 @@
1
+ distributionBase=GRADLE_USER_HOME
2
+ distributionPath=wrapper/dists
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
4
+ zipStoreBase=GRADLE_USER_HOME
5
+ zipStorePath=wrapper/dists
data/gradlew ADDED
@@ -0,0 +1,172 @@
1
+ #!/usr/bin/env sh
2
+
3
+ ##############################################################################
4
+ ##
5
+ ## Gradle start up script for UN*X
6
+ ##
7
+ ##############################################################################
8
+
9
+ # Attempt to set APP_HOME
10
+ # Resolve links: $0 may be a link
11
+ PRG="$0"
12
+ # Need this for relative symlinks.
13
+ while [ -h "$PRG" ] ; do
14
+ ls=`ls -ld "$PRG"`
15
+ link=`expr "$ls" : '.*-> \(.*\)$'`
16
+ if expr "$link" : '/.*' > /dev/null; then
17
+ PRG="$link"
18
+ else
19
+ PRG=`dirname "$PRG"`"/$link"
20
+ fi
21
+ done
22
+ SAVED="`pwd`"
23
+ cd "`dirname \"$PRG\"`/" >/dev/null
24
+ APP_HOME="`pwd -P`"
25
+ cd "$SAVED" >/dev/null
26
+
27
+ APP_NAME="Gradle"
28
+ APP_BASE_NAME=`basename "$0"`
29
+
30
+ # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31
+ DEFAULT_JVM_OPTS='"-Xmx64m"'
32
+
33
+ # Use the maximum available, or set MAX_FD != -1 to use that value.
34
+ MAX_FD="maximum"
35
+
36
+ warn () {
37
+ echo "$*"
38
+ }
39
+
40
+ die () {
41
+ echo
42
+ echo "$*"
43
+ echo
44
+ exit 1
45
+ }
46
+
47
+ # OS specific support (must be 'true' or 'false').
48
+ cygwin=false
49
+ msys=false
50
+ darwin=false
51
+ nonstop=false
52
+ case "`uname`" in
53
+ CYGWIN* )
54
+ cygwin=true
55
+ ;;
56
+ Darwin* )
57
+ darwin=true
58
+ ;;
59
+ MINGW* )
60
+ msys=true
61
+ ;;
62
+ NONSTOP* )
63
+ nonstop=true
64
+ ;;
65
+ esac
66
+
67
+ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68
+
69
+ # Determine the Java command to use to start the JVM.
70
+ if [ -n "$JAVA_HOME" ] ; then
71
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72
+ # IBM's JDK on AIX uses strange locations for the executables
73
+ JAVACMD="$JAVA_HOME/jre/sh/java"
74
+ else
75
+ JAVACMD="$JAVA_HOME/bin/java"
76
+ fi
77
+ if [ ! -x "$JAVACMD" ] ; then
78
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79
+
80
+ Please set the JAVA_HOME variable in your environment to match the
81
+ location of your Java installation."
82
+ fi
83
+ else
84
+ JAVACMD="java"
85
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86
+
87
+ Please set the JAVA_HOME variable in your environment to match the
88
+ location of your Java installation."
89
+ fi
90
+
91
+ # Increase the maximum file descriptors if we can.
92
+ if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93
+ MAX_FD_LIMIT=`ulimit -H -n`
94
+ if [ $? -eq 0 ] ; then
95
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96
+ MAX_FD="$MAX_FD_LIMIT"
97
+ fi
98
+ ulimit -n $MAX_FD
99
+ if [ $? -ne 0 ] ; then
100
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
101
+ fi
102
+ else
103
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104
+ fi
105
+ fi
106
+
107
+ # For Darwin, add options to specify how the application appears in the dock
108
+ if $darwin; then
109
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110
+ fi
111
+
112
+ # For Cygwin, switch paths to Windows format before running java
113
+ if $cygwin ; then
114
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116
+ JAVACMD=`cygpath --unix "$JAVACMD"`
117
+
118
+ # We build the pattern for arguments to be converted via cygpath
119
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120
+ SEP=""
121
+ for dir in $ROOTDIRSRAW ; do
122
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
123
+ SEP="|"
124
+ done
125
+ OURCYGPATTERN="(^($ROOTDIRS))"
126
+ # Add a user-defined pattern to the cygpath arguments
127
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129
+ fi
130
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
131
+ i=0
132
+ for arg in "$@" ; do
133
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135
+
136
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138
+ else
139
+ eval `echo args$i`="\"$arg\""
140
+ fi
141
+ i=$((i+1))
142
+ done
143
+ case $i in
144
+ (0) set -- ;;
145
+ (1) set -- "$args0" ;;
146
+ (2) set -- "$args0" "$args1" ;;
147
+ (3) set -- "$args0" "$args1" "$args2" ;;
148
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154
+ esac
155
+ fi
156
+
157
+ # Escape application args
158
+ save () {
159
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160
+ echo " "
161
+ }
162
+ APP_ARGS=$(save "$@")
163
+
164
+ # Collect all arguments for the java command, following the shell quoting and substitution rules
165
+ eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166
+
167
+ # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168
+ if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169
+ cd "$(dirname "$0")"
170
+ fi
171
+
172
+ exec "$JAVACMD" "$@"