Skip to content

Commit 2cb339e

Browse files
authored
Update to Kotlin 1.5.31 (#86)
Plus other dependencies
1 parent 21dfd80 commit 2cb339e

File tree

8 files changed

+38
-53
lines changed

8 files changed

+38
-53
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@ jobs:
2323
runs-on: ubuntu-latest
2424

2525
steps:
26-
- uses: actions/checkout@v1
27-
28-
- name: set up JDK 1.8
29-
uses: actions/setup-java@v1
26+
- uses: actions/checkout@v2
27+
- uses: actions/setup-java@v2
3028
with:
31-
java-version: 1.8
29+
distribution: 'zulu'
30+
java-version: '11'
3231

3332
- name: Build with Gradle
3433
run: ./gradlew assemble check --stacktrace

buildSrc/src/main/kotlin/Versions.kt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,36 +16,36 @@
1616

1717
object Versions {
1818

19-
const val kotlin = "1.4.30"
19+
const val kotlin = "1.5.31"
2020

21-
const val androidGradlePlugin = "4.1.2"
21+
const val androidGradlePlugin = "7.0.2"
2222
const val dependencyCheckGradlePlugin = "6.1.1"
23-
const val detektGradlePlugin = "1.16.0-RC1"
24-
const val dokkaPlugin = "1.4.20"
25-
const val gradleMavenPublishPlugin = "0.14.2"
23+
const val detektGradlePlugin = "1.18.1"
24+
const val dokkaPlugin = "1.5.30"
25+
const val gradleMavenPublishPlugin = "0.18.0"
2626
const val gradleVersionsPlugin = "0.36.0"
2727
const val markdownlintGradlePlugin = "0.6.0"
2828

29-
const val classgraph = "4.8.102"
30-
const val coroutines = "1.4.2"
29+
const val classgraph = "4.8.117"
30+
const val coroutines = "1.5.2"
3131
const val generex = "1.0.2"
3232
const val javafaker = "1.0.2"
33-
const val jodaTime = "2.10.10"
33+
const val jodaTime = "2.10.12"
3434
const val multiplatformSettings = "0.7.2"
35-
const val threeTen = "1.5.0"
35+
const val threeTen = "1.5.1"
3636

3737
const val junit4 = "4.13.2"
38-
const val kotest = "4.4.1"
38+
const val kotest = "4.6.3"
3939
const val mockitoKotlin = "2.2.0"
40-
const val robolectric = "4.5.1"
40+
const val robolectric = "4.6.1"
4141

42-
const val easyrandom = "4.3.0"
42+
const val easyrandom = "5.0.0"
4343
const val flextrade = "0.2.0"
4444
const val marcellogalhardo = "0.0.2"
4545

4646
object AndroidX {
47-
const val testCore = "1.3.0"
48-
const val testExtJunit = "1.1.2"
49-
const val testRunner = "1.3.0"
47+
const val testCore = "1.4.0"
48+
const val testExtJunit = "1.1.3"
49+
const val testRunner = "1.4.0"
5050
}
5151
}

fixture-android-tests/build.gradle.kts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,11 @@ plugins {
2424
apply(from = "$rootDir/gradle/scripts/jacoco-android.gradle.kts")
2525

2626
android {
27-
compileSdkVersion(30)
27+
compileSdk = 30
2828

2929
defaultConfig {
30-
minSdkVersion(19)
31-
targetSdkVersion(30)
32-
versionCode = 1
33-
versionName = "1.0"
30+
minSdk = 19
31+
targetSdk = 30
3432
}
3533

3634
testOptions {

fixture-kotest/src/main/kotlin/com/appmattus/kotlinfixture/kotest/ForAllExt.kt

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 Appmattus Limited
2+
* Copyright 2021 Appmattus Limited
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,54 +19,43 @@
1919
package com.appmattus.kotlinfixture.kotest
2020

2121
import com.appmattus.kotlinfixture.Fixture
22-
import io.kotest.matchers.shouldBe
2322
import io.kotest.property.PropTestConfig
2423
import io.kotest.property.PropertyContext
25-
import io.kotest.property.PropertyTesting
2624
import io.kotest.property.forAll
27-
import io.kotest.property.internal.proptest
2825

2926
// 1 parameter
3027

3128
/**
3229
* Use [Fixture] to generate random objects for type parameters and validate the [function] returns true `forAll`.
3330
*/
3431
suspend inline fun <reified A> Fixture.forAll(
35-
crossinline function: suspend PropertyContext.(a: A) -> Boolean
36-
) = proptest(PropertyTesting.defaultIterationCount, kotestGen<A>(), PropTestConfig()) { a ->
37-
function(a) shouldBe true
38-
}
32+
noinline function: suspend PropertyContext.(a: A) -> Boolean
33+
) = forAll(kotestGen(), function)
3934

4035
/**
4136
* Use [Fixture] to generate random objects for type parameters and validate the [function] returns true `forAll`.
4237
*/
4338
suspend inline fun <reified A> Fixture.forAll(
4439
iterations: Int,
45-
crossinline function: suspend PropertyContext.(a: A) -> Boolean
46-
) = proptest(iterations, kotestGen<A>(), PropTestConfig()) { a ->
47-
function(a) shouldBe true
48-
}
40+
noinline function: suspend PropertyContext.(a: A) -> Boolean
41+
) = forAll(iterations, kotestGen(), function)
4942

5043
/**
5144
* Use [Fixture] to generate random objects for type parameters and validate the [function] returns true `forAll`.
5245
*/
5346
suspend inline fun <reified A> Fixture.forAll(
5447
config: PropTestConfig,
55-
crossinline function: suspend PropertyContext.(a: A) -> Boolean
56-
) = proptest(PropertyTesting.defaultIterationCount, kotestGen<A>(), config) { a ->
57-
function(a) shouldBe true
58-
}
48+
noinline function: suspend PropertyContext.(a: A) -> Boolean
49+
) = forAll(config, kotestGen(), function)
5950

6051
/**
6152
* Use [Fixture] to generate random objects for type parameters and validate the [function] returns true `forAll`.
6253
*/
6354
suspend inline fun <reified A> Fixture.forAll(
6455
iterations: Int,
6556
config: PropTestConfig,
66-
crossinline function: suspend PropertyContext.(a: A) -> Boolean
67-
) = proptest(iterations, kotestGen<A>(), config) { a ->
68-
function(a) shouldBe true
69-
}
57+
noinline function: suspend PropertyContext.(a: A) -> Boolean
58+
) = forAll(iterations, config, kotestGen(), function)
7059

