From 10d64ea371d7475b69f61201db01ec510718180b Mon Sep 17 00:00:00 2001 From: Natan Date: Fri, 14 Nov 2025 07:47:20 -0300 Subject: [PATCH 1/9] chore: bump kotlin to 2.2.21 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index da29e24..bf12ef6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -kotlin = "1.9.22" +kotlin = "2.2.21" ktx-coroutines = "1.10.2" ktx-serialization = "1.7.1" ktor = "2.3.12" From 27443a204653d82b90dc4a1f3c72db4bbe999f59 Mon Sep 17 00:00:00 2001 From: Natan Date: Fri, 14 Nov 2025 07:47:30 -0300 Subject: [PATCH 2/9] chore: bump kotlinx.serializaton to 1.9.0 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index bf12ef6..9d5a37e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] kotlin = "2.2.21" ktx-coroutines = "1.10.2" -ktx-serialization = "1.7.1" +ktx-serialization = "1.9.0" ktor = "2.3.12" junixsocket = "2.6.1" ktx-datetime = "0.6.2" From b5c54852693fb50e221a8a2c0f4ab3fc3a2be760 Mon Sep 17 00:00:00 2001 From: Natan Date: Fri, 14 Nov 2025 07:47:38 -0300 Subject: [PATCH 3/9] chore: bump kotlinx.datetime to 0.7.1 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9d5a37e..979627a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,7 +4,7 @@ ktx-coroutines = "1.10.2" ktx-serialization = "1.9.0" ktor = "2.3.12" junixsocket = "2.6.1" -ktx-datetime = "0.6.2" +ktx-datetime = "0.7.1" junit = "5.12.2" slf4j = "2.0.13" apache-compress = "1.26.2" From 9ac8f4a09da6d9a6a0df32f6755df06d789b2949 Mon Sep 17 00:00:00 2001 From: Natan Date: Fri, 14 Nov 2025 07:47:44 -0300 Subject: [PATCH 4/9] chore: bump kotlinx.io to 0.8.0 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 979627a..9ff51dc 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -8,7 +8,7 @@ ktx-datetime = "0.7.1" junit = "5.12.2" slf4j = "2.0.13" apache-compress = "1.26.2" -kotlinx-io = "0.4.0" +kotlinx-io = "0.8.0" plugin-kotlinter = "4.4.1" plugin-publish = "0.31.0" plugin-binaryCompatibilityValidator = "0.18.1" From 9352c08cc7ae90034f95efac52f6fc109272be6b Mon Sep 17 00:00:00 2001 From: Natan Date: Fri, 14 Nov 2025 07:47:56 -0300 Subject: [PATCH 5/9] chore: bump kover to 0.9.3 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9ff51dc..85177cc 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -12,8 +12,8 @@ kotlinx-io = "0.8.0" plugin-kotlinter = "4.4.1" plugin-publish = "0.31.0" plugin-binaryCompatibilityValidator = "0.18.1" -plugin-kover = "0.8.3" plugin-detekt = "1.23.6" +plugin-kover = "0.9.3" [libraries.ktx-coroutines-core] module = "org.jetbrains.kotlinx:kotlinx-coroutines-core" From d1f862f227d92382d6a2420ddafe6b4667ca317b Mon Sep 17 00:00:00 2001 From: Natan Date: Fri, 14 Nov 2025 07:48:04 -0300 Subject: [PATCH 6/9] chore: bump detekt to 1.23.8 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 85177cc..9209a89 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -12,8 +12,8 @@ kotlinx-io = "0.8.0" plugin-kotlinter = "4.4.1" plugin-publish = "0.31.0" plugin-binaryCompatibilityValidator = "0.18.1" -plugin-detekt = "1.23.6" plugin-kover = "0.9.3" +plugin-detekt = "1.23.8" [libraries.ktx-coroutines-core] module = "org.jetbrains.kotlinx:kotlinx-coroutines-core" From 8d637f6db67ba316f86597dc6eda6a125b85b522 Mon Sep 17 00:00:00 2001 From: Natan Date: Fri, 14 Nov 2025 07:52:49 -0300 Subject: [PATCH 7/9] chore: use built-in abi validator --- .github/workflows/pr.yml | 2 +- build.gradle.kts | 24 +++++++++++++++--------- gradle/libs.versions.toml | 2 -- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index f862d87..7e67c13 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -50,4 +50,4 @@ jobs: uses: gradle/actions/setup-gradle@v4 - name: Check Binary Compatibility - run: ./gradlew apiCheck \ No newline at end of file + run: ./gradlew checkLegacyAbi \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index c4dda1c..451754a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,7 +6,6 @@ plugins { alias(libs.plugins.kotlinx.serialization) alias(libs.plugins.kotlinter) alias(libs.plugins.publish) - alias(libs.plugins.binaryCompatibilityValidator) alias(libs.plugins.kover) alias(libs.plugins.detekt) } @@ -37,6 +36,12 @@ repositories { kotlin { explicitApi() + @OptIn(org.jetbrains.kotlin.gradle.dsl.abi.ExperimentalAbiValidation::class) + abiValidation { + // Use the set() function to ensure compatibility with older Gradle versions + enabled.set(true) + } + jvm { tasks.named("jvmTest") { useJUnitPlatform() @@ -50,20 +55,23 @@ kotlin { exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL } } - tasks.withType().configureEach { - kotlinOptions { - freeCompilerArgs += listOf("-Xjvm-default=all") - } - } + // tasks.withType().configureEach { + // kotlinOptions { + // freeCompilerArgs += listOf("-Xjvm-default=all") + // } + // } } + // compilerOptions { + // freeCompilerArgs += listOf("-Xjvm-default=all") + // } + linuxX64() macosX64() sourceSets { val commonMain by getting { dependencies { - implementation(kotlin("stdlib-common")) implementation(libs.ktx.coroutines.core) implementation(libs.ktx.datetime) implementation(libs.bundles.ktor) @@ -122,8 +130,6 @@ tasks { } withType().configureEach { - jvmTarget = "11" - reports { xml.required.set(true) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9209a89..632b8e0 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,7 +11,6 @@ apache-compress = "1.26.2" kotlinx-io = "0.8.0" plugin-kotlinter = "4.4.1" plugin-publish = "0.31.0" -plugin-binaryCompatibilityValidator = "0.18.1" plugin-kover = "0.9.3" plugin-detekt = "1.23.8" @@ -108,6 +107,5 @@ kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } kotlinter = { id = "org.jmailen.kotlinter", version.ref = "plugin-kotlinter" } publish = { id = "com.vanniktech.maven.publish", version.ref = "plugin-publish" } -binaryCompatibilityValidator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "plugin-binaryCompatibilityValidator" } kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "plugin-kover" } detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "plugin-detekt" } From 150e84e15f55cc1cb90d93c2c7f2b494c0932575 Mon Sep 17 00:00:00 2001 From: Natan Date: Fri, 14 Nov 2025 08:10:36 -0300 Subject: [PATCH 8/9] chore: remove detekt and kover --- build.gradle.kts | 16 --- config/baseline.xml | 6 - config/detekt.yml | 284 -------------------------------------- gradle.properties | 2 +- gradle/libs.versions.toml | 4 - 5 files changed, 1 insertion(+), 311 deletions(-) delete mode 100644 config/baseline.xml delete mode 100644 config/detekt.yml diff --git a/build.gradle.kts b/build.gradle.kts index 451754a..6fbe0c3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,3 @@ -import io.gitlab.arturbosch.detekt.Detekt import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { @@ -6,8 +5,6 @@ plugins { alias(libs.plugins.kotlinx.serialization) alias(libs.plugins.kotlinter) alias(libs.plugins.publish) - alias(libs.plugins.kover) - alias(libs.plugins.detekt) } group = "me.devnatan" @@ -129,22 +126,9 @@ tasks { dependsOn("installKotlinterPrePushHook") } - withType().configureEach { - reports { - xml.required.set(true) - } - } - // https://youtrack.jetbrains.com/issue/KT-46466/Kotlin-MPP-publishing-Gradle-7-disables-optimizations-because-of-task-dependencies val signingTasks = withType() withType().configureEach { dependsOn(signingTasks) } } - -detekt { - buildUponDefaultConfig = true - allRules = false - config.setFrom(files("$projectDir/config/detekt.yml")) - baseline = file("$projectDir/config/baseline.xml") -} \ No newline at end of file diff --git a/config/baseline.xml b/config/baseline.xml deleted file mode 100644 index 21de5f3..0000000 --- a/config/baseline.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/config/detekt.yml b/config/detekt.yml deleted file mode 100644 index ccd59d1..0000000 --- a/config/detekt.yml +++ /dev/null @@ -1,284 +0,0 @@ -comments: - CommentOverPrivateProperty: - active: true - UndocumentedPublicClass: - active: true - excludes: ['**/*.kt'] - includes: ['**/detekt-api/src/main/**/api/*.kt'] - UndocumentedPublicFunction: - active: true - excludes: ['**/*.kt'] - includes: ['**/detekt-api/src/main/**/api/*.kt'] - -complexity: - StringLiteralDuplication: - active: true - excludes: ['**/test/**', '**/*Test.kt', '**/*Spec.kt'] - threshold: 5 - ignoreAnnotation: true - excludeStringsWithLessThan5Characters: true - ignoreStringsRegex: '$^' - ComplexInterface: - active: true - threshold: 10 - includeStaticDeclarations: false - includePrivateDeclarations: false - CyclomaticComplexMethod: - active: true - ignoreSingleWhenExpression: true - LargeClass: - active: true - excludes: ['**/test/**', '**/*.Test.kt', '**/*.Spec.kt'] - MethodOverloading: - active: true - TooManyFunctions: - excludes: ['**/test/**', '**/functionalTest/**'] - -coroutines: - active: true - GlobalCoroutineUsage: - active: true - RedundantSuspendModifier: - active: true - SleepInsteadOfDelay: - active: true - SuspendFunWithFlowReturnType: - active: true - -exceptions: - InstanceOfCheckForException: - active: true - NotImplementedDeclaration: - active: true - ObjectExtendsThrowable: - active: true - RethrowCaughtException: - active: true - ReturnFromFinally: - active: true - ThrowingExceptionFromFinally: - active: true - ThrowingExceptionInMain: - active: true - ThrowingExceptionsWithoutMessageOrCause: - active: true - ThrowingNewInstanceOfSameException: - active: true - -formatting: - active: true - android: false - autoCorrect: true - Filename: - active: false - FunctionReturnTypeSpacing: - active: true - FunctionStartOfBodySpacing: - active: true - MaximumLineLength: - active: false - NullableTypeSpacing: - active: true - ParameterListSpacing: - active: true - SpacingBetweenFunctionNameAndOpeningParenthesis: - active: true - TypeParameterListSpacing: - active: true - -naming: - ClassNaming: - excludes: ['**/*Spec.kt'] - FunctionNaming: - active: true - excludes: - - '**/test/**' - - '**/androidTest/**' - - '**/commonTest/**' - - '**/functionalTest/**' - - '**/jvmTest/**' - - '**/jsTest/**' - - '**/iosTest/**' - TopLevelPropertyNaming: - constantPattern: '[a-z][_A-Za-z0-9]*|[A-Z][_A-Z0-9]*' - InvalidPackageDeclaration: - active: true - excludes: ['**/build-logic/**/*.kt', '**/*.kts'] - NoNameShadowing: - active: true - NonBooleanPropertyPrefixedWithIs: - active: true - VariableMaxLength: - active: true - VariableMinLength: - active: true - -performance: - SpreadOperator: - excludes: ['**/test/**', '**/functionalTest/**'] - -potential-bugs: - AvoidReferentialEquality: - active: true - DontDowncastCollectionTypes: - active: true - DoubleMutabilityForCollection: - active: false - ElseCaseInsteadOfExhaustiveWhen: - active: true - ExitOutsideMain: - active: false - HasPlatformType: - active: true - IgnoredReturnValue: - active: true - ImplicitUnitReturnType: - active: true - MapGetWithNotNullAssertionOperator: - active: true - UnconditionalJumpStatementInLoop: - active: true - UnreachableCatchBlock: - active: true - UnsafeCast: - active: true - excludes: ['**/test/**', '**/*.Test.kt', '**/*.Spec.kt'] - UselessPostfixExpression: - active: true - -style: - CanBeNonNullable: - active: true - CascadingCallWrapping: - active: true - ClassOrdering: - active: true - CollapsibleIfStatements: - active: true - DestructuringDeclarationWithTooManyEntries: - active: true - EqualsOnSignatureLine: - active: true - ExplicitCollectionElementAccessMethod: - active: true - ExplicitItLambdaParameter: - active: true - ForbiddenComment: - active: true - values: - - 'TODO:' - - 'FIXME:' - - 'STOPSHIP:' - - '@author' - - '@requiresTypeResolution' - excludes: ['**/detekt-rules-style/**/ForbiddenComment.kt'] - ForbiddenImport: - active: true - imports: - - value: 'org.assertj.core.api.Assertions' - reason: 'Import Assertions.assertThat instead.' - - value: 'org.junit.jupiter.api.Assertions*' - reason: 'Use AssertJ assertions instead.' - ForbiddenMethodCall: - active: true - methods: - - 'kotlin.io.print' - - 'kotlin.io.println' - - 'java.net.URL.openStream' - - 'java.lang.Class.getResourceAsStream' - - 'java.lang.ClassLoader.getResourceAsStream' - - 'org.jetbrains.kotlin.diagnostics.DiagnosticUtils.getLineAndColumnInPsiFile' - ForbiddenVoid: - active: true - MagicNumber: - excludes: ['**/test/**', '**/*Test.kt', '**/*Spec.kt'] - ignorePropertyDeclaration: true - ignoreAnnotation: true - ignoreEnums: true - ignoreNumbers: - - '-1' - - '0' - - '1' - - '2' - - '100' - - '1000' - MandatoryBracesLoops: - active: true - MaxLineLength: - active: true - excludes: ['**/test/**', '**/*Test.kt', '**/*Spec.kt'] - excludeCommentStatements: true - NestedClassesVisibility: - active: true - ObjectLiteralToLambda: - active: true - PreferToOverPairSyntax: - active: true - RedundantExplicitType: - active: true - RedundantHigherOrderMapUsage: - active: true - RedundantVisibilityModifierRule: - active: true - ReturnCount: - active: true - excludeGuardClauses: true - SpacingBetweenPackageAndImports: - active: true - TrimMultilineRawString: - active: true - UnderscoresInNumericLiterals: - active: true - UnnecessaryAnnotationUseSiteTarget: - active: true - UnnecessaryFilter: - active: true - UnnecessaryLet: - active: true - UnnecessaryInnerClass: - active: true - ignoreAnnotated: ['Nested'] - UntilInsteadOfRangeTo: - active: true - UnusedImports: - active: false # formatting already have this rule enabled - UnusedPrivateMember: - active: true - allowedNames: '(_|ignored|expected)' - UseAnyOrNoneInsteadOfFind: - active: true - UseCheckOrError: - active: true - UseEmptyCounterpart: - active: true - UseIfEmptyOrIfBlank: - active: true - UseIsNullOrEmpty: - active: true - UseOrEmpty: - active: true - UseRequire: - active: true - UseRequireNotNull: - active: true - VarCouldBeVal: - active: true - ignoreAnnotated: ['Parameter'] - WildcardImport: - active: true - excludeImports: [] - -libraries: - ForbiddenPublicDataClass: - active: false - LibraryEntitiesShouldNotBePublic: - active: false - LibraryCodeMustSpecifyReturnType: - active: true - excludes: ['**/*.kt'] - includes: ['**/detekt-api/src/main/**/api/*.kt'] - -ruleauthors: - ViolatesTypeResolutionRequirements: - active: true - excludes: ['**/test/**', '**/*Test.kt', '**/*Spec.kt'] \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 0e5db7f..5af7d00 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ kotlin.mpp.stability.nowarn=true org.gradle.caching=true org.gradle.parallel=true org.gradle.unsafe.configuration-cache=true -kotlin.mpp.enableCInteropCommonization=true +kotlin.mpp.applyDefaultHierarchyTemplate=false POM_NAME=docker-kotlin POM_DESCRIPTION=Docker Engine Remote API client diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 632b8e0..0c83cc4 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,8 +11,6 @@ apache-compress = "1.26.2" kotlinx-io = "0.8.0" plugin-kotlinter = "4.4.1" plugin-publish = "0.31.0" -plugin-kover = "0.9.3" -plugin-detekt = "1.23.8" [libraries.ktx-coroutines-core] module = "org.jetbrains.kotlinx:kotlinx-coroutines-core" @@ -107,5 +105,3 @@ kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } kotlinter = { id = "org.jmailen.kotlinter", version.ref = "plugin-kotlinter" } publish = { id = "com.vanniktech.maven.publish", version.ref = "plugin-publish" } -kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "plugin-kover" } -detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "plugin-detekt" } From edebb271b2a0e57d0fa4bf3ca391349eb3a36299 Mon Sep 17 00:00:00 2001 From: Natan Date: Fri, 14 Nov 2025 08:11:26 -0300 Subject: [PATCH 9/9] chore: remove kotlin options --- build.gradle.kts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 6fbe0c3..9f13ee0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -35,7 +35,6 @@ kotlin { @OptIn(org.jetbrains.kotlin.gradle.dsl.abi.ExperimentalAbiValidation::class) abiValidation { - // Use the set() function to ensure compatibility with older Gradle versions enabled.set(true) } @@ -52,17 +51,8 @@ kotlin { exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL } } - // tasks.withType().configureEach { - // kotlinOptions { - // freeCompilerArgs += listOf("-Xjvm-default=all") - // } - // } } - // compilerOptions { - // freeCompilerArgs += listOf("-Xjvm-default=all") - // } - linuxX64() macosX64()