Skip to content

Commit 921567b

Browse files
committed
Upgrade kotlin, gradle etc..
1 parent dac8d1c commit 921567b

File tree

10 files changed

+51
-42
lines changed

10 files changed

+51
-42
lines changed

.java-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
21

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
This list is not intended to be all-encompassing - it will document major and breaking API changes with their rationale
44
when appropriate:
55

6+
### v2.19.0.0
7+
- **all** : Upgrade of dependencies including Kotlin to v2 and gradle.
8+
- **result4k** : Add fold and bidimap functions
9+
10+
- **data4k** [Fix] Problem with deserialisation of numeric value types (due to int/long coercion by Jackson
11+
612
### v2.18.0.1
713
- **data4k** [Fix] Problem with deserialisation of numeric value types (due to int/long coercion by Jackson
814

build.gradle.kts

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import groovy.namespace.QName
22
import groovy.util.Node
33
import org.gradle.api.JavaVersion.VERSION_1_8
4-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
4+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8
5+
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
56
import java.net.URI
67

78
plugins {
@@ -49,9 +50,9 @@ allprojects {
4950
}
5051

5152
tasks {
52-
withType<KotlinCompile> {
53-
kotlinOptions {
54-
jvmTarget = "1.8"
53+
withType<KotlinJvmCompile>().configureEach {
54+
compilerOptions {
55+
jvmTarget.set(JVM_1_8)
5556
}
5657
}
5758

@@ -228,13 +229,6 @@ fun Node.childrenCalled(wanted: String) = children()
228229
(name is QName) && name.localPart == wanted
229230
}
230231

231-
tasks.named<KotlinCompile>("compileTestKotlin") {
232-
kotlinOptions {
233-
jvmTarget = "1.8"
234-
freeCompilerArgs += listOf("-Xjvm-default=all")
235-
}
236-
}
237-
238232
fun hasCodeCoverage(project: Project) = project.name != "forkhandles-bom" &&
239233
!project.name.endsWith("generator")
240234

fabrikate4k/src/main/kotlin/dev/forkhandles/fabrikate/InstanceFabricator.kt

+9-4
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,19 @@ class InstanceFabricator(private val fabrikate: Fabrikate) {
6262
type: KType,
6363
): List<Pair<KFunction<Any>, (KParameter) -> Any?>> {
6464
val allConstructors = classRef.constructors
65-
val hiddenConstructors = allConstructors.filter { constructor -> constructor.annotations.isNotEmpty() &&
66-
(constructor.annotations.filterIsInstance<Deprecated>().first().level == DeprecationLevel.HIDDEN) }
67-
val nonHidden = allConstructors.filterNot { hiddenConstructors.contains(it) }
68-
val selectedConstructors = if (nonHidden.isNotEmpty()) {nonHidden} else{hiddenConstructors}
65+
val hiddenConstructors = allConstructors.filter { constructor ->
66+
constructor.annotations.isNotEmpty() &&
67+
(constructor.annotations.filterIsInstance<Deprecated>().first().level == DeprecationLevel.HIDDEN)
68+
}
69+
val nonHidden = allConstructors.filterNot(hiddenConstructors::contains).filterNot(::isNotKotlinXSerialisation)
70+
71+
val selectedConstructors = nonHidden.ifEmpty { hiddenConstructors }
6972
return selectedConstructors.shuffled(config.random)
7073
.map { it to { param: KParameter -> makeRandomInstanceForParam(param.type, classRef, type) } }
7174
}
7275

76+
private fun isNotKotlinXSerialisation(it: KFunction<Any>) = it.toString().contains("SerializationConstructorMarker")
77+
7378
private fun makeRandomInstanceForParam(
7479
paramType: KType,
7580
classRef: KClass<*>,

gradle/wrapper/gradle-wrapper.jar

-19.8 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

+7-7
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
145145
case $MAX_FD in #(
146146
max*)
147147
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
148-
# shellcheck disable=SC3045
148+
# shellcheck disable=SC2039,SC3045
149149
MAX_FD=$( ulimit -H -n ) ||
150150
warn "Could not query maximum file descriptor limit"
151151
esac
152152
case $MAX_FD in #(
153153
'' | soft) :;; #(
154154
*)
155155
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
156-
# shellcheck disable=SC3045
156+
# shellcheck disable=SC2039,SC3045
157157
ulimit -n "$MAX_FD" ||
158158
warn "Could not set maximum file descriptor limit to $MAX_FD"
159159
esac
@@ -202,11 +202,11 @@ fi
202202
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
203203
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204204

205-
# Collect all arguments for the java command;
206-
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
207-
# shell script including quotes and variable substitutions, so put them in
208-
# double quotes to make sure that they get re-expanded; and
209-
# * put everything else in single quotes, so that it's not re-expanded.
205+
# Collect all arguments for the java command:
206+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
207+
# and any embedded shellness will be escaped.
208+
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
209+
# treated as '${Hostname}' itself on the command line.
210210

211211
set -- \
212212
"-Dorg.gradle.appname=$APP_BASE_NAME" \

gradlew.bat

+10-10
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
4343
%JAVA_EXE% -version >NUL 2>&1
4444
if %ERRORLEVEL% equ 0 goto execute
4545

46-
echo.
47-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48-
echo.
49-
echo Please set the JAVA_HOME variable in your environment to match the
50-
echo location of your Java installation.
46+
echo. 1>&2
47+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
48+
echo. 1>&2
49+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
50+
echo location of your Java installation. 1>&2
5151

5252
goto fail
5353

@@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5757

5858
if exist "%JAVA_EXE%" goto execute
5959

60-
echo.
61-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62-
echo.
63-
echo Please set the JAVA_HOME variable in your environment to match the
64-
echo location of your Java installation.
60+
echo. 1>&2
61+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
62+
echo. 1>&2
63+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
64+
echo location of your Java installation. 1>&2
6565

6666
goto fail
6767

values4k/build.gradle.kts

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
1+
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
22

33
description = "ForkHandles Value-types library"
44

55
dependencies {
66
implementation(project(":result4k"))
77
}
88

9-
tasks.named<KotlinCompile>("compileTestKotlin") {
10-
kotlinOptions {
11-
freeCompilerArgs += listOf("-Xinline-classes")
9+
10+
tasks.withType<KotlinJvmCompile>().configureEach {
11+
compilerOptions {
12+
freeCompilerArgs.set(freeCompilerArgs.get() + "-Xinline-classes")
1213
}
1314
}

versions.properties

+7-5
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ plugin.me.champeau.jmh=0.7.2
2121

2222
version.com.oneeyedmen..okeydoke=2.0.3
2323

24-
version.com.fasterxml.jackson.core..jackson-databind=2.17.0
24+
version.com.fasterxml.jackson.core..jackson-databind=2.17.1
2525

2626
version.com.natpryce..hamkrest=1.8.0.1
2727

28-
version.junit.jupiter=5.10.2
28+
version.junit.jupiter=5.10.3
2929

3030
## [Blocked] Fails result4k kotest module
3131
version.kotest=5.6.2
@@ -34,11 +34,13 @@ version.kotest=5.6.2
3434
## # available=5.7.2
3535
## # available=5.8.0
3636
## # available=5.8.1
37+
## # available=5.9.0
38+
## # available=5.9.1
3739

38-
version.kotlin=1.9.23
40+
version.kotlin=2.0.0
3941

40-
version.kotlinx.coroutines=1.8.0
42+
version.kotlinx.coroutines=1.8.1
4143

42-
version.kotlinx.serialization=1.6.3
44+
version.kotlinx.serialization=1.7.1
4345

4446
version.strikt=0.34.1

0 commit comments

Comments
 (0)