-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
61 lines (54 loc) · 1.78 KB
/
build.gradle.kts
File metadata and controls
61 lines (54 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
plugins {
kotlin("multiplatform") version "1.7.20"
id("com.google.devtools.ksp") version "1.7.20-1.0.6"
}
repositories {
mavenCentral()
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
}
val fritz2Version = "1.0-RC5"
kotlin {
jvm {
withJava()
}
js(IR) {
browser()
}.binaries.executable()
sourceSets {
val commonMain by getting {
dependencies {
implementation("dev.fritz2:core:$fritz2Version")
}
}
val jvmMain by getting {
dependencies {
implementation("org.commonmark:commonmark:0.21.0")
}
}
val jsMain by getting {
dependencies {
implementation(npm("marked", "9.1.6"))
}
}
}
}
val generateBlogPages by tasks.registering(JavaExec::class) {
group = "build"
description = "Generate static HTML pages for blog posts (SSG)"
val jvmCompilation = kotlin.targets.getByName("jvm").compilations.getByName("main")
classpath = jvmCompilation.output.allOutputs + jvmCompilation.compileDependencyFiles
mainClass.set("codes.miley.generator.BlogGeneratorKt")
val jsDistDir = layout.buildDirectory.dir("dist/js/productionExecutable")
args = listOf(jsDistDir.get().asFile.absolutePath)
dependsOn("jvmJar")
}
tasks.named("jsBrowserProductionWebpack") {
finalizedBy(generateBlogPages)
}
dependencies {
add("kspCommonMainMetadata", "dev.fritz2:lenses-annotation-processor:$fritz2Version")
}
kotlin.sourceSets.commonMain { kotlin.srcDir("build/generated/ksp/metadata/commonMain/kotlin") }
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>>().all {
if (name != "kspCommonMainKotlinMetadata") dependsOn("kspCommonMainKotlinMetadata")
}