Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: build
#on: workflow_dispatch

on:
pull_request:
branches:
Expand Down
12 changes: 12 additions & 0 deletions bugsnag/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/

import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
Expand Down Expand Up @@ -38,6 +39,17 @@ kotlin {
}
}

jvm {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
}
}

js {
nodejs()
browser()
}

macosX64()
macosArm64()
iosX64()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package co.touchlab.crashkios.bugsnag

/**
* No-op implementation for targets without a Bugsnag SDK. Lets CrashKiOS be declared once in
* `commonMain` in projects that also target JS.
*/
actual class BugsnagCallsActual : BugsnagCalls {
actual override fun logMessage(message: String) {
}

actual override fun sendHandledException(throwable: Throwable) {
}

actual override fun sendFatalException(throwable: Throwable) {
}

actual override fun setCustomValue(section: String, key: String, value: Any) {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package co.touchlab.crashkios.bugsnag

/**
* No-op implementation for targets without a Bugsnag SDK. Lets CrashKiOS be declared once in
* `commonMain` in projects that also target JVM.
*/
actual class BugsnagCallsActual : BugsnagCalls {
actual override fun logMessage(message: String) {
}

actual override fun sendHandledException(throwable: Throwable) {
}

actual override fun sendFatalException(throwable: Throwable) {
}

actual override fun setCustomValue(section: String, key: String, value: Any) {
}
}
11 changes: 11 additions & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ kotlin {
}
}

jvm {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
}
}

js {
nodejs()
browser()
}

macosX64()
macosArm64()
iosX64()
Expand Down
11 changes: 11 additions & 0 deletions core/src/jsMain/kotlin/co/touchlab/crashkios/core/ThreadSafeVar.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package co.touchlab.crashkios.core

import kotlin.reflect.KProperty

actual class ThreadSafeVar<T> actual constructor(private var target: T) {
actual operator fun getValue(thisRef: Any?, property: KProperty<*>): T = target

actual operator fun setValue(thisRef: Any?, property: KProperty<*>, value: T) {
target = value
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package co.touchlab.crashkios.core

import kotlin.reflect.KProperty

actual class ThreadSafeVar<T> actual constructor(@Volatile private var target: T) {
actual operator fun getValue(thisRef: Any?, property: KProperty<*>): T = target

actual operator fun setValue(thisRef: Any?, property: KProperty<*>, value: T) {
target = value
}
}
12 changes: 12 additions & 0 deletions crashlytics/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/

import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
Expand Down Expand Up @@ -38,6 +39,17 @@ kotlin {
}
}

jvm {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
}
}

js {
nodejs()
browser()
}

macosX64()
macosArm64()
iosX64()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package co.touchlab.crashkios.crashlytics

/**
* No-op implementation for targets without a Crashlytics SDK. Lets CrashKiOS be declared once in
* `commonMain` in projects that also target JS.
*/
actual class CrashlyticsCallsActual : CrashlyticsCalls {
actual override fun logMessage(message: String) {
}

actual override fun sendHandledException(throwable: Throwable) {
}

actual override fun sendFatalException(throwable: Throwable) {
}

actual override fun setCustomValue(key: String, value: Any) {
}

actual override fun setUserId(identifier: String) {
}

actual override fun setCollectionEnabled(enabled: Boolean) {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package co.touchlab.crashkios.crashlytics

/**
* No-op implementation for targets without a Crashlytics SDK. Lets CrashKiOS be declared once in
* `commonMain` in projects that also target JVM.
*/
actual class CrashlyticsCallsActual : CrashlyticsCalls {
actual override fun logMessage(message: String) {
}

actual override fun sendHandledException(throwable: Throwable) {
}

actual override fun sendFatalException(throwable: Throwable) {
}

actual override fun setCustomValue(key: String, value: Any) {
}

actual override fun setUserId(identifier: String) {
}

actual override fun setCollectionEnabled(enabled: Boolean) {
}
}
Loading
Loading