Skip to content

Commit 05ff33a

Browse files
authored
Merge pull request #177 from ProjectMapK/develop
For release 2.16.0-beta7
2 parents d87f1fc + 703d998 commit 05ff33a

File tree

151 files changed

+386
-364
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+386
-364
lines changed

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# https://editorconfig.org
2+
root = true
3+
4+
[*.{kt,kts}]
5+
ij_kotlin_allow_trailing_comma = false
6+
ij_kotlin_allow_trailing_comma_on_call_site = false

.github/workflows/lint-and-test-dev.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jobs:
3333
name: lint-and-test-dev
3434
runs-on: ubuntu-latest
3535
timeout-minutes: 15
36+
permissions: # for gradle-dependency-submission
37+
contents: write
3638
steps:
3739
- name: Checkout
3840
uses: actions/checkout@v4
@@ -51,3 +53,6 @@ jobs:
5153
uses: gradle/gradle-build-action@v2
5254
with:
5355
arguments: test
56+
# TODO: Prepare a separate WF to be executed only when there is a change in build.gradle.
57+
- name: Run snapshot action
58+
uses: mikepenz/[email protected]

.github/workflows/test-main.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ jobs:
3838
java-version: [ '8', '11', '17', '20' ]
3939
# Minimum version, latest release version, latest pre-release version (if exists)
4040
kotlin:
41-
- name: '1.7.21'
42-
version: '1.7.21'
43-
k2: false
4441
- name: '1.8.22'
4542
version: '1.8.22'
4643
k2: false
@@ -50,6 +47,12 @@ jobs:
5047
- name: '1.9.20 K2'
5148
version: '1.9.20'
5249
k2: true
50+
- name: '2.0.0-Beta1'
51+
version: '2.0.0-Beta1'
52+
k2: false
53+
- name: '2.0.0-Beta1 K2'
54+
version: '2.0.0-Beta1'
55+
k2: true
5356
env:
5457
KOTLIN_VERSION: ${{ matrix.kotlin.version }}
5558
USE_K2: ${{ matrix.kotlin.k2 }}

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,18 @@ This project makes several disruptive changes to achieve more `Kotlin-like` beha
3434
Details are summarized in [KogeraSpecificImplementations](./docs/KogeraSpecificImplementations.md).
3535

3636
# Compatibility
37-
- `jackson 2.15.0`
37+
- `jackson 2.16.x`
3838
- `Java 8+`
39-
- `Kotlin 1.7.21+`
39+
- `Kotlin 1.8.22+`
4040

4141
## About compatibility checks
4242
Compatibility checks for `Java` and `Kotlin` are done by `CI` grid tests.
4343

4444
The `Java` test covers all currently supported LTS versions and the latest versions.
4545
Currently 8,11,17 and 20 are covered.
4646

47-
`Kotlin` is tested on the latest patch version and the latest `Beta` or `RC` version within each minor version since 1.7.21.
48-
Currently 1.7.21 and 1.9.20-Beta are covered.
49-
I hope to lower this version in the future, but currently the minimum `Kotlin` version that can be supported is 1.7 due to `kotlinx-metadata-jvm` constraints.
47+
`Kotlin` is tested with the latest patch version and the latest `Beta` or `RC` version within each minor version after the minimum version.
48+
The `Kotlin` version is the lowest version available with the latest `kotlinx-metadata-jvm`.
5049

5150
# Installation
5251
The package is temporarily published in `JitPack`.

build.gradle.kts

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
11
plugins {
22
`maven-publish` // for JitPack
33

4-
val kotlinVersion: String = System.getenv("KOTLIN_VERSION")?.takeIf { it.isNotEmpty() } ?: "1.7.21"
4+
val kotlinVersion: String = System.getenv("KOTLIN_VERSION")?.takeIf { it.isNotEmpty() } ?: "1.8.22"
55
kotlin("jvm") version kotlinVersion
66

77
java
8-
id("org.jmailen.kotlinter") version "3.13.0"
8+
id("org.jmailen.kotlinter") version "3.16.0"
99
}
1010

1111
// Since group cannot be obtained by generateKogeraVersion, it is defined as a constant.
1212
val groupStr = "io.github.projectmapk"
13-
val jacksonVersion = "2.15.3"
13+
val jacksonVersion = "2.16.0"
1414
val generatedSrcPath = "${layout.buildDirectory.get()}/generated/kotlin"
1515

1616
group = groupStr
17-
version = "${jacksonVersion}-beta6"
17+
version = "${jacksonVersion}-beta7"
1818

1919
repositories {
2020
mavenCentral()
2121
}
2222

