diff --git a/Kotlin/build.gradle b/Kotlin/build.gradle deleted file mode 100644 index e5dc89df..00000000 --- a/Kotlin/build.gradle +++ /dev/null @@ -1,35 +0,0 @@ -buildscript { - ext.kotlin_version = '1.3.41' - - repositories { - mavenCentral() - } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -plugins { - id "org.jetbrains.kotlin.jvm" version "1.3.41" -} - -apply plugin: 'kotlin' - -dependencies { - compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - testCompile 'junit:junit:4.12' -} -repositories { - mavenCentral() -} -compileKotlin { - kotlinOptions { - jvmTarget = "1.8" - } -} -compileTestKotlin { - kotlinOptions { - jvmTarget = "1.8" - } -} diff --git a/Kotlin/build.gradle.kts b/Kotlin/build.gradle.kts new file mode 100644 index 00000000..dcb2ffc8 --- /dev/null +++ b/Kotlin/build.gradle.kts @@ -0,0 +1,29 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + kotlin("jvm") version "1.4.0" +} + +group = "com.gildedrose" +version = "1.0-SNAPSHOT" + +repositories { + mavenCentral() +} + +dependencies { + implementation(kotlin("stdlib")) + testImplementation("org.junit.jupiter:junit-jupiter:5.6.2") +} + +tasks.test { + useJUnitPlatform() + testLogging { + events("passed", "skipped", "failed") + } +} + +// config JVM target to 1.8 for kotlin compilation tasks +tasks.withType().configureEach { + kotlinOptions.jvmTarget = "1.8" +} diff --git a/Kotlin/gradle/wrapper/gradle-wrapper.jar b/Kotlin/gradle/wrapper/gradle-wrapper.jar index 758de960..5c2d1cf0 100644 Binary files a/Kotlin/gradle/wrapper/gradle-wrapper.jar and b/Kotlin/gradle/wrapper/gradle-wrapper.jar differ diff --git a/Kotlin/gradle/wrapper/gradle-wrapper.properties b/Kotlin/gradle/wrapper/gradle-wrapper.properties index a0d751ae..6c9a2247 100644 --- a/Kotlin/gradle/wrapper/gradle-wrapper.properties +++ b/Kotlin/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Wed Nov 20 10:18:48 CET 2019 -distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-bin.zip zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/Kotlin/gradlew b/Kotlin/gradlew index cccdd3d5..83f2acfd 100755 --- a/Kotlin/gradlew +++ b/Kotlin/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 @@ -28,7 +44,7 @@ APP_NAME="Gradle" 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="" +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" @@ -109,8 +125,8 @@ 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 +# 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"` diff --git a/Kotlin/gradlew.bat b/Kotlin/gradlew.bat index e95643d6..24467a14 100644 --- a/Kotlin/gradlew.bat +++ b/Kotlin/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= +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome diff --git a/Kotlin/src/test/kotlin/com/gildedrose/GildedRoseTest.kt b/Kotlin/src/test/kotlin/com/gildedrose/GildedRoseTest.kt index 5515dcdc..797ac815 100644 --- a/Kotlin/src/test/kotlin/com/gildedrose/GildedRoseTest.kt +++ b/Kotlin/src/test/kotlin/com/gildedrose/GildedRoseTest.kt @@ -1,11 +1,12 @@ package com.gildedrose -import org.junit.Assert.* -import org.junit.Test +import org.junit.jupiter.api.Assertions.assertEquals +import org.junit.jupiter.api.Test -class GildedRoseTest { +internal class GildedRoseTest { - @Test fun foo() { + @Test + fun foo() { val items = arrayOf(Item("foo", 0, 0)) val app = GildedRose(items) app.updateQuality() @@ -13,7 +14,6 @@ class GildedRoseTest { } - }