7160
// 2 parameters
7261

fixture/src/main/kotlin/com/appmattus/kotlinfixture/resolver/CharResolver.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import com.appmattus.kotlinfixture.Unresolved
2121

2222
internal class CharResolver : Resolver {
2323

24-
override fun resolve(context: Context, obj: Any): Any? =
25-
if (obj == Char::class) (context.random.nextInt(LETTERS) + 'a'.toInt()).toChar() else Unresolved.Unhandled
24+
override fun resolve(context: Context, obj: Any): Any =
25+
if (obj == Char::class) (context.random.nextInt(LETTERS) + 'a'.code).toChar() else Unresolved.Unhandled
2626

2727
companion object {
2828
private const val LETTERS = 26

fixture/src/main/kotlin/com/appmattus/kotlinfixture/resolver/DateResolver.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import java.util.concurrent.TimeUnit
2525

2626
internal class DateResolver : Resolver {
2727

28-
override fun resolve(context: Context, obj: Any): Any? {
28+
override fun resolve(context: Context, obj: Any): Any {
2929
return when (obj) {
3030
Date::class -> context.generateJavaUtilDate()
3131
java.sql.Date::class -> java.sql.Date(context.generateJavaUtilDate().time)
@@ -39,8 +39,8 @@ internal class DateResolver : Resolver {
3939
return Date(
4040
@Suppress("MagicNumber")
4141
random.nextLong(
42-
referenceTime - TimeUnit.DAYS.toMillis(365 * 10),
43-
referenceTime + TimeUnit.DAYS.toMillis(365 * 10)
42+
referenceTime - TimeUnit.DAYS.toMillis(3650),
43+
referenceTime + TimeUnit.DAYS.toMillis(3650)
4444
)
4545
)
4646
}

fixture/src/main/kotlin/com/appmattus/kotlinfixture/resolver/PopulateInstance.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ internal interface PopulateInstance {
5555
callContext.obj.memberFunctions.filter {
5656
it.name.startsWith("set") && it.valueParameters.size == 1
5757
}.filterNot {
58-
@Suppress("EXPERIMENTAL_API_USAGE_ERROR")
59-
val name = it.name.removePrefix("set").decapitalize(Locale.getDefault())
58+
val name = it.name.removePrefix("set").replaceFirstChar { it.lowercase(Locale.getDefault()) }
6059
callContext.constructorParameterNames.contains(name)
6160
}.forEach {
6261
val propertyResult = callContext.context.resolve(
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)