diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index f862d878..7e67c13b 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 c4dda1c4..9f13ee0a 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,9 +5,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) } group = "me.devnatan" @@ -37,6 +33,11 @@ repositories { kotlin { explicitApi() + @OptIn(org.jetbrains.kotlin.gradle.dsl.abi.ExperimentalAbiValidation::class) + abiValidation { + enabled.set(true) + } + jvm { tasks.named("jvmTest") { useJUnitPlatform() @@ -50,11 +51,6 @@ kotlin { exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL } } - tasks.withType().configureEach { - kotlinOptions { - freeCompilerArgs += listOf("-Xjvm-default=all") - } - } } linuxX64() @@ -63,7 +59,6 @@ kotlin { sourceSets { val commonMain by getting { dependencies { - implementation(kotlin("stdlib-common")) implementation(libs.ktx.coroutines.core) implementation(libs.ktx.datetime) implementation(libs.bundles.ktor) @@ -121,24 +116,9 @@ tasks { dependsOn("installKotlinterPrePushHook") } - withType().configureEach { - jvmTarget = "11" - - 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 21de5f30..00000000 --- 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 ccd59d1a..00000000 --- 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 0e5db7f2..5af7d002 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 da29e24a..0c83cc46 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,19 +1,16 @@ [versions] -kotlin = "1.9.22" +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" +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" -plugin-kover = "0.8.3" -plugin-detekt = "1.23.6" [libraries.ktx-coroutines-core] module = "org.jetbrains.kotlinx:kotlinx-coroutines-core" @@ -108,6 +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" } -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" }