-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create FileSystem.SYSTEM property in shared source set (#1455)
* Create FileSystem.SYSTEM property in shared source set Co-authored-by: Sebastian Sellmair <sebastian.sellmair@jetbrains.com> * Only configure native platforms in samples if kmpNativeEnabled is set * Use FileSystem.SYSTEM in existing tests, remove new multiplatform samples --------- Co-authored-by: Sebastian Sellmair <sebastian.sellmair@jetbrains.com>
- Loading branch information
Showing
10 changed files
with
43 additions
and
24 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
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
18 changes: 0 additions & 18 deletions
18
okio-testing-support/src/zlibMain/kotlin/okio/TestingZlib.kt
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@file:JvmName("SystemFileSystem") | ||
|
||
package okio | ||
|
||
/* | ||
* JVM and native platforms do offer a [SYSTEM] [FileSystem], however we cannot refine an 'expect' companion object. | ||
* Therefore an extension property is provided, which on respective platforms (here JVM) will be shadowed by the | ||
* original implementation. | ||
*/ | ||
@Suppress("EXTENSION_SHADOWED_BY_MEMBER") | ||
actual inline val FileSystem.Companion.SYSTEM: FileSystem | ||
@JvmSynthetic | ||
get() = SYSTEM |
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
7 changes: 7 additions & 0 deletions
7
okio/src/systemFileSystemMain/kotlin/okio/FileSystem.System.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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package okio | ||
|
||
/* | ||
* The current process's host file system. Use this instance directly, or dependency inject a | ||
* [FileSystem] to make code testable. | ||
*/ | ||
expect val FileSystem.Companion.SYSTEM: FileSystem |
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