Skip to content

Commit

Permalink
Fix processor for windows machines
Browse files Browse the repository at this point in the history
  • Loading branch information
bjsvedin committed Aug 5, 2024
1 parent 08b9c44 commit d172289
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 28 deletions.
1 change: 0 additions & 1 deletion evil.png

This file was deleted.

6 changes: 0 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
android.useAndroidX=true
org.gradle.jvmargs=-XX:MaxMetaspaceSize=512m -Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M"
kotlin.code.style=official

kspVersion=1.9.23-1.0.19
kotlinVersion=1.9.23
kotlinXSerialization=1.6.3
coroutines=1.8.0
ktorVersion=2.3.9
11 changes: 8 additions & 3 deletions gradle/serverlibs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
agp="8.2.0"
agp="8.2.2"
androidDesugaring="2.0.4"
angusMail="2.0.3"
awsVersion="2.25.24"
Expand All @@ -22,10 +22,12 @@ hierynomusSshj="0.38.0"
javaJwt="4.4.0"
kaml="0.58.0"
kbson="0.5.0"
kotlin="1.9.24"
kotlin="2.0.0"
kotlinXSerialization="1.6.3"
kotlinXDatetime="0.6.0"
kotlinHtmlJvm="0.11.0"
kotlinerCli="1.0.3"
ksp="1.9.24-1.0.20"
ksp="2.0.0-1.0.21"
ktor="2.3.9"
lambdaJavaCore="1.2.3"
lambdaJavaEvents="3.11.4"
Expand Down Expand Up @@ -87,6 +89,9 @@ kotlinReflect={module="org.jetbrains.kotlin:kotlin-reflect", version.ref="kotlin
kotlinStdLib={module="org.jetbrains.kotlin:kotlin-stdlib", version.ref="kotlin"}
kotlinTest={module="org.jetbrains.kotlin:kotlin-test-junit", version.ref="kotlin"}
kotlinerCli={module="com.lightningkite:kotliner-cli", version.ref="kotlinerCli"}
kotlinXDatetime={module="org.jetbrains.kotlinx:kotlinx-datetime", version.ref="kotlinXDatetime"}
kotlinXJson={module="org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref="kotlinXSerialization"}
kotlinXProperties={module="org.jetbrains.kotlinx:kotlinx-serialization-properties", version.ref="kotlinXSerialization"}
ksp={module="com.google.devtools.ksp:symbol-processing-api", version.ref="ksp"}
ktorCallLogging={module="io.ktor:ktor-server-call-logging", version.ref="ktor"}
ktorCioJvm={module="io.ktor:ktor-server-cio-jvm", version.ref="ktor"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,15 @@ fun processFiles(
channel.position(0)
val lastHash = channel.readInt()
if (lastHash == hash) return
val temp = Files.createTempDirectory("kspTemp").toFile()
try {
destinationFolder.deleteRecursively()
action(object : FileGenerator {
override fun file(name: String): Writer {
return temp.resolve(name).also {
return destinationFolder.resolve(name).also {
it.parentFile.mkdirs()
}.bufferedWriter()
}
})
destinationFolder.deleteRecursively()
temp.renameTo(destinationFolder)
} catch (e: Exception) {
// abandon
e.printStackTrace()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.lightningkite.lightningserver.schedule

import com.lightningkite.lightningserver.core.LightningServerDsl
import kotlin.time.Duration
import kotlinx.datetime.LocalTime
import kotlin.time.Duration

@LightningServerDsl
fun schedule(name: String, frequency: Duration, action: suspend () -> Unit): ScheduledTask {
Expand Down
7 changes: 2 additions & 5 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
rootProject.name = "lightning-server"

pluginManagement {
val kotlinVersion: String by settings
val kspVersion: String by settings

repositories {
mavenLocal()
google()
Expand All @@ -16,8 +13,8 @@ pluginManagement {
}

plugins {
kotlin("plugin.serialization") version kotlinVersion
id("com.google.devtools.ksp") version kspVersion
kotlin("plugin.serialization") version "2.0.0"
id("com.google.devtools.ksp") version "2.0.0-1.0.21"
}

dependencyResolutionManagement {
Expand Down
14 changes: 6 additions & 8 deletions shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ plugins {
`maven-publish`
}

val kotlinVersion: String by project
val kotlinXSerialization: String by project

ksp {
arg("generateFields", "true")
}
Expand Down Expand Up @@ -42,12 +39,13 @@ kotlin {
sourceSets {
val commonMain by getting {
dependencies {
api("org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinXSerialization")
api("org.jetbrains.kotlinx:kotlinx-serialization-properties:$kotlinXSerialization")
api(serverlibs.kotlinXJson)
api(serverlibs.kotlinXProperties)
api(serverlibs.kotlinXDatetime)

implementation(serverlibs.kotlinReflect)
implementation(serverlibs.kotlinStdLib)

implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
api("org.jetbrains.kotlinx:kotlinx-datetime:0.6.0-RC.2")
}
kotlin {
srcDir(file("build/generated/ksp/common/commonMain/kotlin"))
Expand Down

0 comments on commit d172289

Please sign in to comment.