diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 89b3d01851..50ed2eb378 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -73,13 +73,14 @@ The following are a few guidelines on how we suggest you start. 1. Fork the repository to your repositories (see [Fork a repo](https://help.github.com/en/articles/fork-a-repo) for help). 2. Use an IDE which supports Kotlin and gradle projects. - We suggest [IntelliJ Community Edition](https://www.jetbrains.com/idea/download/) - and install the following plugins: + We suggest [IntelliJ Community Edition](https://www.jetbrains.com/idea/download/). + Because of [IDEA-228368](https://youtrack.jetbrains.com/issue/IDEA-228368) you will need at least IntelliJ 2020.1, or the Gradle import will fail. + Install the following plugins: - EditorConfig by JetBrains (might be already activated) - Spek Framework by Spek Team 3. Import the project (import the build.gradle -> import as project, works more reliably) -4. Open up a terminal (e.g. Intellij's built in -> usually ALT+F12) and run `./gr build` - This builds the project (compile, run tests etc) via gradle (notice, we renamed `gradlew` to `gr`, more convenient no?) +4. Open up a terminal (e.g. Intellij's built in -> usually ALT+F12) and run `./gradlew build` + This builds the project (compile, run tests etc) via gradle 5. Read up the [Coding Conventions of Atrium](#coding-conventions) (there are only 5 points). Note: IntelliJ requires a few workarounds. diff --git a/.github/workflows/java-windows.yml b/.github/workflows/java-windows.yml index 71372da19e..eeb4911ade 100644 --- a/.github/workflows/java-windows.yml +++ b/.github/workflows/java-windows.yml @@ -17,7 +17,7 @@ jobs: with: java-version: ${{ matrix.java_version }} - name: Build buildNonDeprecatedJvm - run: ./gr buildNonDeprecatedJvm + run: ./gradlew buildNonDeprecatedJvm env: CI: true diff --git a/.travis.yml b/.travis.yml index 5ce60df49b..de7c23f235 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,30 +4,28 @@ language: java jdk: - openjdk11 -before_install: chmod +x gr - install: skip jobs: include: - env: MODE=current_11 - script: ./gr buildAllWithoutJs + script: ./gradlew buildAllWithoutJs after_success: bash <(curl -s https://codecov.io/bash) -F current - env: MODE=current_8 jdk: oraclejdk8 - script: ./gr buildNonDeprecatedJvm buildAllAndroid + script: ./gradlew buildNonDeprecatedJvm buildAllAndroid after_success: bash <(curl -s https://codecov.io/bash) -F current - env: MODE=js - script: ./gr buildAllJs + script: ./gradlew buildAllJs - env: MODE=bbc - script: ./gr bbcTests + script: ./gradlew bbcTests after_success: bash <(curl -s https://codecov.io/bash) -F bbc - env: MODE=bc - script: ./gr bcTests + script: ./gradlew bcTests after_success: bash <(curl -s https://codecov.io/bash) -F bc - env: MODE=samples diff --git a/build.gradle b/build.gradle index 70e780fb95..54e022089e 100644 --- a/build.gradle +++ b/build.gradle @@ -32,7 +32,7 @@ buildscript { // project setup tutteli_plugins_version = '0.32.2' - node_plugin_version = '1.3.1' + node_plugin_version = '2.2.0' // gh-pages.gradle docProjects = (subprojects - sampleProjectsFun - toolProjectsFun).findAll { @@ -124,7 +124,7 @@ buildscript { classpath "ch.tutteli:tutteli-gradle-project-utils:$tutteli_plugins_version" classpath "ch.tutteli:tutteli-gradle-publish:$tutteli_plugins_version" classpath "ch.tutteli:tutteli-gradle-spek:$tutteli_plugins_version" - classpath "com.moowork.gradle:gradle-node-plugin:$node_plugin_version" + classpath "com.github.node-gradle:gradle-node-plugin:$node_plugin_version" } } @@ -438,7 +438,7 @@ List projectNamesToProject(String[] names) { def createJsTestTask(String... subprojectNames) { configure(projectNamesToProject(subprojectNames)) { - apply plugin: 'com.moowork.node' + apply plugin: 'com.github.node-gradle.node' compileTestKotlin2Js.configure { kotlinOptions.moduleKind = "commonjs" @@ -467,13 +467,8 @@ def createJsTestTask(String... subprojectNames) { nodeModulesDir = nodeModulesParentDir } - task installMocha(type: NpmTask) { - args = ['install', 'mocha', '--prefer-offline'] - } - - task prepareMocha(dependsOn: [compileTestKotlin2Js, populateNodeModules, installMocha]) - task runMocha(type: NodeTask, dependsOn: [prepareMocha]) { - script = file("$nodeModulesParentDir/node_modules/mocha/bin/mocha") + task runMocha(type: NpxTask, dependsOn: [compileTestKotlin2Js, populateNodeModules]) { + command = "mocha" args = [compileTestKotlin2Js.outputFile] } test.dependsOn runMocha @@ -493,7 +488,7 @@ createJsTestTask( def useJupiter(String... projectNames) { configure(projectNamesToProject(projectNames)) { dependencies { - testRuntime "org.junit.jupiter:junit-jupiter-engine:$jupiter_version" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$jupiter_version" } test { options { @@ -562,7 +557,7 @@ assumes you have a atrium-gh-pages folder on the same level as atrium where the 3. deploy to bintray: // CI=true is a temporary work around till https://youtrack.jetbrains.com/issue/KT-29069 is fixed: - a) java -version 2>&1 | grep "version \"11" && CI=true ./gr clean publishToBintray + a) java -version 2>&1 | grep "version \"9" && CI=true ./gr clean publishToBintray b) Log in to bintray, check that there are 926 artifacts and publish them c) synchronise to maven central diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-android/build.gradle b/core/robstoll-lib/atrium-core-robstoll-lib-android/build.gradle index 4456c69e1f..591ca1d9f3 100644 --- a/core/robstoll-lib/atrium-core-robstoll-lib-android/build.gradle +++ b/core/robstoll-lib/atrium-core-robstoll-lib-android/build.gradle @@ -4,7 +4,7 @@ description = 'Contains the bits and pieces behind robstoll\'s diff --git a/misc/verbs/atrium-verbs-android/build.gradle b/misc/verbs/atrium-verbs-android/build.gradle index 03aa6cf291..0879534d93 100644 --- a/misc/verbs/atrium-verbs-android/build.gradle +++ b/misc/verbs/atrium-verbs-android/build.gradle @@ -5,8 +5,8 @@ dependencies { api prefixedProject('core-api-android') testImplementation prefixedProject('specs-android') - testRuntime prefixedProject('domain-robstoll-android') - testRuntime prefixedProject('core-robstoll-android') + testRuntimeOnly prefixedProject('domain-robstoll-android') + testRuntimeOnly prefixedProject('core-robstoll-android') //TODO remove with 1.0.0 testImplementation prefixedProject('spec') diff --git a/misc/verbs/atrium-verbs-jvm/build.gradle b/misc/verbs/atrium-verbs-jvm/build.gradle index 150caaf433..f106f1ce52 100644 --- a/misc/verbs/atrium-verbs-jvm/build.gradle +++ b/misc/verbs/atrium-verbs-jvm/build.gradle @@ -5,8 +5,8 @@ dependencies { api prefixedProject('core-api-jvm') testImplementation prefixedProject('specs-jvm') - testRuntime prefixedProject('domain-robstoll-jvm') - testRuntime prefixedProject('core-robstoll-jvm') + testRuntimeOnly prefixedProject('domain-robstoll-jvm') + testRuntimeOnly prefixedProject('core-robstoll-jvm') //TODO remove with 1.0.0 testImplementation prefixedProject('spec') diff --git a/samples/js/jasmine/build.gradle b/samples/js/jasmine/build.gradle index 8f71a05618..39ad2dfb26 100644 --- a/samples/js/jasmine/build.gradle +++ b/samples/js/jasmine/build.gradle @@ -8,13 +8,13 @@ buildscript { maven { url "https://plugins.gradle.org/m2/" } } dependencies { - classpath 'com.moowork.gradle:gradle-node-plugin:1.2.0' - classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71' + classpath 'com.github.node-gradle:gradle-node-plugin:2.2.0' + classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.71' } } apply plugin: 'kotlin2js' -apply plugin: 'com.moowork.node' +apply plugin: 'com.github.node-gradle.node' repositories { jcenter() @@ -69,14 +69,6 @@ node { nodeModulesDir = nodeModulesParentDir } -task installJasmine(type: NpmTask) { - // note, without the '--prefer-offline' it works only if you are online, - // with '--prefer-offline' it works also offline if you have already as well in case you have already downloaded jasmine once - args = ['install', 'jasmine', '--prefer-offline'] -} - -task prepareJasmine(dependsOn: [compileTestKotlin2Js, populateNodeModules, installJasmine]) - //either you use this task or create a testSetup.kt in your src/test with the following content // // // adopt to the api you use @@ -93,8 +85,8 @@ task establishDependencyToAtrium(dependsOn: [compileTestKotlin2Js]) { srcFile.write(newContent, 'UTF-8') } } -task runJasmine(type: NodeTask, group: 'Verification', dependsOn: [prepareJasmine, test, establishDependencyToAtrium]) { - script = file("$nodeModulesParentDir/node_modules/jasmine/bin/jasmine") +task runJasmine(type: NpxTask, group: 'Verification', dependsOn: [populateNodeModules, test, establishDependencyToAtrium]) { + command = "jasmine" args = [compileTestKotlin2Js.outputFile] } check.dependsOn runJasmine @@ -153,8 +145,8 @@ task establishDependencyFromCurrentToAtrium(dependsOn: [compileTestKotlin2Js]) { srcFile.write(newContent, 'UTF-8') } } -task runJasmineForCurrent(type: NodeTask, group: 'Verification', dependsOn: [compileCurrentKotlin2Js, populateCurrentNodeModules, installJasmine, establishDependencyFromCurrentToAtrium]) { - script = file("$nodeModulesParentDir/node_modules/jasmine/bin/jasmine") +task runJasmineForCurrent(type: NpxTask, group: 'Verification', dependsOn: [compileCurrentKotlin2Js, populateCurrentNodeModules, establishDependencyFromCurrentToAtrium]) { + command = "jasmine" args = [compileCurrentKotlin2Js.outputFile] } diff --git a/samples/js/mocha/build.gradle b/samples/js/mocha/build.gradle index 9e5221e058..ae537b4f86 100644 --- a/samples/js/mocha/build.gradle +++ b/samples/js/mocha/build.gradle @@ -8,13 +8,13 @@ buildscript { maven { url "https://plugins.gradle.org/m2/" } } dependencies { - classpath 'com.moowork.gradle:gradle-node-plugin:1.2.0' - classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71' + classpath 'com.github.node-gradle:gradle-node-plugin:2.2.0' + classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.71' } } apply plugin: 'kotlin2js' -apply plugin: 'com.moowork.node' +apply plugin: 'com.github.node-gradle.node' repositories { jcenter() @@ -69,14 +69,6 @@ node { nodeModulesDir = nodeModulesParentDir } -task installMocha(type: NpmTask) { - // note, without the '--prefer-offline' it works only if you are online, - // with '--prefer-offline' it works also offline if you have already as well in case you have already downloaded mocha once - args = ['install', 'mocha', '--prefer-offline'] -} - -task prepareMocha(dependsOn: [compileTestKotlin2Js, populateNodeModules, installMocha]) - //either you use this task or create a testSetup.kt in your src/test with the following content // // // adopt to the api you use @@ -93,8 +85,8 @@ task establishDependencyToAtrium(dependsOn: [compileTestKotlin2Js]) { srcFile.write(newContent, 'UTF-8') } } -task runMocha(type: NodeTask, group: 'Verification', dependsOn: [prepareMocha, test, establishDependencyToAtrium]) { - script = file("$nodeModulesParentDir/node_modules/mocha/bin/mocha") +task runMocha(type: NpxTask, group: 'Verification', dependsOn: [compileTestKotlin2Js, populateNodeModules, establishDependencyToAtrium]) { + command = "mocha" args = [compileTestKotlin2Js.outputFile] } check.dependsOn runMocha @@ -153,8 +145,8 @@ task establishDependencyFromCurrentToAtrium(dependsOn: [compileTestKotlin2Js]) { srcFile.write(newContent, 'UTF-8') } } -task runMochaForCurrent(type: NodeTask, group: 'Verification', dependsOn: [compileCurrentKotlin2Js, populateCurrentNodeModules, installMocha, establishDependencyFromCurrentToAtrium]) { - script = file("$nodeModulesParentDir/node_modules/mocha/bin/mocha") +task runMochaForCurrent(type: NpxTask, group: 'Verification', dependsOn: [compileCurrentKotlin2Js, populateCurrentNodeModules, establishDependencyFromCurrentToAtrium]) { + command = "mocha" args = [compileCurrentKotlin2Js.outputFile] } diff --git a/samples/jvm/junit5/build.gradle b/samples/jvm/junit5/build.gradle index 089d07c833..51af050541 100644 --- a/samples/jvm/junit5/build.gradle +++ b/samples/jvm/junit5/build.gradle @@ -1,6 +1,6 @@ buildscript { ext { - kotlin_version= '1.3.41' + kotlin_version= '1.3.71' atrium_api= 'atrium-fluent-en_GB' atrium_version='0.10.0' junit_version= '5.3.1' diff --git a/samples/jvm/junit5/gradle/wrapper/gradle-wrapper.jar b/samples/jvm/junit5/gradle/wrapper/gradle-wrapper.jar index cc4fdc293d..f3d88b1c2f 100644 Binary files a/samples/jvm/junit5/gradle/wrapper/gradle-wrapper.jar and b/samples/jvm/junit5/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/jvm/junit5/gradle/wrapper/gradle-wrapper.properties b/samples/jvm/junit5/gradle/wrapper/gradle-wrapper.properties index 94920145f3..6623300beb 100644 --- a/samples/jvm/junit5/gradle/wrapper/gradle-wrapper.properties +++ b/samples/jvm/junit5/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/jvm/spek/build.gradle b/samples/jvm/spek/build.gradle index 5efb4a0086..507ee92b25 100644 --- a/samples/jvm/spek/build.gradle +++ b/samples/jvm/spek/build.gradle @@ -1,6 +1,6 @@ buildscript { ext { - kotlin_version = '1.3.41' + kotlin_version = '1.3.71' spek_version = '2.0.0' atrium_version='0.10.0' } @@ -15,7 +15,7 @@ buildscript { } plugins { - id 'org.jetbrains.kotlin.jvm' version '1.3.41' + id 'org.jetbrains.kotlin.jvm' version "$kotlin_version" } group 'com.atrium.spek' diff --git a/samples/jvm/spek/gradle/wrapper/gradle-wrapper.jar b/samples/jvm/spek/gradle/wrapper/gradle-wrapper.jar index 87b738cbd0..f3d88b1c2f 100644 Binary files a/samples/jvm/spek/gradle/wrapper/gradle-wrapper.jar and b/samples/jvm/spek/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/jvm/spek/gradle/wrapper/gradle-wrapper.properties b/samples/jvm/spek/gradle/wrapper/gradle-wrapper.properties index a648397632..6623300beb 100644 --- a/samples/jvm/spek/gradle/wrapper/gradle-wrapper.properties +++ b/samples/jvm/spek/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Mon Oct 21 02:29:44 IST 2019 -distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/jvm/spek/gradlew b/samples/jvm/spek/gradlew index af6708ff22..380eb94204 100755 --- a/samples/jvm/spek/gradlew +++ b/samples/jvm/spek/gradlew @@ -1,5 +1,21 @@ #!/usr/bin/env sh +# +# Copyright 2015 the original author or authors. +# +# Licensed 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 +# +# https://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. +# + ############################################################################## ## ## Gradle start up script for UN*X @@ -10,34 +26,34 @@ # Resolve links: $0 may be a link PRG="$0" # Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then +while [ -h "$PRG" ]; do + ls=$(ls -ld "$PRG") + link=$(expr "$ls" : '.*-> \(.*\)$') + if expr "$link" : '/.*' >/dev/null; then PRG="$link" else - PRG=`dirname "$PRG"`"/$link" + PRG=$(dirname "$PRG")"/$link" fi done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" +SAVED="$(pwd)" +cd "$(dirname \"$PRG\")/" >/dev/null +APP_HOME="$(pwd -P)" cd "$SAVED" >/dev/null APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +APP_BASE_NAME=$(basename "$0") # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m"' +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" -warn () { +warn() { echo "$*" } -die () { +die() { echo echo "$*" echo @@ -49,17 +65,17 @@ cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) +case "$(uname)" in +CYGWIN*) cygwin=true ;; - Darwin* ) +Darwin*) darwin=true ;; - MINGW* ) +MINGW*) msys=true ;; - NONSTOP* ) +NONSTOP*) nonstop=true ;; esac @@ -67,14 +83,14 @@ esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +if [ -n "$JAVA_HOME" ]; then + if [ -x "$JAVA_HOME/jre/sh/java" ]; then # IBM's JDK on AIX uses strange locations for the executables JAVACMD="$JAVA_HOME/jre/sh/java" else JAVACMD="$JAVA_HOME/bin/java" fi - if [ ! -x "$JAVACMD" ] ; then + if [ ! -x "$JAVACMD" ]; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME Please set the JAVA_HOME variable in your environment to match the @@ -89,14 +105,14 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ]; then + MAX_FD_LIMIT=$(ulimit -H -n) + if [ $? -eq 0 ]; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then MAX_FD="$MAX_FD_LIMIT" fi ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then + if [ $? -ne 0 ]; then warn "Could not set maximum file descriptor limit: $MAX_FD" fi else @@ -109,54 +125,54 @@ 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"` - JAVACMD=`cygpath --unix "$JAVACMD"` +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ]; then + APP_HOME=$(cygpath --path --mixed "$APP_HOME") + CLASSPATH=$(cygpath --path --mixed "$CLASSPATH") + JAVACMD=$(cygpath --unix "$JAVACMD") # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + ROOTDIRSRAW=$(find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null) SEP="" - for dir in $ROOTDIRSRAW ; do + 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 + 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 + 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"` + 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\"" + eval $(echo args$i)="\"$arg\"" fi - i=$((i+1)) + i=$(expr $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" ;; + 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 # Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done +save() { + for i; do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/"; done echo " " } APP_ARGS=$(save "$@") @@ -164,9 +180,4 @@ APP_ARGS=$(save "$@") # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - exec "$JAVACMD" "$@" diff --git a/samples/jvm/spek/gradlew.bat b/samples/jvm/spek/gradlew.bat index 0f8d5937c4..24467a141f 100644 --- a/samples/jvm/spek/gradlew.bat +++ b/samples/jvm/spek/gradlew.bat @@ -1,3 +1,19 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome diff --git a/samples/multiplatform/build.gradle b/samples/multiplatform/build.gradle index ba0777a94a..5d6e0a49ec 100644 --- a/samples/multiplatform/build.gradle +++ b/samples/multiplatform/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'org.jetbrains.kotlin.multiplatform' version '1.3.61' + id 'org.jetbrains.kotlin.multiplatform' version '1.3.71' } repositories { mavenCentral() diff --git a/samples/multiplatform/gradle/wrapper/gradle-wrapper.jar b/samples/multiplatform/gradle/wrapper/gradle-wrapper.jar index cc4fdc293d..490fda8577 100644 Binary files a/samples/multiplatform/gradle/wrapper/gradle-wrapper.jar and b/samples/multiplatform/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/multiplatform/gradle/wrapper/gradle-wrapper.properties b/samples/multiplatform/gradle/wrapper/gradle-wrapper.properties index 94920145f3..a4b4429748 100644 --- a/samples/multiplatform/gradle/wrapper/gradle-wrapper.properties +++ b/samples/multiplatform/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/samples/multiplatform/gradlew.bat b/samples/multiplatform/gradlew.bat index 9618d8d960..62bd9b9cce 100644 --- a/samples/multiplatform/gradlew.bat +++ b/samples/multiplatform/gradlew.bat @@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" diff --git a/samples/readme-examples/src/main/kotlin/readme/examples/ReadmeSpec.kt b/samples/readme-examples/src/main/kotlin/readme/examples/ReadmeSpec.kt index 2a8da0de07..6e927dce6e 100644 --- a/samples/readme-examples/src/main/kotlin/readme/examples/ReadmeSpec.kt +++ b/samples/readme-examples/src/main/kotlin/readme/examples/ReadmeSpec.kt @@ -32,7 +32,7 @@ import java.util.* * The tests and error message are written here and automatically placed into the README via generation. * The generation is done during the project built. To trigger it manually, you have to use: * ``` - * ./gr :readme-examples:build + * ./gradlew :readme-examples:build * ``` * * There are currently three kind of tags supported: