diff --git a/ballerina/build.gradle b/ballerina/build.gradle index 719b491d8e..a2b39ee285 100644 --- a/ballerina/build.gradle +++ b/ballerina/build.gradle @@ -248,47 +248,24 @@ task copyOtherRepos(type: Copy) { } } - /* Architecture Model Generator Artifacts */ + /* Language Server Extension Artifacts */ + def generatorNames = [ + "architecture-model-generator", + "graphql-model-generator", + "flow-model-generator", + "sequence-model-generator", + "trigger-model-generator" + ] + configurations.devTools.resolvedConfiguration.resolvedArtifacts.each { artifact -> - def artifactExtractedPath = "${buildDir}/target/extracted-distributions/" + artifact.name + "-zip" - from("${artifactExtractedPath}/architecture-model-generator/libs") { - into "bre/lib/" - } - from("${artifactExtractedPath}/architecture-model-generator/ls-libs") { - into "lib/tools/lang-server/lib/" - } - } - - /* GraphQL Model Generator Artifacts */ - configurations.devTools.resolvedConfiguration.resolvedArtifacts.each { artifact -> - def artifactExtractedPath = "${buildDir}/target/extracted-distributions/" + artifact.name + "-zip" - from("${artifactExtractedPath}/graphql-model-generator/libs") { - into "bre/lib/" - } - from("${artifactExtractedPath}/graphql-model-generator/ls-libs") { - into "lib/tools/lang-server/lib/" - } - } - - /* Flow Model Generator Artifacts */ - configurations.devTools.resolvedConfiguration.resolvedArtifacts.each { artifact -> - def artifactExtractedPath = "${buildDir}/target/extracted-distributions/" + artifact.name + "-zip" - from("${artifactExtractedPath}/flow-model-generator/libs") { - into "bre/lib/" - } - from("${artifactExtractedPath}/flow-model-generator/ls-libs") { - into "lib/tools/lang-server/lib/" - } - } - - /* Sequence Model Generator Artifacts */ - configurations.devTools.resolvedConfiguration.resolvedArtifacts.each { artifact -> - def artifactExtractedPath = "${buildDir}/target/extracted-distributions/" + artifact.name + "-zip" - from("${artifactExtractedPath}/sequence-model-generator/libs") { - into "bre/lib/" - } - from("${artifactExtractedPath}/sequence-model-generator/ls-libs") { - into "lib/tools/lang-server/lib/" + def artifactExtractedPath = "${buildDir}/target/extracted-distributions/${artifact.name}-zip" + generatorNames.each { generatorName -> + from("${artifactExtractedPath}/${generatorName}/libs") { + into "bre/lib/" + } + from("${artifactExtractedPath}/${generatorName}/ls-libs") { + into "lib/tools/lang-server/lib/" + } } } }