Skip to content
This repository has been archived by the owner on Nov 25, 2022. It is now read-only.

Commit

Permalink
Removed napier from library
Browse files Browse the repository at this point in the history
  • Loading branch information
Reedyuk committed Aug 2, 2022
1 parent 140d1e2 commit 12a0c8c
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 58 deletions.
5 changes: 1 addition & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugins {
}

group = "com.myunidays"
version = "0.0.5"
version = "0.0.6"

val frameworkName = "segmenkt"
val ktor_version = "1.6.6"
Expand Down Expand Up @@ -59,9 +59,6 @@ kotlin {

sourceSets {
val commonMain by getting {
dependencies {
implementation("io.github.aakira:napier:$napier_version")
}
}
val commonTest by getting {
dependencies {
Expand Down
2 changes: 1 addition & 1 deletion segmenkt.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'segmenkt'
spec.version = '0.0.4'
spec.version = '0.0.6'
spec.homepage = 'Link to a Kotlin/Native module homepage'
spec.source = { :http=> ''}
spec.authors = ''
Expand Down
15 changes: 5 additions & 10 deletions src/androidMain/kotlin/com/myunidays/segmenkt/Analytics.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ actual class Analytics internal constructor(val android: com.segment.analytics.A
Analytics(com.segment.analytics.Analytics.with(context as? Context))
}

init {
Log()
}

actual fun alias(userId: String, options: Map<Any?, *>?) =
android.alias(
userId,
Expand All @@ -38,7 +34,7 @@ actual class Analytics internal constructor(val android: com.segment.analytics.A
(property.key as? String)?.let { putContext(it, property.value) }
}
}
).also { Log.d("Segment: Alias $userId $options") }
)

actual fun track(name: String, properties: Map<Any?, *>?, options: Map<Any?, *>?) =
android.track(
Expand All @@ -53,7 +49,7 @@ actual class Analytics internal constructor(val android: com.segment.analytics.A
(property.key as? String)?.let { putContext(it, property.value) }
}
}
).also { Log.d("Segment: Track $name: $properties $options") }
)

actual fun identify(userId: String, traits: Map<Any?, *>?, options: Map<Any?, *>?) =
android.identify(
Expand All @@ -68,7 +64,7 @@ actual class Analytics internal constructor(val android: com.segment.analytics.A
(property.key as? String)?.let { putContext(it, property.value) }
}
}
).also { Log.d("Segment: Identify $userId: $traits $options") }
)

actual fun screen(
screenTitle: String,
Expand All @@ -87,7 +83,7 @@ actual class Analytics internal constructor(val android: com.segment.analytics.A
(property.key as? String)?.let { putContext(it, property.value) }
}
}
).also { Log.d("Segment: Screen $screenTitle: $properties $options") }
)

actual fun group(groupId: String, traits: Map<Any?, *>?, options: Map<Any?, *>?) =
android.group(
Expand All @@ -102,10 +98,9 @@ actual class Analytics internal constructor(val android: com.segment.analytics.A
(property.key as? String)?.let { putContext(it, property.value) }
}
}
).also { Log.d("Segment: Group $groupId: $traits") }
)

actual fun reset() {
android.reset()
.also { Log.d("Segment: Reset") }
}
}
22 changes: 0 additions & 22 deletions src/commonMain/kotlin/com.myunidays.segmenkt/Log.kt

This file was deleted.

11 changes: 1 addition & 10 deletions src/iosMain/kotlin/com.myunidays.segmenkt/Analytics.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,21 @@ actual class Analytics internal constructor(val ios: cocoapods.Analytics.SEGAnal
Analytics(cocoapods.Analytics.SEGAnalytics.sharedAnalytics())
}

init {
Log()
}

actual fun alias(userId: String, options: Map<Any?, *>?) = ios.alias(userId, options?.let { mapOf("context" to it) })
.also { Log.d("Segment: Alias $userId: $options") }

actual fun track(name: String, properties: Map<Any?, *>?, options: Map<Any?, *>?) = ios.track(name, properties, options?.let { mapOf("context" to it) })
.also { Log.d("Segment: Track $name: $properties $options") }

actual fun identify(userId: String, traits: Map<Any?, *>?, options: Map<Any?, *>?) = ios.identify(userId, traits, options?.let { mapOf("context" to it) })
.also { Log.d("Segment: Identify $userId: $traits $options") }

actual fun screen(
screenTitle: String,
properties: Map<Any?, *>?,
options: Map<Any?, *>?
) = ios.screen(screenTitle, properties, options?.let { mapOf("context" to it) })
.also { Log.d("Segment: Screen $screenTitle: $properties $options") }

actual fun group(groupId: String, traits: Map<Any?, *>?, options: Map<Any?, *>?) = ios.group(groupId, traits, options?.let { mapOf("context" to it) })
.also { Log.d("Segment: Group $groupId: $traits $options") }

actual fun reset() {
ios.reset().also { Log.d("Segment: Reset") }
ios.reset()
}
}
11 changes: 0 additions & 11 deletions src/jsMain/kotlin/com/myunidays/segmenkt/Analytics.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,31 @@ package com.myunidays.segmenkt
actual class Analytics {
actual companion object {
actual fun setupWithConfiguration(configuration: Configuration): Analytics {
Log.d("JS Todo")
return shared(null)
}

actual fun shared(context: Any?): Analytics = Analytics()
}

init {
Log()
}

actual fun alias(userId: String, options: Map<Any?, *>?) {
Log.d("JS Todo")
}

actual fun track(name: String, properties: Map<Any?, *>?, options: Map<Any?, *>?) {
Log.d("JS Todo")
}

actual fun identify(userId: String, traits: Map<Any?, *>?, options: Map<Any?, *>?) {
Log.d("JS Todo")
}

actual fun screen(
screenTitle: String,
properties: Map<Any?, *>?,
options: Map<Any?, *>?
) {
Log.d("JS Todo")
}

actual fun group(groupId: String, traits: Map<Any?, *>?, options: Map<Any?, *>?) {
Log.d("JS Todo")
}

actual fun reset() {
Log.d("JS Todo")
}
}

0 comments on commit 12a0c8c

Please sign in to comment.