1+ import org.apache.commons.lang3.SystemUtils
12import org.jetbrains.changelog.markdownToHTML
23import org.jetbrains.kotlin.gradle.dsl.JvmTarget
34import java.nio.file.Files
@@ -102,14 +103,15 @@ tasks {
102103 description = " Downloads the ContextMapper Language Server NPM package"
103104 group = LifecycleBasePlugin .BUILD_GROUP
104105 workingDir(layout.projectDirectory.dir(" lsp" ))
105- commandLine = listOf (" sh" , " -c" , " npm install" )
106+ val installCommand = " npm install"
107+ commandLine =
108+ if (SystemUtils .IS_OS_WINDOWS ) {
109+ listOf (" cmd" , " /c" , installCommand)
110+ } else {
111+ listOf (" sh" , " -c" , installCommand)
112+ }
106113 }
107114
108- /* *
109- * inspired by:
110- * - https://github.com/ContextMapper/vscode-extension/blob/master/build.gradle#L100
111- * - https://github.com/redhat-developer/intellij-quarkus/blob/main/build.gradle.kts
112- */
113115 val copyLanguageServer by registering(Copy ::class ) {
114116 description = " Extracts and copies the ContextMapper Language Server to the build directory"
115117 group = LifecycleBasePlugin .BUILD_GROUP
@@ -120,7 +122,7 @@ tasks {
120122 if (Files .isSymbolicLink(packagePath.toPath())) { // for local development
121123 packagePath.toPath().toRealPath().resolve(" cml-ls" )
122124 } else {
123- packagePath.toPath()
125+ packagePath.toPath().resolve( " cml-ls " )
124126 }
125127
126128 from(sourcePath)
0 commit comments