Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Vampire committed Oct 23, 2024
1 parent f6d56c4 commit 83af96d
Show file tree
Hide file tree
Showing 13 changed files with 1,163 additions and 307 deletions.
1 change: 1 addition & 0 deletions gradle/build-logic/build-logic.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ plugins {

dependencies {
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
implementation(files(kotlinWrappers.javaClass.superclass.protectionDomain.codeSource.location))
implementation(plugin(libs.plugins.versions))
implementation(plugin(libs.plugins.dependency.analysis))
implementation(plugin(libs.plugins.release))
Expand Down
6 changes: 5 additions & 1 deletion gradle/build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,13 @@ dependencyResolutionManagement {
repositoriesMode.set(FAIL_ON_PROJECT_REPOS)

versionCatalogs {
create("libs") {
val libs by registering {
from(files("../libs.versions.toml"))
}

val kotlinWrappers by registering {
from("org.jetbrains.kotlin-wrappers:kotlin-wrappers-catalog:0.0.1-pre.819")
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

package net.kautler

import net.kautler.util.npm
import org.gradle.accessors.dm.LibrariesForLibs
import org.gradle.accessors.dm.LibrariesForKotlinWrappers
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsExec
import org.jetbrains.kotlin.gradle.tasks.IncrementalSyncTask

Expand All @@ -26,10 +26,11 @@ plugins {
}

val libs = the<LibrariesForLibs>()
val kotlinWrappers = the<LibrariesForKotlinWrappers>()

kotlin {
js {
useCommonJs()
useEsModules()
binaries.executable()
nodejs()
}
Expand All @@ -38,10 +39,9 @@ kotlin {
jsMain {
dependencies {
implementation(libs.kotlinx.coroutines.core)
implementation(dependencies.platform(libs.kotlin.wrappers.bom))
implementation(libs.kotlin.wrapper.js)
implementation(libs.kotlin.wrapper.node)
implementation(npm(libs.build.vercel.ncc))
implementation(kotlinWrappers.js)
implementation(kotlinWrappers.node)
implementation(kotlinWrappers.vercel.ncc)
}
}
}
Expand Down
17 changes: 12 additions & 5 deletions gradle/build-logic/src/main/kotlin/net/kautler/node.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package net.kautler
import net.kautler.dao.action.GitHubAction
import net.kautler.util.npm
import org.gradle.accessors.dm.LibrariesForLibs
import org.gradle.accessors.dm.LibrariesForKotlinWrappers
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsExec
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.tasks.IncrementalSyncTask
Expand All @@ -29,9 +30,11 @@ plugins {
}

val libs = the<LibrariesForLibs>()
val kotlinWrappers = the<LibrariesForKotlinWrappers>()

kotlin {
js {
// part of work-around for https://youtrack.jetbrains.com/issue/KTOR-6158
useCommonJs()
binaries.executable()
nodejs()
Expand All @@ -41,11 +44,14 @@ kotlin {
jsMain {
dependencies {
implementation(libs.kotlinx.coroutines.core)
implementation(dependencies.platform(libs.kotlin.wrappers.bom))
implementation(libs.kotlin.wrapper.actions.toolkit)
implementation(libs.kotlin.wrapper.js)
implementation(libs.kotlin.wrapper.node)
implementation(npm(libs.semver))
implementation(libs.ktor.client.core)
implementation(libs.ktor.client.js)
implementation(kotlinWrappers.actions.toolkit)
implementation(kotlinWrappers.js)
implementation(kotlinWrappers.node)
implementation(kotlinWrappers.semver)
implementation(kotlinWrappers.nullWritable)
// part of work-around for https://youtrack.jetbrains.com/issue/KTOR-6158
implementation(npm(libs.nullWritable))
}
}
Expand Down Expand Up @@ -109,6 +115,7 @@ artifacts {
it
.destinationDirectory
.get()
// part of work-around for https://youtrack.jetbrains.com/issue/KTOR-6158
.resolve("${project.name}.js")
}
)
Expand Down
12 changes: 3 additions & 9 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@ build-inject = "1"
build-kotlinx-serialization = "1.5.0"
build-node = "20.11.0"
build-snakeyaml = "2.0"
build-vercel-ncc = "0.36.1"
kotlin = "2.0.20"
kotlin-wrappers = "1.0.0-pre.529"
kotlinx-coroutines = "1.6.4"
ktor = "3.0.0"
nullWritable = "1.0.5"
semver = "7.3.8"
workflows-kotlin = "2.0.20"

[libraries]
Expand All @@ -39,14 +37,10 @@ build-kotlinx-serialization-bom = { module = "org.jetbrains.kotlinx:kotlinx-seri
build-kotlinx-serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core" }
build-kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json" }
build-snakeyaml = { module = "org.yaml:snakeyaml", version.ref = "build-snakeyaml" }
build-vercel-ncc = { module = "vercel:ncc", version.ref = "build-vercel-ncc" }
kotlin-wrapper-actions-toolkit = { module = "org.jetbrains.kotlin-wrappers:kotlin-actions-toolkit" }
kotlin-wrapper-js = { module = "org.jetbrains.kotlin-wrappers:kotlin-js" }
kotlin-wrapper-node = { module = "org.jetbrains.kotlin-wrappers:kotlin-node" }
kotlin-wrappers-bom = { module = "org.jetbrains.kotlin-wrappers:kotlin-wrappers-bom", version.ref = "kotlin-wrappers" }
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
ktor-client-js = { module = "io.ktor:ktor-client-js", version.ref = "ktor" }
nullWritable = { module = "<unscoped>:null-writable", version.ref = "nullWritable" }
semver = { module = "<unscoped>:semver", version.ref = "semver" }
workflows-kotlin-compiler = { module = "org.jetbrains.kotlin:kotlin-compiler", version.ref = "workflows-kotlin" }
workflows-kotlin-main-kts = { module = "org.jetbrains.kotlin:kotlin-main-kts", version.ref = "workflows-kotlin" }
workflows-kotlin-scripting-compiler = { module = "org.jetbrains.kotlin:kotlin-scripting-compiler", version.ref = "workflows-kotlin" }
Expand Down
Loading

0 comments on commit 83af96d

Please sign in to comment.