trackler 2.2.1.77 → 2.2.1.78
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.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/problem-specifications/exercises/transpose/canonical-data.json +94 -116
- data/tracks/bash/config/maintainers.json +11 -1
- data/tracks/clojure/config.json +10 -2
- data/tracks/clojure/exercises/reverse-string/README.md +14 -0
- data/tracks/clojure/exercises/reverse-string/project.clj +4 -0
- data/tracks/clojure/exercises/reverse-string/src/example.clj +5 -0
- data/tracks/clojure/exercises/reverse-string/src/reverse_string.clj +5 -0
- data/tracks/clojure/exercises/reverse-string/test/reverse_string_test.clj +18 -0
- data/tracks/clojure/exercises/say/README.md +70 -0
- data/tracks/clojure/exercises/{two-fer → say}/project.clj +3 -3
- data/tracks/clojure/exercises/say/src/example.clj +9 -0
- data/tracks/clojure/exercises/say/src/say.clj +5 -0
- data/tracks/clojure/exercises/say/test/say_test.clj +48 -0
- data/tracks/coffeescript/docs/ABOUT.md +4 -9
- data/tracks/coffeescript/docs/INSTALLATION.md +2 -2
- data/tracks/erlang/exercises/pangram/rebar.config +1 -1
- data/tracks/erlang/exercises/pangram/src/example.erl +2 -3
- data/tracks/erlang/exercises/pangram/test/pangram_tests.erl +12 -13
- data/tracks/fsharp/exercises/grep/Example.fs +16 -20
- data/tracks/fsharp/exercises/grep/GrepTest.fs +154 -233
- data/tracks/fsharp/generators/Common.fs +7 -2
- data/tracks/fsharp/generators/Exercise.fs +51 -16
- data/tracks/fsharp/generators/Formatting.fs +13 -6
- data/tracks/fsharp/generators/Generators.fs +44 -14
- data/tracks/fsharp/generators/Rendering.fs +8 -1
- data/tracks/fsharp/generators/Templates/Generators/_GrepSetup.liquid +37 -0
- data/tracks/fsharp/generators/Templates/_TestClass.liquid +9 -3
- data/tracks/fsharp/generators/Templates/{_TestMethod.liquid → _TestFunction.liquid} +0 -0
- data/tracks/fsharp/generators/Templates/{_TestMethodBody.liquid → _TestFunctionBody.liquid} +0 -0
- data/tracks/fsharp/generators/Templates/_TestMember.liquid +3 -0
- data/tracks/fsharp/generators/Templates/_TestMemberBody.liquid +4 -0
- data/tracks/fsharp/generators/Templates/_TestModule.liquid +17 -0
- data/tracks/go/config.json +24 -0
- data/tracks/go/exercises/acronym/.meta/gen.go +5 -3
- data/tracks/go/exercises/acronym/acronym.go +0 -2
- data/tracks/go/exercises/acronym/cases_test.go +2 -2
- data/tracks/go/exercises/acronym/example.go +2 -3
- data/tracks/go/exercises/all-your-base/.meta/gen.go +9 -7
- data/tracks/go/exercises/all-your-base/cases_test.go +2 -2
- data/tracks/go/exercises/allergies/.meta/gen.go +10 -6
- data/tracks/go/exercises/allergies/cases_test.go +2 -2
- data/tracks/go/exercises/anagram/.meta/gen.go +7 -5
- data/tracks/go/exercises/anagram/cases_test.go +2 -2
- data/tracks/go/exercises/armstrong-numbers/.meta/gen.go +54 -0
- data/tracks/go/exercises/armstrong-numbers/armstrong_test.go +12 -0
- data/tracks/go/exercises/armstrong-numbers/cases_test.go +52 -0
- data/tracks/go/exercises/armstrong-numbers/example.go +24 -0
- data/tracks/go/exercises/binary-search/.meta/gen.go +7 -5
- data/tracks/go/exercises/binary-search/cases_test.go +2 -2
- data/tracks/go/exercises/book-store/.meta/gen.go +5 -3
- data/tracks/go/exercises/book-store/cases_test.go +2 -2
- data/tracks/go/exercises/connect/example.go +4 -5
- data/tracks/go/exercises/dominoes/.meta/gen.go +61 -0
- data/tracks/go/exercises/dominoes/.meta/hints.md +29 -0
- data/tracks/go/exercises/dominoes/README.md +67 -0
- data/tracks/go/exercises/dominoes/cases_test.go +72 -0
- data/tracks/go/exercises/dominoes/dominoes_test.go +106 -0
- data/tracks/go/exercises/dominoes/example.go +146 -0
- data/tracks/go/exercises/ledger/example.go +1 -1
- data/tracks/groovy/.gitignore +3 -0
- data/tracks/groovy/.travis.yml +10 -1
- data/tracks/groovy/bin/prepeare_exercise_builds.groovy +77 -0
- data/tracks/groovy/build.gradle +25 -0
- data/tracks/groovy/exercises/difference-of-squares/Example.groovy +3 -3
- data/tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy +3 -3
- data/tracks/groovy/exercises/linked-list/{DoubleLinkedList.groovy → LinkedList.groovy} +0 -0
- data/tracks/groovy/exercises/linked-list/{DoubleLinkedListSpec.groovy → LinkedListSpec.groovy} +0 -0
- data/tracks/groovy/exercises/linked-list/README.md +1 -1
- data/tracks/groovy/gradle/wrapper/gradle-wrapper.jar +0 -0
- data/tracks/groovy/gradle/wrapper/gradle-wrapper.properties +6 -0
- data/tracks/groovy/gradlew +172 -0
- data/tracks/groovy/gradlew.bat +84 -0
- data/tracks/groovy/settings.gradle +9 -0
- data/tracks/ocaml/exercises/acronym/.merlin +1 -1
- data/tracks/ocaml/exercises/all-your-base/.merlin +1 -1
- data/tracks/ocaml/exercises/anagram/.merlin +1 -1
- data/tracks/ocaml/exercises/atbash-cipher/.merlin +1 -1
- data/tracks/ocaml/exercises/beer-song/.merlin +1 -1
- data/tracks/ocaml/exercises/binary-search/.merlin +1 -1
- data/tracks/ocaml/exercises/bob/.merlin +1 -1
- data/tracks/ocaml/exercises/bowling/.merlin +1 -1
- data/tracks/ocaml/exercises/change/.merlin +1 -1
- data/tracks/ocaml/exercises/difference-of-squares/.merlin +1 -1
- data/tracks/ocaml/exercises/etl/.merlin +1 -1
- data/tracks/ocaml/exercises/forth/.merlin +1 -1
- data/tracks/ocaml/exercises/grade-school/.merlin +1 -1
- data/tracks/ocaml/exercises/hamming/.merlin +1 -1
- data/tracks/ocaml/exercises/hangman/.merlin +1 -1
- data/tracks/ocaml/exercises/hello-world/.merlin +1 -1
- data/tracks/ocaml/exercises/hexadecimal/.merlin +1 -1
- data/tracks/ocaml/exercises/leap/.merlin +1 -1
- data/tracks/ocaml/exercises/list-ops/.merlin +1 -1
- data/tracks/ocaml/exercises/luhn/.merlin +1 -1
- data/tracks/ocaml/exercises/meetup/.merlin +1 -1
- data/tracks/ocaml/exercises/minesweeper/.merlin +1 -1
- data/tracks/ocaml/exercises/nucleotide-count/.merlin +1 -1
- data/tracks/ocaml/exercises/phone-number/.merlin +1 -1
- data/tracks/ocaml/exercises/prime-factors/.merlin +1 -1
- data/tracks/ocaml/exercises/raindrops/.merlin +1 -1
- data/tracks/ocaml/exercises/react/.merlin +1 -1
- data/tracks/ocaml/exercises/rectangles/.merlin +1 -1
- data/tracks/ocaml/exercises/rna-transcription/.merlin +1 -1
- data/tracks/ocaml/exercises/run-length-encoding/.merlin +1 -1
- data/tracks/ocaml/exercises/say/.merlin +1 -1
- data/tracks/ocaml/exercises/space-age/.merlin +1 -1
- data/tracks/ocaml/exercises/triangle/.merlin +1 -1
- data/tracks/ocaml/exercises/word-count/.merlin +1 -1
- data/tracks/ocaml/exercises/zipper/.merlin +1 -1
- data/tracks/typescript/config/maintainers.json +2 -2
- metadata +37 -12
- data/tracks/clojure/exercises/two-fer/README.md +0 -19
- data/tracks/clojure/exercises/two-fer/src/example.clj +0 -5
- data/tracks/clojure/exercises/two-fer/src/two_fer.clj +0 -5
- data/tracks/clojure/exercises/two-fer/test/two_fer_test.clj +0 -12
- data/tracks/erlang/exercises/pangram/include/exercism.hrl +0 -11
|
@@ -161,7 +161,7 @@ func (e entrySlice) Less(i, j int) bool {
|
|
|
161
161
|
// ISO dates sort nicely
|
|
162
162
|
return e[i].Date < e[j].Date
|
|
163
163
|
}
|
|
164
|
-
if e[i].Description != e[
|
|
164
|
+
if e[i].Description != e[j].Description {
|
|
165
165
|
return e[i].Description < e[j].Description
|
|
166
166
|
}
|
|
167
167
|
return e[i].Change < e[j].Change
|
data/tracks/groovy/.gitignore
CHANGED
data/tracks/groovy/.travis.yml
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
language:
|
|
1
|
+
language: groovy
|
|
2
|
+
jdk:
|
|
3
|
+
- oraclejdk8
|
|
4
|
+
|
|
5
|
+
sudo: false
|
|
6
|
+
|
|
7
|
+
before_install:
|
|
8
|
+
- chmod +x gradlew
|
|
2
9
|
|
|
3
10
|
script:
|
|
4
11
|
- bin/fetch-configlet
|
|
5
12
|
- bin/configlet lint .
|
|
13
|
+
- groovy bin/prepeare_exercise_builds.groovy $TRAVIS_BUILD_DIR
|
|
14
|
+
- ./gradlew build
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import java.nio.file.Files
|
|
2
|
+
import java.nio.file.Paths
|
|
3
|
+
|
|
4
|
+
final String MAIN_BUILD_DIR = args[0]
|
|
5
|
+
|
|
6
|
+
def exerciseDir = new File("${MAIN_BUILD_DIR}${File.separator}exercises")
|
|
7
|
+
|
|
8
|
+
Map<String, String> exercises = new HashMap<>()
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exerciseDir.eachDir {
|
|
12
|
+
exercises.put(this.toCamelCase(it.name), it.path)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
exercises.each {k, v ->
|
|
16
|
+
println("Creating build for exercise '$k' in '$v' directory")
|
|
17
|
+
this.prepareExerciseSubProjectBuild(k, v, MAIN_BUILD_DIR)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
void prepareExerciseSubProjectBuild(String exerciseName, String pathToExerciseDirectory, String mainBuildDir) {
|
|
21
|
+
String sep = File.separator
|
|
22
|
+
String srcDirRelative = "${sep}src${sep}main${sep}groovy"
|
|
23
|
+
String testDirRelative = "${sep}src${sep}test${sep}groovy"
|
|
24
|
+
|
|
25
|
+
// 1. Create src/main/groovy directory
|
|
26
|
+
new File(pathToExerciseDirectory + srcDirRelative).mkdirs()
|
|
27
|
+
// 2. Create src/test/groovy directory
|
|
28
|
+
new File(pathToExerciseDirectory + testDirRelative).mkdirs()
|
|
29
|
+
// 3. Copy Example solution to src/main/groovy
|
|
30
|
+
Files.copy(
|
|
31
|
+
Paths.get("${pathToExerciseDirectory}${sep}Example.groovy"),
|
|
32
|
+
Paths.get("${pathToExerciseDirectory}${srcDirRelative}${sep}${exerciseName}.groovy")
|
|
33
|
+
)
|
|
34
|
+
// 4. Copy Spec file to src/test/groovy
|
|
35
|
+
Files.copy(
|
|
36
|
+
Paths.get("${pathToExerciseDirectory}${sep}${exerciseName}Spec.groovy"),
|
|
37
|
+
Paths.get("${pathToExerciseDirectory}${testDirRelative}${sep}${exerciseName}Spec.groovy")
|
|
38
|
+
)
|
|
39
|
+
// 5. Remove unwanted statements from Spec
|
|
40
|
+
String pathToSpec = "${pathToExerciseDirectory}${testDirRelative}${sep}${exerciseName}Spec.groovy"
|
|
41
|
+
new File(pathToSpec).text = new File(pathToSpec).text.replaceAll(/@Grab.*/,'').replace('@Ignore', '')
|
|
42
|
+
// 6. Create empty 'build.gradle'
|
|
43
|
+
new File("${pathToExerciseDirectory}${sep}build.gradle").createNewFile()
|
|
44
|
+
// 7. Add exercise build to settings.gradle in main build
|
|
45
|
+
new File("${mainBuildDir}${sep}settings.gradle")
|
|
46
|
+
.append("include 'exercises/${this.toKebabCase(exerciseName)}'\n")
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
String toCamelCase(String str) {
|
|
51
|
+
return str.tokenize('-')*.toLowerCase()*.capitalize().join('')
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
String toKebabCase(String str) {
|
|
55
|
+
result = ''
|
|
56
|
+
str.each {
|
|
57
|
+
if (( it == it.toUpperCase() && str[0] != it )) {
|
|
58
|
+
result += '-'
|
|
59
|
+
}
|
|
60
|
+
result += it.toLowerCase()
|
|
61
|
+
}
|
|
62
|
+
return result
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
// Tests
|
|
67
|
+
void testToCamelCase() {
|
|
68
|
+
assert this.toCamelCase('nth-prime') == 'NthPrime'
|
|
69
|
+
assert this.toCamelCase('difference-of-squares') == 'DifferenceOfSquares'
|
|
70
|
+
assert this.toCamelCase('grains') == 'Grains'
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
void testToKebabCase() {
|
|
74
|
+
assert this.toKebabCase('NthPrime') == 'nth-prime'
|
|
75
|
+
assert this.toKebabCase('DifferenceOfSquares') == 'difference-of-squares'
|
|
76
|
+
assert this.toKebabCase('Grains') == 'grains'
|
|
77
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
def build_dir = 'build'
|
|
2
|
+
|
|
3
|
+
allprojects {
|
|
4
|
+
apply plugin : 'groovy'
|
|
5
|
+
|
|
6
|
+
dependencies {
|
|
7
|
+
compile 'org.codehaus.groovy:groovy:2.4.10'
|
|
8
|
+
|
|
9
|
+
testCompile 'org.spockframework:spock-core:1.0-groovy-2.4', {
|
|
10
|
+
exclude module: 'groovy-all'
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
test {
|
|
15
|
+
testLogging {
|
|
16
|
+
exceptionFormat = 'full'
|
|
17
|
+
events = ["passed", "failed", "skipped"]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
repositories {
|
|
22
|
+
jcenter()
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
@@ -2,8 +2,8 @@ class DifferenceOfSquares {
|
|
|
2
2
|
|
|
3
3
|
def naturalNum
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
this.naturalNum =
|
|
5
|
+
DifferenceOfSquares(Integer number) {
|
|
6
|
+
this.naturalNum = number
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
def squareOfSums() {
|
|
@@ -20,4 +20,4 @@ class DifferenceOfSquares {
|
|
|
20
20
|
squareOfSums() - sumOfSquares()
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
}
|
|
23
|
+
}
|
|
@@ -12,7 +12,7 @@ class GigasecondSpec extends Specification {
|
|
|
12
12
|
when:
|
|
13
13
|
def result = gigasecond.from(start)
|
|
14
14
|
then:
|
|
15
|
-
result == Date.parse('yyyy-MMM-dd hh:mm:ss', '2043-Jan-01
|
|
15
|
+
result == Date.parse('yyyy-MMM-dd hh:mm:ss', '2043-Jan-01 01:46:40')
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
@Ignore
|
|
@@ -22,7 +22,7 @@ class GigasecondSpec extends Specification {
|
|
|
22
22
|
when:
|
|
23
23
|
def result = gigasecond.from(start)
|
|
24
24
|
then:
|
|
25
|
-
result == Date.parse('yyyy-MMM-dd hh:mm:ss', '1991-Mar-27
|
|
25
|
+
result == Date.parse('yyyy-MMM-dd hh:mm:ss', '1991-Mar-27 02:17:40')
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
@Ignore
|
|
@@ -32,7 +32,7 @@ class GigasecondSpec extends Specification {
|
|
|
32
32
|
when:
|
|
33
33
|
def result = gigasecond.from(start)
|
|
34
34
|
then:
|
|
35
|
-
result == Date.parse('yyyy-MMM-dd hh:mm:ss', '2009-Feb-19
|
|
35
|
+
result == Date.parse('yyyy-MMM-dd hh:mm:ss', '2009-Feb-19 04:02:25')
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
}
|
|
File without changes
|
data/tracks/groovy/exercises/linked-list/{DoubleLinkedListSpec.groovy → LinkedListSpec.groovy}
RENAMED
|
File without changes
|
|
Binary file
|
|
@@ -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=""
|
|
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" "$@"
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
@if "%DEBUG%" == "" @echo off
|
|
2
|
+
@rem ##########################################################################
|
|
3
|
+
@rem
|
|
4
|
+
@rem Gradle startup script for Windows
|
|
5
|
+
@rem
|
|
6
|
+
@rem ##########################################################################
|
|
7
|
+
|
|
8
|
+
@rem Set local scope for the variables with windows NT shell
|
|
9
|
+
if "%OS%"=="Windows_NT" setlocal
|
|
10
|
+
|
|
11
|
+
set DIRNAME=%~dp0
|
|
12
|
+
if "%DIRNAME%" == "" set DIRNAME=.
|
|
13
|
+
set APP_BASE_NAME=%~n0
|
|
14
|
+
set APP_HOME=%DIRNAME%
|
|
15
|
+
|
|
16
|
+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
17
|
+
set DEFAULT_JVM_OPTS=
|
|
18
|
+
|
|
19
|
+
@rem Find java.exe
|
|
20
|
+
if defined JAVA_HOME goto findJavaFromJavaHome
|
|
21
|
+
|
|
22
|
+
set JAVA_EXE=java.exe
|
|
23
|
+
%JAVA_EXE% -version >NUL 2>&1
|
|
24
|
+
if "%ERRORLEVEL%" == "0" goto init
|
|
25
|
+
|
|
26
|
+
echo.
|
|
27
|
+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
28
|
+
echo.
|
|
29
|
+
echo Please set the JAVA_HOME variable in your environment to match the
|
|
30
|
+
echo location of your Java installation.
|
|
31
|
+
|
|
32
|
+
goto fail
|
|
33
|
+
|
|
34
|
+
:findJavaFromJavaHome
|
|
35
|
+
set JAVA_HOME=%JAVA_HOME:"=%
|
|
36
|
+
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|
37
|
+
|
|
38
|
+
if exist "%JAVA_EXE%" goto init
|
|
39
|
+
|
|
40
|
+
echo.
|
|
41
|
+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
|
42
|
+
echo.
|
|
43
|
+
echo Please set the JAVA_HOME variable in your environment to match the
|
|
44
|
+
echo location of your Java installation.
|
|
45
|
+
|
|
46
|
+
goto fail
|
|
47
|
+
|
|
48
|
+
:init
|
|
49
|
+
@rem Get command-line arguments, handling Windows variants
|
|
50
|
+
|
|
51
|
+
if not "%OS%" == "Windows_NT" goto win9xME_args
|
|
52
|
+
|
|
53
|
+
:win9xME_args
|
|
54
|
+
@rem Slurp the command line arguments.
|
|
55
|
+
set CMD_LINE_ARGS=
|
|
56
|
+
set _SKIP=2
|
|
57
|
+
|
|
58
|
+
:win9xME_args_slurp
|
|
59
|
+
if "x%~1" == "x" goto execute
|
|
60
|
+
|
|
61
|
+
set CMD_LINE_ARGS=%*
|
|
62
|
+
|
|
63
|
+
:execute
|
|
64
|
+
@rem Setup the command line
|
|
65
|
+
|
|
66
|
+
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|
67
|
+
|
|
68
|
+
@rem Execute Gradle
|
|
69
|
+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
|
70
|
+
|
|
71
|
+
:end
|
|
72
|
+
@rem End local scope for the variables with windows NT shell
|
|
73
|
+
if "%ERRORLEVEL%"=="0" goto mainEnd
|
|
74
|
+
|
|
75
|
+
:fail
|
|
76
|
+
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
|
77
|
+
rem the _cmd.exe /c_ return code!
|
|
78
|
+
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
|
79
|
+
exit /b 1
|
|
80
|
+
|
|
81
|
+
:mainEnd
|
|
82
|
+
if "%OS%"=="Windows_NT" endlocal
|
|
83
|
+
|
|
84
|
+
:omega
|