diff --git a/.idea/dikt.iml b/.idea/dikt.iml
new file mode 100644
index 0000000..a2f6a12
--- /dev/null
+++ b/.idea/dikt.iml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/lib/dikt.lib.iml b/.idea/modules/lib/dikt.lib.iml
new file mode 100644
index 0000000..b1d4ab2
--- /dev/null
+++ b/.idea/modules/lib/dikt.lib.iml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules/lib/dikt.lib.main.iml b/.idea/modules/lib/dikt.lib.main.iml
index 4a4ce55..53d1b04 100644
--- a/.idea/modules/lib/dikt.lib.main.iml
+++ b/.idea/modules/lib/dikt.lib.main.iml
@@ -1,8 +1,6 @@
-
-
+
+
\ No newline at end of file
diff --git a/.idea/modules/lib/dikt.lib.test.iml b/.idea/modules/lib/dikt.lib.test.iml
new file mode 100644
index 0000000..bfcce8d
--- /dev/null
+++ b/.idea/modules/lib/dikt.lib.test.iml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index 943f0cb..c1962a7 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 37aef8d..744c64d 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.1.1-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
index b90525d..aeb74cb 100755
--- a/gradlew
+++ b/gradlew
@@ -85,9 +85,6 @@ done
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
-# 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"'
-
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -116,6 +113,7 @@ esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -196,6 +194,10 @@ if "$cygwin" || "$msys" ; then
done
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
diff --git a/gradlew.bat b/gradlew.bat
index 4b4ef2d..93e3f59 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -70,6 +70,7 @@ goto fail
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
diff --git a/lib/build.gradle.kts b/lib/build.gradle.kts
index 3c32d0d..f344892 100644
--- a/lib/build.gradle.kts
+++ b/lib/build.gradle.kts
@@ -1,10 +1,15 @@
+import fr.brouillard.oss.jgitver.Strategies
+import kotlinx.kover.gradle.plugin.dsl.MetricType
+import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
+
plugins {
`java-library`
`maven-publish`
- id("com.github.ben-manes.versions") version "0.46.0"
- id("io.gitlab.arturbosch.detekt") version "1.22.0"
- id("org.jetbrains.kotlinx.kover") version "0.6.1"
- kotlin("jvm") version "1.8.21"
+ id("com.github.ben-manes.versions") version "0.49.0"
+ id("fr.brouillard.oss.gradle.jgitver") version "0.9.1"
+ id("io.gitlab.arturbosch.detekt") version "1.23.3"
+ id("org.jetbrains.kotlinx.kover") version "0.7.4"
+ kotlin("jvm") version "1.9.20"
signing
}
@@ -23,28 +28,23 @@ dependencies {
testImplementation(kotlin("test"))
}
-publishing {
- repositories {
- maven {
- name = "Sonatype"
- url = if (version.toString().endsWith("SNAPSHOT")) {
- uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
- } else {
- uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
- }
+jgitver {
+ strategy = Strategies.MAVEN
+ useDirty = true
+}
- credentials {
- username = project.properties["ossrhUsername"] as String
- password = project.properties["ossrhPassword"] as String
- }
- }
- }
+publishing {
publications {
create("dikt") {
from(components["java"])
groupId = "io.github.vantoozz"
artifactId = "dikt"
- version = "0.13.0"
+
+ versionMapping {
+ usage("java-runtime") {
+ fromResolutionResult()
+ }
+ }
pom {
name.set("Dikt")
@@ -71,6 +71,26 @@ publishing {
}
}
}
+
+ repositories {
+ maven {
+ name = "Sonatype"
+ afterEvaluate {
+ url = if (project.version.toString().endsWith("-SNAPSHOT")
+ || project.version.toString().endsWith("-dirty")
+ ) {
+ uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
+ } else {
+ uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
+ }
+
+ credentials {
+ username = project.properties["ossrhUsername"] as String
+ password = project.properties["ossrhPassword"] as String
+ }
+ }
+ }
+ }
}
signing {
@@ -82,25 +102,21 @@ tasks {
useJUnitPlatform()
}
- withType {
+ withType {
kotlinOptions.jvmTarget = "1.8"
}
}
kotlin {
- jvmToolchain {
- languageVersion
- .set(JavaLanguageVersion.of(8))
- }
+ jvmToolchain(8)
}
-kover {
+koverReport {
verify {
- kotlinx.kover.api.CounterType.values().forEach {
- rule {
- name = "Minimal ${it.name} coverage rate in percents"
+ MetricType.values().forEach {
+ rule("Minimal ${it.name} coverage rate in percents") {
bound {
- counter = it
+ metric = it
minValue = 100
}
}