Skip to content

Commit

Permalink
Use -module-name Kotlin/Native compiler argument to set custom ObjC p…
Browse files Browse the repository at this point in the history
…refix
  • Loading branch information
stoyicker committed Jun 25, 2024
1 parent 05bc885 commit 85b7c13
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 9 deletions.
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
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

0 comments on commit 85b7c13

Please sign in to comment.