1- import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
2- import org.jetbrains.kotlin.gradle.targets.js.KotlinJsCompilerAttribute
31import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
42import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin
53import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
64import org.springframework.boot.gradle.tasks.bundling.BootJar
75
8- val kotlinVersion = rootProject.properties[" systemProp.kotlinVersion" ]
9- val kotlinIdeVersion: String by System .getProperties()
10- val kotlinIdeVersionSuffix: String by System .getProperties()
116val policy: String by System .getProperties()
12- val indexes: String by System .getProperties()
13- val indexesJs: String by System .getProperties()
14- val indexesWasm: String by System .getProperties()
157
168group = " com.compiler.server"
179version = " $kotlinVersion -SNAPSHOT"
1810java.sourceCompatibility = JavaVersion .VERSION_17
1911
20- val kotlinDependency: Configuration by configurations.creating {
21- isTransitive = false
22- }
23- val kotlinJsDependency: Configuration by configurations.creating {
24- isTransitive = false
25- attributes {
26- attribute(
27- KotlinPlatformType .attribute,
28- KotlinPlatformType .js
29- )
30- attribute(
31- KotlinJsCompilerAttribute .jsCompilerAttribute,
32- KotlinJsCompilerAttribute .ir
33- )
34- }
35- }
36-
37- val kotlinWasmDependency: Configuration by configurations.creating {
38- isTransitive = false
39- attributes {
40- attribute(
41- KotlinPlatformType .attribute,
42- KotlinPlatformType .wasm
43- )
44- }
45- }
46-
47- val libJSFolder = " $kotlinVersion -js"
48- val libWasmFolder = " $kotlinVersion -wasm"
49- val libJVMFolder = kotlinVersion
5012val propertyFile = " application.properties"
5113val jacksonVersionKotlinDependencyJar = " 2.14.0" // don't forget to update version in `executor.policy` file.
5214
53- val copyDependencies by tasks.creating(Copy ::class ) {
54- from(kotlinDependency)
55- into(libJVMFolder)
56- }
57- val copyJSDependencies by tasks.creating(Copy ::class ) {
58- from(kotlinJsDependency)
59- into(libJSFolder)
60- }
61-
62- val copyWasmDependencies by tasks.creating(Copy ::class ) {
63- from(kotlinWasmDependency)
64- into(libWasmFolder)
65- }
66-
6715plugins {
6816 id(" org.springframework.boot" ) version " 2.7.10"
6917 id(" io.spring.dependency-management" ) version " 1.1.3"
@@ -91,6 +39,8 @@ allprojects {
9139 maven(" https://www.myget.org/F/rd-snapshots/maven/" )
9240 maven(" https://kotlin.jetbrains.space/p/kotlin/packages/maven/kotlin-ide" )
9341 maven(" https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap" )
42+ maven(" https://maven.pkg.jetbrains.space/kotlin/p/wasm/experimental" )
43+ maven(" https://maven.pkg.jetbrains.space/public/p/compose/dev" )
9444 }
9545 afterEvaluate {
9646 dependencies {
@@ -105,22 +55,6 @@ allprojects {
10555}
10656
10757dependencies {
108- kotlinDependency(" junit:junit:4.13.2" )
109- kotlinDependency(" org.hamcrest:hamcrest:2.2" )
110- kotlinDependency(" com.fasterxml.jackson.core:jackson-databind:$jacksonVersionKotlinDependencyJar " )
111- kotlinDependency(" com.fasterxml.jackson.core:jackson-core:$jacksonVersionKotlinDependencyJar " )
112- kotlinDependency(" com.fasterxml.jackson.core:jackson-annotations:$jacksonVersionKotlinDependencyJar " )
113- // Kotlin libraries
114- kotlinDependency(" org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion " )
115- kotlinDependency(" org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion " )
116- kotlinDependency(" org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion " )
117- kotlinDependency(" org.jetbrains.kotlin:kotlin-test:$kotlinVersion " )
118- kotlinDependency(" org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.3" )
119- kotlinDependency(" org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3" )
120- kotlinJsDependency(" org.jetbrains.kotlin:kotlin-stdlib-js:$kotlinVersion " )
121- kotlinJsDependency(" org.jetbrains.kotlin:kotlin-dom-api-compat:$kotlinVersion " )
122- kotlinWasmDependency(" org.jetbrains.kotlin:kotlin-stdlib-wasm-js:$kotlinVersion " )
123-
12458 annotationProcessor(" org.springframework:spring-context-indexer" )
12559 implementation(" com.google.code.gson:gson" )
12660 implementation(" org.springframework.boot:spring-boot-starter-web" )
@@ -166,6 +100,7 @@ fun generateProperties(prefix: String = "") = """
166100 libraries.folder.jvm=${prefix + libJVMFolder}
167101 libraries.folder.js=${prefix + libJSFolder}
168102 libraries.folder.wasm=${prefix + libWasmFolder}
103+ libraries.folder.compiler-plugins=${prefix + libCompilerPluginsFolder}
169104 spring.mvc.pathmatch.matching-strategy=ant_path_matcher
170105 server.compression.enabled=true
171106 server.compression.mime-types=application/json
@@ -182,9 +117,10 @@ tasks.withType<KotlinCompile> {
182117 freeCompilerArgs = listOf (" -Xjsr305=strict" )
183118 jvmTarget = " 17"
184119 }
185- dependsOn(copyDependencies)
186- dependsOn(copyJSDependencies)
187- dependsOn(copyWasmDependencies)
120+ dependsOn(" :dependencies:copyDependencies" )
121+ dependsOn(" :dependencies:copyJSDependencies" )
122+ dependsOn(" :dependencies:copyWasmDependencies" )
123+ dependsOn(" :dependencies:copyCompilerPlugins" )
188124 dependsOn(" :executors:jar" )
189125 dependsOn(" :indexation:run" )
190126 buildPropertyFile()
@@ -208,9 +144,10 @@ val buildLambda by tasks.creating(Zip::class) {
208144 from(indexes)
209145 from(indexesJs)
210146 from(indexesWasm)
211- from(libJSFolder) { into(libJSFolder) }
212- from(libWasmFolder) { into(libWasmFolder) }
213- from(libJVMFolder) { into(libJVMFolder) }
147+ from(libJSFolder) { into(libJS) }
148+ from(libWasmFolder) { into(libWasm) }
149+ from(libJVMFolder) { into(libJVM) }
150+ from(libCompilerPluginsFolder) { into(libCompilerPlugins) }
214151 into(" lib" ) {
215152 from(configurations.compileClasspath) { exclude(" tomcat-embed-*" ) }
216153 }
0 commit comments