Skip to content

Commit 29bb2cf

Browse files
committed
added basi ios compatibility
1 parent aeaa3a5 commit 29bb2cf

10 files changed

Lines changed: 97 additions & 1 deletion

File tree

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
44

5-
> Important: We recommend to upgrade to `1.2.2`.
5+
> Important: We recommend to upgrade to `1.2.2`. Version `1.2.3-SNAPSHOT` is a work in progress also to add ios targets
66
77
There was a bug in `1.0.*`, fixed since `1.1.0`, please upgrade your dependencies. Also, 1.2.* fixes incorrect
88
package naming.
@@ -324,6 +324,9 @@ one as in the sample above.
324324

325325
# Versions
326326

327+
- `1.2.3-SNAPSHOT`
328+
- more tools, also some sync tools for JVM convenience
329+
- added some support for ios targets (in progress).
327330
- `1.2.2`
328331
- `LogEntry` now could be properly and effectively serialized with `kotlinx.serialization` everywhere out of the box
329332
- Added `globalLaunch` and `globalDefer` utility functions ti simplify starting "background coroutines" in all

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ kotlin {
3232
}
3333
}
3434
}
35+
ios()
3536
val hostOs = System.getProperty("os.name")
3637
val isMingwX64 = hostOs.startsWith("Windows")
3738
val nativeTarget = when {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package net.sergeych.mp_logger
2+
3+
internal actual fun ConsoleLoggerSetup() {
4+
// no extra setup is needed
5+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package net.sergeych.mp_tools
2+
3+
/**
4+
* The platform-dependent micro mutually-excelusive exection. WARNING! It does not (yet) works on native where
5+
* multithreading is actually not supported whatever jetbrains thinks (as for march 2022). So on native platform
6+
* it hust calls the block...
7+
*/
8+
@Suppress("unused")
9+
actual fun MSyncObject(): MPSyncObject = object : MPSyncObject {
10+
override fun <T> withLock(block: () -> T): T {
11+
// TODO: implement something when its ready
12+
return block()
13+
}
14+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package net.sergeych.sprintf
2+
3+
import kotlinx.datetime.Instant
4+
5+
actual fun ConvertToInstant(t: Any): Instant {
6+
// TODO: please add ios-specific conversions here
7+
TODO("Not yet implemented")
8+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package net.sergeych.sprintf
2+
3+
actual fun LocaleSpecificMonthName(monthNumber: Int): String? {
4+
// TODO: Get current locale mpnth name somehow
5+
return null
6+
}
7+
8+
actual fun LocaleSpecificAbbreviatedMonthName(monthNumber: Int): String? {
9+
// TODO extract local month name abbreviations
10+
return null
11+
}
12+
13+
actual fun LocaleSpecificDayName(isoDayNumber: Int): String? {
14+
return null
15+
}
16+
17+
actual fun LocaleSpecificAbbreviatedDayName(isoDayNumber: Int): String? {
18+
return null
19+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package net.sergeych.mp_logger
2+
3+
internal actual fun ConsoleLoggerSetup() {
4+
// no extra setup is needed
5+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package net.sergeych.mp_tools
2+
3+
/**
4+
* The platform-dependent micro mutually-excelusive exection. WARNING! It does not (yet) works on native where
5+
* multithreading is actually not supported whatever jetbrains thinks (as for march 2022). So on native platform
6+
* it hust calls the block...
7+
*/
8+
@Suppress("unused")
9+
actual fun MSyncObject(): MPSyncObject = object : MPSyncObject {
10+
override fun <T> withLock(block: () -> T): T {
11+
// TODO: implement something when its ready
12+
return block()
13+
}
14+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package net.sergeych.sprintf
2+
3+
import kotlinx.datetime.Instant
4+
5+
actual fun ConvertToInstant(t: Any): Instant {
6+
// TODO: please add ios-specific conversions here
7+
TODO("Not yet implemented")
8+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package net.sergeych.sprintf
2+
3+
actual fun LocaleSpecificMonthName(monthNumber: Int): String? {
4+
// TODO: Get current locale mpnth name somehow
5+
return null
6+
}
7+
8+
actual fun LocaleSpecificAbbreviatedMonthName(monthNumber: Int): String? {
9+
// TODO extract local month name abbreviations
10+
return null
11+
}
12+
13+
actual fun LocaleSpecificDayName(isoDayNumber: Int): String? {
14+
return null
15+
}
16+
17+
actual fun LocaleSpecificAbbreviatedDayName(isoDayNumber: Int): String? {
18+
return null
19+
}

0 commit comments

Comments
 (0)