diff --git a/build.gradle.kts b/build.gradle.kts index cfe6b16..5bc7e41 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,7 +14,7 @@ plugins { val kotlinVersion: String by System.getProperties() id ("org.jetbrains.kotlin.multiplatform") version kotlinVersion - id ("org.jetbrains.dokka" ) version "1.6.0" + id ("org.jetbrains.dokka" ) version "1.7.20" id ("maven-publish" ) signing } @@ -65,7 +65,7 @@ kotlin { jvm().compilations["test"].defaultSourceSet { dependencies { - implementation("junit:junit:$junitVersion") + implementation("org.junit.jupiter:junit-jupiter:$junitVersion") implementation(kotlin("test-junit")) } } @@ -81,10 +81,29 @@ kotlin { val dokkaJar by tasks.creating(Jar::class) { group = JavaBasePlugin.DOCUMENTATION_GROUP description = "Assembles Kotlin docs with Dokka" - classifier = "javadoc" + archiveClassifier.set("javadoc") from(tasks.dokkaHtml) } +tasks.dokkaHtml { + outputDirectory.set(buildDir.resolve("javadoc")) + + dokkaSourceSets { + configureEach { + includeNonPublic.set(false) + + // Do not output deprecated members. Applies globally, can be overridden by packageOptions + skipDeprecated.set(true) + + // Emit warnings about not documented members. Applies globally, also can be overridden by packageOptions + reportUndocumented.set(true) + + // Do not create index pages for empty packages + skipEmptyPackages.set(true) + } + } +} + publishing { publications.withType().apply { val jvm by getting { diff --git a/gradle.properties b/gradle.properties index 959f7df..a965950 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ -systemProp.kotlinVersion = 1.6.10 +systemProp.kotlinVersion = 1.7.21 -version = 0.3.1 +version = 0.3.2 group = io.nacular.measured -junitVersion = 4.12 +junitVersion = 5.9.1 kotlin.js.compiler = both \ No newline at end of file diff --git a/src/commonMain/kotlin/io/nacular/measured/units/BinarySize.kt b/src/commonMain/kotlin/io/nacular/measured/units/BinarySize.kt index 086a401..9f1d266 100644 --- a/src/commonMain/kotlin/io/nacular/measured/units/BinarySize.kt +++ b/src/commonMain/kotlin/io/nacular/measured/units/BinarySize.kt @@ -4,7 +4,7 @@ package io.nacular.measured.units * Units to measure computer storage, bandwidth, etc.. */ class BinarySize(suffix: String, ratio: Double = 1.0): Units(suffix, ratio) { - operator fun div(other: GraphicsLength) = ratio / other.ratio + operator fun div(other: BinarySize) = ratio / other.ratio companion object { val bytes = BinarySize("B" ) diff --git a/src/commonMain/kotlin/io/nacular/measured/units/Units.kt b/src/commonMain/kotlin/io/nacular/measured/units/Units.kt index 92c3431..43c6083 100644 --- a/src/commonMain/kotlin/io/nacular/measured/units/Units.kt +++ b/src/commonMain/kotlin/io/nacular/measured/units/Units.kt @@ -220,6 +220,11 @@ operator fun UnitsRatio.div(other: UnitsRatio Measure>>.times(other: Measure ): Measure> = amount * other.amount * (units * other.units) @JvmName("times6") operator fun Measure>>.times(other: Measure ): Measure, UnitsProduct>> = amount * other.amount * (units * other.units) +@JvmName("times8" ) operator fun Measure.times (other: Measure>>): Measure> = this.amount * other.amount * InverseUnits(other.units.unit.first) +@JvmName("times9" ) operator fun Measure>>.times(other: Measure ): Measure> = other * this +@JvmName("times10") operator fun Measure>.times (other: Measure ): Double = this.amount * other.amount +@JvmName("times11") operator fun Measure.times (other: Measure> ): Double = other * this + // endregion // TODO: Kapt code generation possible? @@ -246,6 +251,8 @@ operator fun Measure.rem(other: Measure): Double = amount % oth @JvmName("div14") operator fun Measure, UnitsProduct>>.div(other: Measure ): Measure>> = amount / other.amount * (units / other.units) @JvmName("div15") operator fun Measure. div(other: Measure> ): Measure = amount / other.amount * (units / other.units) +operator fun Measure>.div (other: Measure>>): Measure = this.amount * other.amount * other.units.unit.first + // endregion // region ================ Measure * Units Math ============================ @@ -304,6 +311,9 @@ operator fun Number.times(unit: T): Measure = this i operator fun Number.div (unit: T): Measure> = this into InverseUnits(unit) operator fun Number.times(measure: Measure): Measure = measure * this +@JvmName("divMeasure" ) operator fun Number.div (measure: Measure): Measure> = this.toDouble() / measure.amount * InverseUnits(measure.units) +@JvmName("divInvMeasure") operator fun Number.div (measure: Measure>): Measure = this * measure.units.unit / measure.amount + operator fun T.times (value: Number): Measure = value into this operator fun T.invoke(value: Number): Measure = value into this