From 357c9e58cf0e07d163272e08db8ca0122b43db31 Mon Sep 17 00:00:00 2001 From: Abe Pazos Date: Sat, 14 Dec 2024 10:03:33 +0100 Subject: [PATCH] Rename kotlin to sources-for-web This makes it harder to edit generated files by accident. I also changed the extension from kt to kt.txt so the files are not syntax-highlighted in the IDE. --- .gitignore | 2 +- build.gradle.kts | 3 ++- src/commonMain/kotlin/TemplateProgram.kt | 2 +- src/commonMain/kotlin/fabulousPink.kt | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 921a6ac..a06ab13 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ .gradle build .idea -src/commonMain/resources/kotlin/ +src/commonMain/resources/sources-for-web/ diff --git a/build.gradle.kts b/build.gradle.kts index 7f07098..183659e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -84,7 +84,8 @@ val embedSourcesTask by tasks.creating(Task::class) { doLast { copy { from("src/commonMain/kotlin") - into("src/commonMain/resources/kotlin/") + rename { "$it.txt" } + into("src/commonMain/resources/sources-for-web/") } println("Copied kotlin folder into resources") } diff --git a/src/commonMain/kotlin/TemplateProgram.kt b/src/commonMain/kotlin/TemplateProgram.kt index 28ddba9..5ea2291 100644 --- a/src/commonMain/kotlin/TemplateProgram.kt +++ b/src/commonMain/kotlin/TemplateProgram.kt @@ -25,6 +25,6 @@ fun main() { """$programName """ } - loadAndHighlight("kotlin/${currentProgram}.kt") + loadAndHighlight("sources-for-web/${currentProgram}.kt.txt") } external fun loadAndHighlight(url: String) diff --git a/src/commonMain/kotlin/fabulousPink.kt b/src/commonMain/kotlin/fabulousPink.kt index e69dab2..aa9f1d2 100644 --- a/src/commonMain/kotlin/fabulousPink.kt +++ b/src/commonMain/kotlin/fabulousPink.kt @@ -29,4 +29,5 @@ fun fabulousPink() = application { // Construct and draw a closed Hobby curve with the points. drawer.contour(hobbyCurve(points, true)) } - }} \ No newline at end of file + } +} \ No newline at end of file