In the segment.kt file generated, there are two issues:
The package is not the first line in the file (this is Android norm)
The referenced Segment SDK is missing an import statement
Issue and steps to reproduce.
Run npx typewriter
typewriter.yml
#Segment Typewriter Configuration (https://segment.com/docs/protocols/typewriter)
#Just run `npx typewriter@next` to re-generate a client with the latest versions of these events.
client:
#You can find more documentation on configuring this client in the Segment docs
#See: https://segment.com/docs/protocols/typewriter
language: kotlin
sdk: kotlin
languageOptions:
package: com.my.package
trackingPlans:
#Tracking Plan: App Rewrite - Tracking Plan
#https://api.segmentapis.com/tracking-plans/tp_****
- id: tp_****
path: com.my.package
ACTUAL Output file:
com.segment.analytics.kotlin.core.Analytics
// This client was automatically generated by Segment Typewriter. ** Do Not Edit **
// To update this file, run:
// npx typewriter
package com.my.package
import kotlinx.serialization.*
import kotlinx.serialization.json.*
import kotlinx.serialization.descriptors.*
import kotlinx.serialization.encoding.*
...
EXPECTED Output file:
package com.my.package
// This client was automatically generated by Segment Typewriter. ** Do Not Edit **
// To update this file, run:
// npx typewriter
import com.segment.analytics.kotlin.core.Analytics
import kotlinx.serialization.*
import kotlinx.serialization.json.*
import kotlinx.serialization.descriptors.*
import kotlinx.serialization.encoding.*
...
In the
segment.kt
file generated, there are two issues:Run
npx typewriter
typewriter.yml
ACTUAL Output file:
EXPECTED Output file: