Skip to content

Commit

Permalink
Fix sources for multiplatform
Browse files Browse the repository at this point in the history
  • Loading branch information
boswelja committed Apr 6, 2024
1 parent 48696f5 commit 13cd704
Show file tree
Hide file tree
Showing 12 changed files with 161 additions and 38 deletions.
40 changes: 33 additions & 7 deletions bitrate/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.jetbrains.dokka.gradle.DokkaTaskPartial
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import java.net.URL

plugins {
Expand Down Expand Up @@ -33,21 +34,46 @@ android {
sarifReport = true
htmlReport = false
}
}

publishing {
singleVariant("release") {
withJavadocJar()
withSourcesJar()
}
}
repositories {
google()
mavenCentral()
}

kotlin {
jvmToolchain(17)

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

// JVM
jvm()
jvmToolchain(17)

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

// Windows
mingwX64()

// Linux
linuxArm64()
linuxX64()

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

sourceSets {
commonMain {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.boswelja.bitrate

import kotlin.jvm.JvmInline
import kotlin.math.roundToLong

/**
Expand Down
4 changes: 4 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ plugins {

alias(libs.plugins.dokka)
}

repositories {
mavenCentral()
}
40 changes: 33 additions & 7 deletions capacity/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.jetbrains.dokka.gradle.DokkaTaskPartial
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import java.net.URL

plugins {
Expand Down Expand Up @@ -33,21 +34,46 @@ android {
sarifReport = true
htmlReport = false
}
}

publishing {
singleVariant("release") {
withJavadocJar()
withSourcesJar()
}
}
repositories {
google()
mavenCentral()
}

kotlin {
jvmToolchain(17)

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

// JVM
jvm()
jvmToolchain(17)

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

// Windows
mingwX64()

// Linux
linuxArm64()
linuxX64()

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

sourceSets {
commonMain {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.boswelja.capacity

import kotlin.jvm.JvmInline
import kotlin.math.roundToLong

/**
Expand Down
39 changes: 37 additions & 2 deletions percentage/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.jetbrains.dokka.gradle.DokkaTaskPartial
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import java.net.URL

plugins {
Expand Down Expand Up @@ -35,11 +36,45 @@ android {
}
}

repositories {
google()
mavenCentral()
}

kotlin {
androidTarget()
jvm()
jvmToolchain(17)

// 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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.boswelja.percentage

import com.boswelja.percentage.Percentage.Companion.percent
import kotlin.jvm.JvmInline
import kotlin.math.roundToInt

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class PercentageTest {
)

@Test
fun `100 percent is mapped correctly`() {
fun oneHundredPercentIsMappedCorrectly() {
testValue(
1.0f.percent,
ONE_HUNDRED_PERCENT
Expand All @@ -54,7 +54,7 @@ class PercentageTest {
}

@Test
fun `200 percent is mapped correctly`() {
fun twoHundredPercentIsMappedCorrectly() {
testValue(
2.0f.percent,
TWO_HUNDRED_PERCENT
Expand All @@ -70,7 +70,7 @@ class PercentageTest {
}

@Test
fun `0 percent is mapped correctly`() {
fun zeroPercentIsMappedCorrectly() {
testValue(
0f.percent,
ZERO_PERCENT
Expand Down
7 changes: 0 additions & 7 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ pluginManagement {
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}

plugins {
id("com.gradle.enterprise") version("3.16")
Expand Down
39 changes: 37 additions & 2 deletions temperature/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.jetbrains.dokka.gradle.DokkaTaskPartial
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import java.net.URL

plugins {
Expand Down Expand Up @@ -35,11 +36,45 @@ android {
}
}

repositories {
google()
mavenCentral()
}

kotlin {
androidTarget()
jvm()
jvmToolchain(17)

// 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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.boswelja.temperature

import com.ionspin.kotlin.bignum.decimal.BigDecimal
import com.ionspin.kotlin.bignum.decimal.toBigDecimal
import kotlin.jvm.JvmInline
import kotlin.math.roundToLong

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,79 +67,79 @@ class TemperatureTest {
}

@Test
fun `converting kelvin between water freezing points`() {
fun convertingKelvinBetweenWaterFreezingPoints() {
testAgainstTestPoint(
WATER_FREEZING.kelvin.kelvin,
WATER_FREEZING
)
}

@Test
fun `converting celsius between water freezing points`() {
fun convertingCelsiusBetweenWaterFreezingPoints() {
testAgainstTestPoint(
WATER_FREEZING.celsius.celsius,
WATER_FREEZING
)
}

@Test
fun `converting fahrenheit between water freezing points`() {
fun convertingFahrenheitBetweenWaterFreezingPoints() {
testAgainstTestPoint(
WATER_FREEZING.fahrenheit.fahrenheit,
WATER_FREEZING
)
}

@Test
fun `converting rankine between water freezing points`() {
fun convertingRankineBetweenWaterFreezingPoints() {
testAgainstTestPoint(
WATER_FREEZING.rankine.rankine,
WATER_FREEZING
)
}

@Test
fun `converting reaumur between water freezing points`() {
fun convertingReaumurBetweenWaterFreezingPoints() {
testAgainstTestPoint(
WATER_FREEZING.reaumur.reaumur,
WATER_FREEZING
)
}

@Test
fun `converting kelvin between water boiling points`() {
fun convertingKelvinBetweenWaterBoilingPoints() {
testAgainstTestPoint(
WATER_BOILING.kelvin.kelvin,
WATER_BOILING
)
}

@Test
fun `converting celsius between water boiling points`() {
fun convertingCelsiusBetweenWaterBoilingPoints() {
testAgainstTestPoint(
WATER_BOILING.celsius.celsius,
WATER_BOILING
)
}

@Test
fun `converting fahrenheit between water boiling points`() {
fun convertingFahrenheitBetweenWaterBoilingPoints() {
testAgainstTestPoint(
WATER_BOILING.fahrenheit.fahrenheit,
WATER_BOILING
)
}

@Test
fun `converting rankine between water boiling points`() {
fun convertingRankineBetweenWaterBoilingPoints() {
testAgainstTestPoint(
WATER_BOILING.rankine.rankine,
WATER_BOILING
)
}

@Test
fun `converting reaumur between water boiling points`() {
fun convertingReaumurBetweenWaterBoilingPoints() {
testAgainstTestPoint(
WATER_BOILING.reaumur.reaumur,
WATER_BOILING
Expand Down

0 comments on commit 13cd704

Please sign in to comment.