Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use -module-name Kotlin/Native compiler argument to set custom ObjC prefix #67

Merged
merged 2 commits into from
Jun 25, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ open class KotlinMultiplatformLibraryPluginExtension @Inject constructor(
binaryOption("bundleShortVersionString", version as String)
binaryOption("bundleVersion", version as String)
isStatic = true
freeCompilerArgs += listOf("-module-name", "TNT")
xCFramework.add(this)
}
}
Expand Down
1 change: 1 addition & 0 deletions changelog/1.0.2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Migrate to Kotlin/Native's compiler -module-name to specify custom Objective-C symbol prefix.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import kotlin.time.Duration.Companion.seconds
* dispersion higher than this will be discarded.
* @param dnsResolutionTimeout The timeout for DNS lookup for addresses from [hostName].
*/
@ObjCName(name = "TNTNTPServer", swiftName = "NTPServer", exact = true)
class NTPServer(
val hostName: String,
@ObjCName(name = "queryConnectTimeoutMs")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package com.tidal.networktime

import kotlin.native.ObjCName

@ObjCName(name = "TNTNTPVersion", swiftName = "NTPVersion", exact = true)
enum class NTPVersion {
ZERO,
ONE,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package com.tidal.networktime

import kotlin.native.ObjCName

/**
* A designation of protocol families to discriminate resolved addresses on.
*/
@ObjCName(name = "TNTProtocolFamily", swiftName = "ProtocolFamily", exact = true)
enum class ProtocolFamily {
/**
* IPv4.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import kotlin.time.Duration.Companion.seconds
* packet has been received and processed. If not `null` but writing or reading fail when attempted,
* program execution will continue as if it had been `null` until the next attempt.
*/
@ObjCName(name = "TNTSNTPClient", swiftName = "SNTPClient", exact = true)
class SNTPClient(
vararg val ntpServers: NTPServer,
@ObjCName(name = "synchronizationIntervalMs")
Expand All @@ -36,7 +35,7 @@ class SNTPClient(
/**
* The calculated epoch time if it has been calculated at least once or null otherwise.
*/
@ObjCName("epochTimeMs")
@ObjCName(name = "epochTimeMs")
val epochTime by delegate::epochTime

/**
Expand Down
Loading