2323
dependencies {
2424
implementation(kotlin("stdlib"))
25-
implementation("org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.6.2")
25+
implementation("org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.7.0")
2626

2727
api("com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}")
2828
api("com.fasterxml.jackson.core:jackson-annotations:${jacksonVersion}")
2929

3030
// test libs
31-
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.0")
31+
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.1")
32+
testImplementation("org.junit.jupiter:junit-jupiter-params:5.10.1")
3233
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
3334
testImplementation("io.mockk:mockk:1.13.7")
3435

@@ -60,15 +61,15 @@ java {
6061
targetCompatibility = JavaVersion.VERSION_1_8
6162
}
6263

63-
kotlinter {
64-
// see https://github.com/pinterest/ktlint/blob/master/docs/rules/standard.md
65-
this.disabledRules = arrayOf(
66-
"package-name", // This project allows for the inclusion of _ to represent the package name in the snake case.
67-
"filename" // For clarity in future extensions, this rule is disabled.
68-
)
69-
}
70-
7164
tasks {
65+
// For ported tests, they are excluded from the formatting because they are not new code.
66+
lintKotlinTest {
67+
exclude { it.path.contains("zPorted") }
68+
}
69+
formatKotlinTest {
70+
exclude { it.path.contains("zPorted") }
71+
}
72+
7273
// Task to generate version file
7374
val generateKogeraVersion by registering(Copy::class) {
7475
val packageStr = "$groupStr.jackson.module.kogera"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package io.github.projectmapk.jackson.module.kogera.deser.value_instantiator;
1+
package io.github.projectmapk.jackson.module.kogera.deser.valueInstantiator;
22

33
import kotlin.jvm.functions.Function0;
44
import org.jetbrains.annotations.NotNull;

src/main/kotlin/io/github/projectmapk/jackson/module/kogera/ClosedRangeResolver.kt renamed to src/main/kotlin/io/github/projectmapk/jackson/module/kogera/ClosedRangeSupport.kt

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,37 @@
11
package io.github.projectmapk.jackson.module.kogera
22

3-
import com.fasterxml.jackson.databind.AbstractTypeResolver
3+
import com.fasterxml.jackson.annotation.JsonCreator
4+
import com.fasterxml.jackson.annotation.JsonIgnore
5+
import com.fasterxml.jackson.annotation.JsonProperty
46
import com.fasterxml.jackson.databind.DeserializationConfig
57
import com.fasterxml.jackson.databind.JavaType
8+
import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver
9+
10+
internal abstract class ClosedRangeMixin<T> @JsonCreator constructor(
11+
public val start: T,
12+
@get:JsonProperty("end") public val endInclusive: T
13+
) {
14+
@JsonIgnore
15+
public abstract fun getEnd(): T
16+
17+
@JsonIgnore
18+
public abstract fun getFirst(): T
19+
20+
@JsonIgnore
21+
public abstract fun getLast(): T
22+
23+
@JsonIgnore
24+
public abstract fun getIncrement(): T
25+
26+
@JsonIgnore
27+
public abstract fun isEmpty(): Boolean
28+
29+
@JsonIgnore
30+
public abstract fun getStep(): T
31+
32+
@JsonIgnore
33+
public abstract fun getEndExclusive(): T
34+
}
635

736
/*
837
* ClosedRange, which is not a concrete type like IntRange, does not have a type to deserialize to,
@@ -12,7 +41,9 @@ import com.fasterxml.jackson.databind.JavaType
1241
* The target of processing is ClosedRange and interfaces or abstract classes that inherit from it.
1342
* As of Kotlin 1.5.32, ClosedRange and ClosedFloatingPointRange are processed.
1443
*/
15-
internal object ClosedRangeResolver : AbstractTypeResolver() {
44+
internal object ClosedRangeResolver : SimpleAbstractTypeResolver() {
45+
private fun readResolve(): Any = ClosedRangeResolver
46+
1647
// At present, it depends on the private class, but if it is made public, it must be switched to a direct reference.
1748
// see https://youtrack.jetbrains.com/issue/KT-55376
1849
val closedDoubleRangeRef: Class<*> by lazy {

src/main/kotlin/io/github/projectmapk/jackson/module/kogera/Converters.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import com.fasterxml.jackson.databind.util.StdConverter
99
* A converter that only performs box processing for the value class.
1010
* Note that constructor-impl is not called.
1111
* @param S is nullable because value corresponds to a nullable value class.
12-
* see [io.github.projectmapk.jackson.module.kogera.annotation_introspector.KotlinFallbackAnnotationIntrospector.findNullSerializer]
12+
* see [io.github.projectmapk.jackson.module.kogera.annotationIntrospector.KotlinFallbackAnnotationIntrospector.findNullSerializer]
1313
*/
1414
internal class ValueClassBoxConverter<S : Any?, D : Any>(
1515
unboxedClass: Class<S>,

src/main/kotlin/io/github/projectmapk/jackson/module/kogera/KotlinMixins.kt

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)