Skip to content

Commit 081310a

Browse files
committed
v0.6.0
1 parent 3cd01ff commit 081310a

File tree

11 files changed

+52
-23
lines changed

11 files changed

+52
-23
lines changed

.idea/artifacts/crashkios_core_jvm_0_5_0.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/artifacts/crashkios_core_jvm_0_6_0.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/artifacts/crashkios_jvm_0_5_0.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/artifacts/crashkios_jvm_0_6_0.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4-
ext.kotlin_version = '1.6.0'
4+
ext.kotlin_version = '1.6.20'
55

66
repositories {
77
mavenCentral()

crashkios/src/iosMain/kotlin/co/touchlab/crashkios/CrashFunctions.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package co.touchlab.crashkios
1717

18-
import kotlin.native.concurrent.freeze
18+
import co.touchlab.crashkios.internal.maybeFreeze
1919

2020
fun setupCrashHandler(handler: CrashHandler){
2121
DefaultCrashHandler.crashHandler(handler)
@@ -27,15 +27,15 @@ fun setupDefaultUnhandledExceptionHook(){
2727
DefaultCrashHandler.handler.value.crash(t)
2828
}
2929

30-
setUnhandledExceptionHook(unhandMe.freeze())
30+
setUnhandledExceptionHook(unhandMe.maybeFreeze())
3131
}
3232

3333
fun setupUnhandledExceptionHook(handler: CrashHandler){
3434
val unhandMe: ReportUnhandledExceptionHook = { t ->
3535
handler.crash(t)
3636
}
3737

38-
setUnhandledExceptionHook(unhandMe.freeze())
38+
setUnhandledExceptionHook(unhandMe.maybeFreeze())
3939
}
4040

4141
fun <T> catchAndReport(handler: CrashHandler? = null, block:()->T):T{

crashkios/src/iosMain/kotlin/co/touchlab/crashkios/CrashHandler.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
*/
1616
package co.touchlab.crashkios
1717

18+
import co.touchlab.crashkios.internal.maybeFreeze
1819
import kotlin.native.concurrent.AtomicReference
19-
import kotlin.native.concurrent.freeze
2020

2121
open class CrashHandler {
2222
open fun crash(t: Throwable) {
@@ -43,7 +43,7 @@ object LogCrashHandler : CrashHandler() {
4343
object DefaultCrashHandler {
4444
internal val handler = AtomicReference<CrashHandler>(LogCrashHandler)
4545
fun crashHandler(h: CrashHandler) {
46-
handler.value = h.freeze()
46+
handler.value = h.maybeFreeze()
4747
}
4848

4949
fun myHandler(): CrashHandler = handler.value
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package co.touchlab.crashkios.internal
2+
3+
import kotlin.native.concurrent.freeze
4+
5+
internal inline fun <T> T.maybeFreeze(): T = if (Platform.memoryModel == MemoryModel.STRICT) {
6+
this.freeze()
7+
} else {
8+
this
9+
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kotlin.code.style=official
33

44
#kotlin.native.home=/Users/kgalligan/temp/kotlin-native-master-hold/dist
55
GROUP=co.touchlab
6-
VERSION_NAME=0.5.0
6+
VERSION_NAME=0.6.0
77

88
POM_URL=https://github.com/touchlab/CrashKios
99
POM_DESCRIPTION=Kotlin Native iOS Crash Report Library

sample/sample.podspec

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,20 @@ Pod::Spec.new do |spec|
22
spec.name = 'sample'
33
spec.version = '0.0.1'
44
spec.homepage = 'https://touchlab.co'
5-
spec.source = { :git => "Not Published", :tag => "Cocoapods/#{spec.name}/#{spec.version}" }
5+
spec.source = { :http=> ''}
66
spec.authors = ''
77
spec.license = ''
88
spec.summary = 'Test Crashes'
9-
10-
spec.vendored_frameworks = "build/cocoapods/framework/sample.framework"
11-
spec.libraries = "c++"
12-
spec.module_name = "#{spec.name}_umbrella"
13-
9+
spec.vendored_frameworks = 'build/cocoapods/framework/sample.framework'
10+
spec.libraries = 'c++'
11+
1412

15-
1613

17-
1814
spec.pod_target_xcconfig = {
1915
'KOTLIN_PROJECT_PATH' => ':sample',
2016
'PRODUCT_MODULE_NAME' => 'sample',
2117
}
22-
18+
2319
spec.script_phases = [
2420
{
2521
:name => 'Build sample',
@@ -35,11 +31,9 @@ Pod::Spec.new do |spec|
3531
"$REPO_ROOT/../gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework \
3632
-Pkotlin.native.cocoapods.platform=$PLATFORM_NAME \
3733
-Pkotlin.native.cocoapods.archs="$ARCHS" \
38-
-Pkotlin.native.cocoapods.configuration=$CONFIGURATION \
39-
-Pkotlin.native.cocoapods.cflags="$OTHER_CFLAGS" \
40-
-Pkotlin.native.cocoapods.paths.headers="$HEADER_SEARCH_PATHS" \
41-
-Pkotlin.native.cocoapods.paths.frameworks="$FRAMEWORK_SEARCH_PATHS"
34+
-Pkotlin.native.cocoapods.configuration="$CONFIGURATION"
4235
SCRIPT
4336
}
4437
]
38+
4539
end

0 commit comments

Comments
 (0)