Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions examples/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.androidApplication)
alias(libs.plugins.jetbrainsCompose)
alias(libs.plugins.compose.hot.reload)
}

configurations.all {
Expand All @@ -25,7 +24,7 @@ configurations.all {

kotlin {
wasmJs {
moduleName = "composeApp"
outputModuleName.set("composeApp")
browser {
commonWebpackConfig {
outputFileName = "composeApp.js"
Expand Down
3 changes: 1 addition & 2 deletions gallery-demo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ plugins {
alias(libs.plugins.compose.compiler)
alias(libs.plugins.serialization)
alias(libs.plugins.ksp)
alias(libs.plugins.compose.hot.reload)
}

class StorytaleCompilerPlugin : KotlinCompilerPluginSupportPlugin {
Expand Down Expand Up @@ -74,7 +73,7 @@ kotlin {
binaries.executable()
}
wasmJs {
moduleName = "gallery-demo"
outputModuleName.set("gallery-demo")
browser {
commonWebpackConfig {
outputFileName = "gallery-demo.js"
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
kotlin.code.style=official

#Gradle
org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2048M"
org.gradle.jvmargs=-Xmx8g -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx8g"

#Android
android.nonTransitiveRClass=true
Expand Down
28 changes: 13 additions & 15 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,29 @@ agp = "8.11.0"
android-targetSdk = "36"
android-compileSdk = "36"
android-minSdk = "26"
androidx-activityCompose = "1.9.3"
androidx-activityCompose = "1.12.2"
assertj = "3.27.2"
kotlinCompileTesting = "0.7.0"
kotlinCompileTesting = "0.11.0"
junitVersion = "4.13.2"
storytale = "0.0.3+dev8"

compose-plugin = "1.8.1"
compose-hot-reload = "1.0.0-beta06"
compose-navigation = "2.9.0-alpha16"
kotlinx-serialization-json = "1.7.3"
kotlin = "2.1.21"
kotlin-poet = "1.18.1"
build-time-config = "2.3.0"
code-highlights = "1.0.0"
compose-plugin = "1.10.0-rc02"
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bumping to 1.10.0 will be trivial

compose-navigation = "2.9.1"
kotlinx-serialization-json = "1.9.0"
kotlin = "2.2.21"
kotlin-poet = "2.2.0"
build-time-config = "2.3.1"
code-highlights = "1.1.0"
spotless = "7.0.2"
dokka = "1.9.10"
dokka = "2.1.0"
kotlinx-html = "0.7.3"
junit = "5.10.1"
jsoup = "1.16.1"
ktlint = "1.5.0"
composeRules = "0.4.22"
material3-icons = "1.7.3"
material3-adaptive = "1.1.0-beta01"
ksp = "2.1.20-2.0.1"
material3-adaptive = "1.2.0"
ksp = "2.2.21-2.0.4"

[libraries]
assertj-core = { module = "org.assertj:assertj-core", version.ref = "assertj" }
Expand All @@ -37,7 +36,6 @@ kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotl
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" }
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
compose-gradle-plugin = { module = "org.jetbrains.compose:compose-gradle-plugin", version.ref = "compose-plugin" }
compose-hot-reload-plugin = { module = "org.jetbrains.compose.hot-reload:hot-reload-gradle-plugin", version.ref = "compose-hot-reload" }
kotlin-compiler-embeddable = { module = "org.jetbrains.kotlin:kotlin-compiler-embeddable", version.ref = "kotlin" }
kotlin-poet = { module = "com.squareup:kotlinpoet", version.ref = "kotlin-poet" }
android-gradle-plugin = { module = "com.android.tools.build:gradle", version.ref = "agp" }
Expand All @@ -48,6 +46,7 @@ dokka-core = { module = "org.jetbrains.dokka:dokka-core", version.ref = "dokka"
dokka-base = { module = "org.jetbrains.dokka:dokka-base", version.ref = "dokka" }
dokka-test-api = { module = "org.jetbrains.dokka:dokka-test-api", version.ref = "dokka" }
dokka-base-test-utils = { module = "org.jetbrains.dokka:dokka-base-test-utils", version.ref = "dokka" }
dokka-analysisKotlinSymbols = { module = "org.jetbrains.dokka:analysis-kotlin-symbols", version.ref = "dokka" }
kotlinx-html = { module = "org.jetbrains.kotlinx:kotlinx-html-jvm", version.ref = "kotlinx-html" }
junit-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit" }
jsoup = { module = "org.jsoup:jsoup", version.ref = "jsoup" }
Expand All @@ -64,7 +63,6 @@ serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" }
compose-hot-reload = { id = "org.jetbrains.compose.hot-reload", version.ref = "compose-hot-reload" }
buildTimeConfig = { id = "dev.limebeck.build-time-config", version.ref = "build-time-config" }
storytale = { id = "org.jetbrains.compose.storytale", version.ref = "storytale" }
kotlinDsl = { id = "kotlin-dsl" }
Expand Down
16 changes: 8 additions & 8 deletions modules/compiler-plugin/src/kotlin/StorytaleLoweringExtension.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import org.jetbrains.kotlin.backend.common.IrElementTransformerVoidWithContext
import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
import org.jetbrains.kotlin.fir.backend.FirMetadataSource
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.IrStatement
import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin
import org.jetbrains.kotlin.ir.declarations.IrFile
Expand Down Expand Up @@ -55,7 +55,7 @@ private class AddCodeSnippetToStoriesLowering(context: IrPluginContext) : BodyLo
val owner = expression.symbol.owner
if (!owner.isTopLevel || owner.callableId != storyFunction) return super.visitCall(expression)

val callee = expression.getValueArgument(2)
val callee = expression.arguments[2]
val storyDescriber = when (callee) {
is IrFunctionExpression -> callee.function
else -> error("Unexpected callee: $callee")
Expand All @@ -66,9 +66,9 @@ private class AddCodeSnippetToStoriesLowering(context: IrPluginContext) : BodyLo

val storyTitle = storyDescriber.file.name.substringAfterLast("/").substringBeforeLast(".story.kt")

expression.putValueArgument(0, storyCodeSnippet.toIrConst(context.irBuiltIns.stringType))
expression.putValueArgument(1, storyTitle.toIrConst(context.irBuiltIns.stringType))
expression.putValueArgument(2, callee)
expression.arguments[0] = storyCodeSnippet.toIrConst(context.irBuiltIns.stringType)
expression.arguments[1] = storyTitle.toIrConst(context.irBuiltIns.stringType)
expression.arguments[2] = callee

return super.visitCall(expression)
}
Expand Down Expand Up @@ -160,10 +160,10 @@ private class MentionAllStoriesGettersInsideMainFunctionLowering(
override var type: IrType,
override val statements: MutableList<IrStatement>,
) : IrBlock() {
override val startOffset = UNDEFINED_OFFSET
override val endOffset = UNDEFINED_OFFSET
override var startOffset = UNDEFINED_OFFSET
override var endOffset = UNDEFINED_OFFSET
override var origin: IrStatementOrigin? = null
override var attributeOwnerId: IrAttributeContainer = this
override var attributeOwnerId: IrElement = this
}
}

Expand Down
3 changes: 2 additions & 1 deletion modules/dokka-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ dependencies {
testImplementation(libs.dokka.base)
testImplementation(libs.junit.api)
testImplementation(libs.kotlin.test)
testImplementation(libs.dokka.analysisKotlinSymbols)
}

tasks.withType<Test> {
useJUnitPlatform()
}

kotlin {
jvmToolchain(11)
jvmToolchain(21)
}

val emptyJavadocJar by tasks.registering(Jar::class) {
Expand Down
2 changes: 0 additions & 2 deletions modules/gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ gradlePlugin {
dependencies {
implementation(libs.kotlin.gradle.plugin)
implementation(libs.android.gradle.plugin)
implementation(libs.kotlin.compiler.embeddable)
implementation(libs.compose.gradle.plugin)
implementation(libs.compose.hot.reload.plugin)
implementation(libs.kotlin.poet)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import org.gradle.api.tasks.CacheableTask
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.TaskAction
import org.jetbrains.kotlin.incremental.createDirectory

@CacheableTask
open class JsSourceGeneratorTask : DefaultTask() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,19 @@ fun Project.execute(vararg args: String): String = ByteArrayOutputStream().apply
standardOutput = this@apply
}
}.toString()

@Suppress("SpellCheckingInspection")
fun File.createDirectory() {
when {
isDirectory -> Unit
isFile -> error("A regular file already exists at this path: $path")
else -> {
// Note that `mkdirs()` returns `false` if the directory already exists (even though we have checked that the directory did not
// exist earlier, it might just have been created by some other thread). Therefore, we need to check if the directory exists
// again when `mkdirs()` returns `false`.
if (!mkdirs() && !isDirectory) {
throw IOException("Could not create directory '$path'")
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import org.gradle.api.tasks.CacheableTask
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.TaskAction
import org.jetbrains.kotlin.incremental.createDirectory

@CacheableTask
open class WasmSourceGeneratorTask : DefaultTask() {
Expand Down