diff --git a/README.adoc b/README.adoc index e755774..966f6cc 100644 --- a/README.adoc +++ b/README.adoc @@ -7,9 +7,7 @@ ifdef::env-github[] :warning-caption: :warning: endif::[] -[.right] -image::logo.png["kotlin-satlib",64] - +image:logo.png["kotlin-satlib",64] image:https://github.com/Lipen/kotlin-satlib/workflows/ci.yml/badge.svg?branch=master["Build status",link="https://github.com/Lipen/kotlin-satlib/actions"] image:https://jitpack.io/v/Lipen/kotlin-satlib.svg["JitPack",link="https://jitpack.io/p/Lipen/kotlin-satlib"] image:https://hitsofcode.com/github/Lipen/kotlin-satlib["Hits-of-Code",link="https://hitsofcode.com/view/github/Lipen/kotlin-satlib"] diff --git a/build.gradle.kts b/build.gradle.kts index 2f90c9a..2603a79 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,11 +5,8 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile group = "com.github.Lipen" plugins { - idea kotlin("jvm") version Versions.kotlin - with(Plugins.Kotlinter) { id(id) version (version) } with(Plugins.Jgitver) { id(id) version (version) } - with(Plugins.GradleVersions) { id(id) version (version) } with(Plugins.Shadow) { id(id) version (version) } with(Plugins.Jmh) { id(id) version (version) apply false } `maven-publish` @@ -17,7 +14,6 @@ plugins { fun Project.configureKotlinConventions() { apply(plugin = "kotlin") - apply(plugin = Plugins.Kotlinter.id) apply(plugin = "maven-publish") repositories { @@ -58,12 +54,6 @@ fun Project.configureKotlinConventions() { } } - kotlinter { - ignoreFailures = true - experimentalRules = true - disabledRules = arrayOf("import-ordering") - } - java { withSourcesJar() withJavadocJar() @@ -78,7 +68,7 @@ fun Project.configureKotlinConventions() { } } repositories { - maven(url = "$buildDir/repository") + maven(layout.buildDirectory.dir("repository")) } } } @@ -105,17 +95,10 @@ dependencies { // runtimeOnly(Libs.Log4j.log4j_core) // runtimeOnly(Libs.Log4j.log4j_slf4j2_impl) - testImplementation(Libs.Klock.klock_jvm) + testImplementation(Libs.Klock.klock) testImplementation(Libs.Okio.okio) } -idea { - module { - isDownloadSources = true - isDownloadJavadoc = true - } -} - jgitver { strategy("MAVEN") } @@ -125,7 +108,7 @@ tasks.shadowJar { } tasks.wrapper { - gradleVersion = "8.3" + gradleVersion = "8.4" distributionType = Wrapper.DistributionType.ALL } diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index a8add12..66a7574 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -1,22 +1,20 @@ -@file:Suppress("PublicApiImplicitType", "MemberVisibilityCanBePrivate", "unused") +@file:Suppress("PublicApiImplicitType", "MemberVisibilityCanBePrivate", "unused", "ConstPropertyName") object Versions { - const val gradle_versions = "0.44.0" const val jgitver = "0.9.1" const val jmh = "1.23" const val jmh_gradle_plugin = "0.5.3" - const val jna = "5.12.1" - const val junit = "5.9.1" - const val klock = "2.4.8" - const val kluent = "1.72" - const val kotlin = "1.7.21" - const val kotlin_logging = "3.0.4" - const val kotlinter = "3.12.0" - const val kotlinx_coroutines = "1.6.4" - const val log4j = "2.19.0" + const val jna = "5.13.0" + const val junit = "5.10.0" + const val klock = "4.0.10" + const val kluent = "1.73" + const val kotlin = "1.9.10" + const val kotlin_logging = "3.0.5" + const val kotlinx_coroutines = "1.7.3" + const val log4j = "2.21.0" const val multiarray = "0.13.1" - const val okio = "3.2.0" - const val shadow = "7.1.2" + const val okio = "3.6.0" + const val shadow = "8.1.1" } object Libs { @@ -37,7 +35,7 @@ object Libs { // https://github.com/korlibs/klock object Klock { const val version = Versions.klock - const val klock_jvm = "com.soywiz.korlibs.klock:klock-jvm:$version" + const val klock = "com.soywiz.korlibs.klock:klock:$version" } // https://github.com/square/okio @@ -85,18 +83,6 @@ object Plugins { const val id = "fr.brouillard.oss.gradle.jgitver" } - // https://github.com/ben-manes/gradle-versions-plugin - object GradleVersions { - const val version = Versions.gradle_versions - const val id = "com.github.ben-manes.versions" - } - - // https://github.com/JLLeitschuh/ktlint-gradle - object Kotlinter { - const val version = Versions.kotlinter - const val id = "org.jmailen.kotlinter" - } - // https://github.com/johnrengelman/shadow object Shadow { const val version = Versions.shadow diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d11cdd9..8838ba9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 0adc8e1..1aa94a4 100755 --- a/gradlew +++ b/gradlew @@ -145,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -153,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -202,11 +202,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/kotlin-satlib-jni/build.gradle.kts b/kotlin-satlib-jni/build.gradle.kts index 4913479..803e614 100644 --- a/kotlin-satlib-jni/build.gradle.kts +++ b/kotlin-satlib-jni/build.gradle.kts @@ -8,7 +8,7 @@ dependencies { jmh { jmhVersion = Versions.jmh - humanOutputFile = file("$buildDir/reports/jmh/human.txt") - resultsFile = file("$buildDir/reports/jmh/results.json") + humanOutputFile = layout.buildDirectory.file("reports/jmh/human.txt").get().asFile + resultsFile = layout.buildDirectory.file("reports/jmh/results.json").get().asFile resultFormat = "JSON" } diff --git a/src/test/kotlin/examples/bf/Common.kt b/src/test/kotlin/examples/bf/Common.kt index fddc313..34e4fcd 100644 --- a/src/test/kotlin/examples/bf/Common.kt +++ b/src/test/kotlin/examples/bf/Common.kt @@ -11,8 +11,8 @@ import com.github.lipen.satlib.core.IntVarArray import com.github.lipen.satlib.core.Model import com.github.lipen.satlib.core.convert import com.github.lipen.satlib.utils.writeln -import com.soywiz.klock.measureTimeWithResult import examples.utils.pow +import korlibs.time.measureTimeWithResult import okio.buffer import okio.sink import java.io.File diff --git a/src/test/kotlin/examples/ph/IncrementalPH.kt b/src/test/kotlin/examples/ph/IncrementalPH.kt index 755d9b6..717984b 100644 --- a/src/test/kotlin/examples/ph/IncrementalPH.kt +++ b/src/test/kotlin/examples/ph/IncrementalPH.kt @@ -13,7 +13,7 @@ import com.github.lipen.satlib.solver.addClause import com.github.lipen.satlib.solver.solve import com.github.lipen.satlib.utils.useWith import com.github.lipen.satlib.utils.writeln -import com.soywiz.klock.measureTimeWithResult +import korlibs.time.measureTimeWithResult import examples.utils.secondsSince import examples.utils.timeNow import okio.buffer diff --git a/src/test/kotlin/examples/ph/IterativePH.kt b/src/test/kotlin/examples/ph/IterativePH.kt index cbe450c..24d043b 100644 --- a/src/test/kotlin/examples/ph/IterativePH.kt +++ b/src/test/kotlin/examples/ph/IterativePH.kt @@ -8,7 +8,7 @@ import com.github.lipen.satlib.op.atMostOne import com.github.lipen.satlib.solver.Solver import com.github.lipen.satlib.utils.useWith import com.github.lipen.satlib.utils.writeln -import com.soywiz.klock.measureTimeWithResult +import korlibs.time.measureTimeWithResult import examples.utils.secondsSince import examples.utils.timeNow import okio.buffer diff --git a/src/test/kotlin/examples/utils/Utils.kt b/src/test/kotlin/examples/utils/Utils.kt index c74a90a..839c567 100644 --- a/src/test/kotlin/examples/utils/Utils.kt +++ b/src/test/kotlin/examples/utils/Utils.kt @@ -1,7 +1,7 @@ package examples.utils -import com.soywiz.klock.PerformanceCounter -import com.soywiz.klock.TimeSpan +import korlibs.time.PerformanceCounter +import korlibs.time.TimeSpan import kotlin.math.pow fun timeNow(): TimeSpan = PerformanceCounter.reference