Skip to content

Commit 5090ea3

Browse files
committed
- Kotlin -> 1.6.10
- Dokka -> 1.6.0 - Cleanup repositories
1 parent c2116c4 commit 5090ea3

File tree

4 files changed

+33
-19
lines changed

4 files changed

+33
-19
lines changed

build.gradle.kts

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ buildscript {
22
val kotlinVersion: String by System.getProperties()
33

44
repositories {
5-
maven { url = uri("https://dl.bintray.com/kotlin/kotlin-eap") }
65
mavenCentral()
76
}
87

@@ -15,15 +14,13 @@ plugins {
1514
val kotlinVersion: String by System.getProperties()
1615

1716
id ("org.jetbrains.kotlin.multiplatform") version kotlinVersion
18-
id ("org.jetbrains.dokka" ) version "0.10.0"
19-
id("maven-publish")
17+
id ("org.jetbrains.dokka" ) version "1.6.0"
18+
id ("maven-publish" )
2019
signing
2120
}
2221

2322
repositories {
24-
maven { url = uri("https://dl.bintray.com/kotlin/kotlin-eap") }
2523
mavenCentral()
26-
jcenter ()
2724
}
2825

2926
kotlin {
@@ -85,7 +82,7 @@ val dokkaJar by tasks.creating(Jar::class) {
8582
group = JavaBasePlugin.DOCUMENTATION_GROUP
8683
description = "Assembles Kotlin docs with Dokka"
8784
classifier = "javadoc"
88-
from(tasks.dokka)
85+
from(tasks.dokkaHtml)
8986
}
9087

9188
publishing {
@@ -144,14 +141,30 @@ signing {
144141
sign(publishing.publications)
145142
}
146143

147-
tasks {
148-
val dokka by getting(org.jetbrains.dokka.gradle.DokkaTask::class) {
149-
outputDirectory = "$buildDir/javadoc"
150-
outputFormat = "html"
144+
tasks.dokkaHtml {
145+
outputDirectory.set(buildDir.resolve("javadoc"))
151146

152-
multiplatform {
153-
val js by creating {}
154-
val jvm by creating {}
147+
dokkaSourceSets {
148+
configureEach {
149+
includeNonPublic.set(false)
150+
151+
// Do not output deprecated members. Applies globally, can be overridden by packageOptions
152+
skipDeprecated.set(true)
153+
154+
// Emit warnings about not documented members. Applies globally, also can be overridden by packageOptions
155+
reportUndocumented.set(true)
156+
157+
// Do not create index pages for empty packages
158+
skipEmptyPackages.set(true)
155159
}
156160
}
161+
}
162+
163+
rootProject.plugins.withType<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin> {
164+
rootProject.the<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension>().download = false
165+
rootProject.the<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension>().nodeVersion = "16.0.0"
166+
}
167+
168+
rootProject.plugins.withType<org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin> {
169+
rootProject.the<org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension>().disableGranularWorkspaces()
157170
}

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
systemProp.kotlinVersion = 1.5.21
1+
systemProp.kotlinVersion = 1.6.10
22

3-
version = 0.3.2
3+
version = 0.3.1
44
group = io.nacular.measured
55

66
junitVersion = 4.12

src/commonMain/kotlin/io/nacular/measured/units/Angle.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
package io.nacular.measured.units
44

5+
import io.nacular.measured.units.Angle.Companion.degrees
56
import kotlin.math.PI
67

78
/**
@@ -34,14 +35,14 @@ open class Angle(suffix: String, ratio: Double = 1.0): Units(suffix, ratio) {
3435
}
3536

3637
/**
37-
* @returns a measure that is within [0°, 360°)
38+
* Returns a measure that is within [0°, 360°)
3839
*/
3940
fun Measure<Angle>.normalize(): Measure<Angle> {
40-
var result = (this `in` Angle.degrees) % 360
41+
var result = (this `in` degrees) % 360
4142

4243
if (result < 0) {
4344
result += 360
4445
}
4546

46-
return result * Angle.degrees
47+
return result * degrees
4748
}

src/commonMain/kotlin/io/nacular/measured/units/Units.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class Measure<T: Units>(val amount: Double, val units: T): Comparable<Measure<T>
9898
* Type must share parent
9999
* (eg Mile into Kilometer, because they both are made from Distance)
100100
*/
101-
infix fun <A: T> `as`(other: A): Measure<out T> = if (units == other) this else Measure(this `in` other, other)
101+
infix fun <A: T> `as`(other: A): Measure<T> = if (units == other) this else Measure(this `in` other, other)
102102

103103
infix fun <A: T> `in`(other: A): Double = if (units == other) amount else amount * (units.ratio / other.ratio)
104104

0 commit comments

Comments
 (0)