Skip to content

Commit

Permalink
v1.3 Support js(IR), update to kotlin 1.8.10
Browse files Browse the repository at this point in the history
  • Loading branch information
ellsworthrw committed Mar 2, 2023
1 parent 2f0fef1 commit 61661b8
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 17 deletions.
8 changes: 4 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ buildscript {
google()
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.21")
classpath("com.android.tools.build:gradle:7.3.1")
classpath("com.google.gms:google-services:4.3.14")
classpath("com.google.firebase:firebase-crashlytics-gradle:2.9.2")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10")
classpath("com.android.tools.build:gradle:7.4.2")
classpath("com.google.gms:google-services:4.3.15")
classpath("com.google.firebase:firebase-crashlytics-gradle:2.9.4")
}
}

Expand Down
8 changes: 4 additions & 4 deletions logging/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ kotlin {
iosArm64()
iosX64()
iosSimulatorArm64()
js {
js(BOTH) {
browser {
}
}
jvm {
compilations.all {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.jvmTarget = "11"
}
}

sourceSets {
val commonMain by getting {
dependencies {
implementation("co.touchlab:stately-concurrency:1.1.10")
implementation("co.touchlab:stately-concurrency:1.2.5")
}
}

Expand Down Expand Up @@ -69,7 +69,7 @@ tasks {
}

extra["artifactId"] = "kmlogging"
extra["artifactVersion"] = "1.2.1"
extra["artifactVersion"] = "1.3.0"
extra["libraryName"] = "KmLogging: Kotlin Multiplatform Logging"
extra["libraryDescription"] = "KmLogging is a high performance, extensible and easy to use logging library for Kotlin Multiplatform development"
extra["gitUrl"] = "https://github.com/LighthouseGames/KmLogging"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,22 @@ class TimingLog(private val label: String, tag: String? = null) {
}
}

fun finish() {
/**
* Report timing logs.
* If minThresholdMs is greater than 0 then only report if total time exceeds this amount
* @param minThresholdMs threshold in milliseconds
*/
fun finish(minThresholdMs: Long = 0) {
if (KmLogging.isLoggingDebug || timing.size > 1) {
KmLogging.debug(tagName, "$label: begin TimingLog")
val first = timing[0].time
var now = first
var prevDebug = first
var prev = first
val totalTime = timing.last().time - first
if (minThresholdMs > 0 && totalTime < minThresholdMs * 1_000_000) {
return
}
KmLogging.debug(tagName, "$label: begin TimingLog")
for (i in 1 until timing.size) {
val t = timing[i]
now = t.time
Expand Down Expand Up @@ -98,4 +107,4 @@ class TimingLog(private val label: String, tag: String? = null) {
str
}
}
}
}
2 changes: 1 addition & 1 deletion sample/jvmApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ kotlin {
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.jvmTarget = "11"
}


Expand Down
4 changes: 2 additions & 2 deletions sample/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ kotlin {
}
}
}
js {
js(IR) {
browser {
}
}
Expand Down Expand Up @@ -46,7 +46,7 @@ kotlin {
}

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.jvmTarget = "11"
}

android {
Expand Down
6 changes: 4 additions & 2 deletions sample/webApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ dependencies {
}

kotlin {
js {
js(IR) {
browser {
binaries.executable()
commonWebpackConfig {
cssSupport.enabled = true
cssSupport {
enabled.set(true)
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pluginManagement {
gradlePluginPortal()
}
plugins {
id("org.jetbrains.dokka") version "1.5.31"
id("org.jetbrains.dokka") version "1.7.20"
}
}

Expand Down

0 comments on commit 61661b8

Please sign in to comment.