Skip to content
This repository was archived by the owner on Dec 15, 2023. It is now read-only.

version kotlin 1.6.21 and gradle 6.1.1 #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ group 'kotlin-in-action'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.1.2-2'
ext.kotlin_version = '1.6.21'

repositories {
mavenCentral()
Expand All @@ -19,9 +19,9 @@ repositories {
}

dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
compile "junit:junit:4.12"
compile 'junit:junit:4.13.2'
}

sourceSets {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
2 changes: 1 addition & 1 deletion src/ch01/1.1_ATasteOfKotlin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ fun main(args: Array<String>) {
val persons = listOf(Person("Alice"),
Person("Bob", age = 29))

val oldest = persons.maxBy { it.age ?: 0 }
val oldest = persons.maxByOrNull { it.age ?: 0 }
println("The oldest is: $oldest")
}

Expand Down
2 changes: 1 addition & 1 deletion src/ch03/3.1_2_CreatingCollectionsInKotlin1.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ fun main(args: Array<String>) {
val strings = listOf("first", "second", "fourteenth")
println(strings.last())
val numbers = setOf(1, 14, 2)
println(numbers.max())
println(numbers.maxOrNull())
}
2 changes: 1 addition & 1 deletion src/ch10/10.2.1_1_ReflectionAPI.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ch10.ex2_1_1_ReflectionAPI

import kotlin.reflect.memberProperties
import kotlin.reflect.full.memberProperties

class Person(val name: String, val age: Int)

Expand Down