-
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.
Move NodeJsFileSystem into its own module (#913)
This removes SYSTEM as a statically-available FileSystem instance on the JS platform, and converts FileSystem into an expect class.
- Loading branch information
1 parent
57cf11c
commit 039d996
Showing
20 changed files
with
454 additions
and
107 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
if (!kmpJsEnabled) { | ||
return // This module is JS-only; do nothing if JS is off. | ||
} | ||
|
||
apply plugin: 'org.jetbrains.kotlin.multiplatform' | ||
|
||
kotlin { | ||
js { | ||
configure([compilations.main, compilations.test]) { | ||
tasks.getByName(compileKotlinTaskName).kotlinOptions { | ||
moduleKind = "umd" | ||
sourceMap = true | ||
metaInfo = true | ||
} | ||
} | ||
nodejs { | ||
testTask { | ||
useMocha { | ||
timeout = "30s" | ||
} | ||
} | ||
} | ||
} | ||
sourceSets { | ||
all { | ||
languageSettings { | ||
useExperimentalAnnotation('kotlin.RequiresOptIn') | ||
} | ||
} | ||
jsMain { | ||
dependencies { | ||
implementation project(":okio") | ||
api deps.kotlin.stdLib.common | ||
// Uncomment this to generate fs.fs.module_node.kt. Use it when updating fs.kt. | ||
// implementation(npm("@types/node", "14.14.16", true)) | ||
api deps.kotlin.stdLib.js | ||
} | ||
} | ||
jsTest { | ||
dependencies { | ||
implementation deps.kotlin.test.common | ||
implementation deps.kotlin.test.annotations | ||
implementation deps.kotlin.time | ||
|
||
implementation project(":okio-fakefilesystem") | ||
implementation deps.kotlin.test.js | ||
} | ||
} | ||
} | ||
} | ||
|
||
apply from: "$rootDir/gradle/gradle-mvn-mpp-push.gradle" |
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,2 @@ | ||
POM_ARTIFACT_ID=okio-nodefilesystem | ||
POM_NAME=Okio Fake Node.js System |
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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,24 @@ | ||
/* | ||
* Copyright (C) 2020 Square, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/** | ||
* See `fs.kt` for information on what this file does and how to keep it up-to-date. | ||
*/ | ||
@file:JsModule("os") | ||
@file:JsNonModule | ||
package okio | ||
|
||
internal external fun tmpdir(): String |
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
Oops, something went wrong.