-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor OS handling and enhance Downloader logging
Replaced `OperatingSystem` with `Platform` for uniform naming and simplified platform detection across the project. Enhanced the `Downloader` to use buffered file writes and added detailed debug-level logging to track progress and improve error handling. Removed unnecessary Ktor redirect plugin for streamlining configuration.
- Loading branch information
1 parent
d1f78b5
commit 2906eac
Showing
16 changed files
with
86 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ls/core/src/androidMain/kotlin/io/github/kdroidfilter/platformtools/OsProvider.android.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
package io.github.kdroidfilter.platformtools | ||
|
||
actual fun getOperatingSystem(): OperatingSystem = OperatingSystem.ANDROID | ||
actual fun getPlatform(): Platform = Platform.ANDROID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
platformtools/core/src/iosMain/kotlin/io/github/kdroidfilter/platformtools/OsProvider.ios.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
package io.github.kdroidfilter.platformtools | ||
|
||
actual fun getOperatingSystem(): OperatingSystem = OperatingSystem.IOS | ||
actual fun getPlatform(): Platform = Platform.IOS |
2 changes: 1 addition & 1 deletion
2
platformtools/core/src/jsMain/kotlin/io/github/kdroidfilter/platformtools/OsProvider.js.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
package io.github.kdroidfilter.platformtools | ||
|
||
actual fun getOperatingSystem(): OperatingSystem = OperatingSystem.JS | ||
actual fun getPlatform(): Platform = Platform.JS |
10 changes: 5 additions & 5 deletions
10
platformtools/core/src/jvmMain/kotlin/io/github/kdroidfilter/platformtools/OsProvider.jvm.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
package io.github.kdroidfilter.platformtools | ||
|
||
actual fun getOperatingSystem(): OperatingSystem { | ||
actual fun getPlatform(): Platform { | ||
val osName = System.getProperty("os.name").lowercase() | ||
return when { | ||
osName.contains("win") -> OperatingSystem.WINDOWS | ||
osName.contains("mac") -> OperatingSystem.MAC | ||
osName.contains("nix") || osName.contains("nux") || osName.contains("aix") -> OperatingSystem.LINUX | ||
else -> OperatingSystem.UNKNOWN | ||
osName.contains("win") -> Platform.WINDOWS | ||
osName.contains("mac") -> Platform.MAC | ||
osName.contains("nix") || osName.contains("nux") || osName.contains("aix") -> Platform.LINUX | ||
else -> Platform.UNKNOWN | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
.../core/src/linuxX64Main/kotlin/io/github/kdroidfilter/platformtools/OsProvider.linuxX64.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
package io.github.kdroidfilter.platformtools | ||
|
||
actual fun getOperatingSystem(): OperatingSystem = OperatingSystem.LINUX | ||
actual fun getPlatform(): Platform = Platform.LINUX |
2 changes: 1 addition & 1 deletion
2
...mtools/core/src/macosMain/kotlin/io/github/kdroidfilter/platformtools/OsProvider.macos.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
package io.github.kdroidfilter.platformtools | ||
|
||
actual fun getOperatingSystem(): OperatingSystem = OperatingSystem.MAC | ||
actual fun getPlatform(): Platform = Platform.MAC |
2 changes: 1 addition & 1 deletion
2
.../core/src/mingwX64Main/kotlin/io/github/kdroidfilter/platformtools/OsProvider.mingwX64.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
package io.github.kdroidfilter.platformtools | ||
|
||
actual fun getOperatingSystem(): OperatingSystem = OperatingSystem.WINDOWS | ||
actual fun getPlatform(): Platform = Platform.WINDOWS |
2 changes: 1 addition & 1 deletion
2
...ools/core/src/wasmJsMain/kotlin/io/github/kdroidfilter/platformtools/OsProvider.wasmJs.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
package io.github.kdroidfilter.platformtools | ||
|
||
actual fun getOperatingSystem(): OperatingSystem = OperatingSystem.WASMJS | ||
actual fun getPlatform(): Platform = Platform.WASMJS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import io.github.kdroidfilter.platformtools.getOperatingSystem | ||
import io.github.kdroidfilter.platformtools.getPlatform | ||
|
||
fun main() { | ||
println("The Operating System is " + getOperatingSystem().name.lowercase().replaceFirstChar { it.uppercase()}) | ||
println("The Operating System is " + getPlatform().name.lowercase().replaceFirstChar { it.uppercase()}) | ||
} |