File tree 4 files changed +21
-14
lines changed
src/main/kotlin/com/compiler/server/compiler/components
4 files changed +21
-14
lines changed Original file line number Diff line number Diff line change 5
5
! ** /src /test /**
6
6
src /main /resources /application.properties
7
7
8
+ # compile artifacts
9
+ .kotlin /
10
+ 1.9. * /
11
+ 2. * /
12
+ indexes * .json
13
+ * .log
14
+
8
15
# ## STS ###
9
16
.apt_generated
10
17
.classpath
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin
5
5
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
6
6
import org.springframework.boot.gradle.tasks.bundling.BootJar
7
7
8
- val kotlinVersion = rootProject.properties[" systemProp.kotlinVersion" ]
8
+ val kotlinVersion = rootProject.properties[" systemProp.kotlinVersion" ] ? : throw IllegalStateException ( " kotlinVersion is not specified " )
9
9
val kotlinIdeVersion: String by System .getProperties()
10
10
val kotlinIdeVersionSuffix: String by System .getProperties()
11
11
val policy: String by System .getProperties()
Original file line number Diff line number Diff line change 1
- systemProp.kotlinVersion =1.9.23
1
+ systemProp.kotlinVersion =2.0.0-dev-9013
2
2
systemProp.kotlinIdeVersion =1.9.20-RC2-494
3
3
systemProp.kotlinIdeVersionSuffix =IJ8109.175
4
4
systemProp.policy =executor.policy
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ class KotlinToJSTranslator(
93
93
))
94
94
}
95
95
.map { (outputDir / " js" / " $moduleName .js" ).readText() }
96
- .map { it.withMainArgumentsIr(arguments, moduleName ) }
96
+ .map { it.withMainArgumentsIr(arguments) }
97
97
.map(::redirectOutput)
98
98
}
99
99
}
@@ -149,17 +149,17 @@ class KotlinToJSTranslator(
149
149
}
150
150
}
151
151
152
- private fun String.withMainArgumentsIr (arguments : List <String >, moduleName : String ): String {
153
- val postfix = """ | main([]);
154
- | return _;
155
- |}(typeof $moduleName === 'undefined' ? {} : $moduleName );
156
- | """ .trimMargin()
157
- if ( ! endsWith(postfix)) return this
158
- val objectMapper = ObjectMapper ()
159
- return this .removeSuffix(postfix) + """ | main([ ${arguments.joinToString { objectMapper.writeValueAsString(it) }} ]);
160
- | return _;
161
- |}(typeof $moduleName === 'undefined' ? {} : $moduleName );
162
- | """ .trimMargin( )
152
+ private fun String.withMainArgumentsIr (arguments : List <String >): String {
153
+ val mainIrFunction = """
154
+ | function mainWrapper() {
155
+ | main([%s] );
156
+ | }
157
+ """ .trimMargin()
158
+
159
+ return replace(
160
+ String .format(mainIrFunction, " " ),
161
+ String .format(mainIrFunction, arguments.joinToString { ObjectMapper ().writeValueAsString(it) })
162
+ )
163
163
}
164
164
165
165
data class WasmTranslationSuccessfulOutput (
You can’t perform that action at this time.
0 commit comments