mirror of
https://github.com/GayPizzaSpecifications/dough.git
synced 2025-08-05 14:31:32 +00:00
Pizza Samples
This commit is contained in:
20
samples/current-time/build.gradle.kts
Normal file
20
samples/current-time/build.gradle.kts
Normal file
@ -0,0 +1,20 @@
|
||||
plugins {
|
||||
dough_sample
|
||||
}
|
||||
|
||||
kotlin {
|
||||
js(IR) {
|
||||
nodejs()
|
||||
browser()
|
||||
|
||||
binaries.executable()
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
commonMain {
|
||||
dependencies {
|
||||
implementation(project(":dough-core"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
5
samples/current-time/src/commonMain/kotlin/main.kt
Normal file
5
samples/current-time/src/commonMain/kotlin/main.kt
Normal file
@ -0,0 +1,5 @@
|
||||
import gay.pizza.dough.core.PlatformClock
|
||||
|
||||
fun main() {
|
||||
println(PlatformClock.now().millisecondsSinceEpoch)
|
||||
}
|
13
samples/fs-walk/build.gradle.kts
Normal file
13
samples/fs-walk/build.gradle.kts
Normal file
@ -0,0 +1,13 @@
|
||||
plugins {
|
||||
dough_sample
|
||||
}
|
||||
|
||||
kotlin {
|
||||
sourceSets {
|
||||
commonMain {
|
||||
dependencies {
|
||||
implementation(project(":dough-fs"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
10
samples/fs-walk/src/commonMain/kotlin/main.kt
Normal file
10
samples/fs-walk/src/commonMain/kotlin/main.kt
Normal file
@ -0,0 +1,10 @@
|
||||
import gay.pizza.dough.fs.PlatformFsProvider
|
||||
import gay.pizza.dough.fs.walk
|
||||
|
||||
fun main() {
|
||||
val currentWorkingDirectory = PlatformFsProvider.currentWorkingDirectory
|
||||
for (item in currentWorkingDirectory.walk()) {
|
||||
val relative = item.relativeTo(currentWorkingDirectory)
|
||||
println(relative.fullPathString)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user