Skip to content

Commit

Permalink
Add length (#13)
Browse files Browse the repository at this point in the history
* Create distance types

* Fix sync

* Create LengthUnit.kt

* Implement Length

* Implement Length

* private meters

* Update workflows

* Add some missing docs
  • Loading branch information
boswelja authored Nov 13, 2024
1 parent 13261b9 commit 9edf5f1
Show file tree
Hide file tree
Showing 8 changed files with 556 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/area-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ bitrate:
- bitrate/**
capacity:
- capacity/**
length:
- length/**
percentage:
- percentage/**
temperature:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/code-scanning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ jobs:
strategy:
matrix:
path:
- bitrate
- capacity
- length
- percentage
- temperature
steps:
Expand Down
1 change: 1 addition & 0 deletions length/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
3 changes: 3 additions & 0 deletions length/MODULE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Module length

Store and convert between measurements of length. For example, `1"` --> `2.54 cm`.
108 changes: 108 additions & 0 deletions length/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
import java.net.URI

plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.android.library)

alias(libs.plugins.detekt)

alias(libs.plugins.dokka)
id("com.boswelja.publish")
}

android {
namespace = "com.boswelja.length"

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}

lint {
sarifReport = true
htmlReport = false
}
}

repositories {
google()
mavenCentral()
}

kotlin {
jvmToolchain(21)

// Android
androidTarget {
publishLibraryVariants("release")
}

// JVM
jvm()

// Apple
iosArm64()
iosX64()
macosX64()
macosArm64()
tvosX64()
tvosArm64()
watchosArm32()
watchosArm64()

// Windows
mingwX64()

// Linux
linuxArm64()
linuxX64()

// WASM
@OptIn(ExperimentalWasmDsl::class)
wasmJs {
browser()
}

sourceSets {
commonMain {
dependencies {
implementation(kotlin("stdlib"))
implementation(libs.ionspin.bignum)
}
}
commonTest {
dependencies {
implementation(kotlin("test"))
}
}
}
}

detekt {
buildUponDefaultConfig = true
config.setFrom("$rootDir/config/detekt.yml")
basePath = rootDir.absolutePath
}

publish {
description = "A Length class that allows you to convert between any unit of length"
repositoryUrl = "https://github.com/boswelja/kotlin-datatypes"
license = "MIT"
}

dokka {
dokkaSourceSets.configureEach {
includes.from("MODULE.md")
sourceLink {
localDirectory.set(projectDir.resolve("src"))
remoteUrl.set(URI("${publish.repositoryUrl.get()}/tree/main/${project.name}/src"))
remoteLineSuffix.set("#L")
}
}
}
Loading

0 comments on commit 9edf5f1

Please sign in to comment.