diff --git a/ballerina/build.gradle b/ballerina/build.gradle index ef2d2120a7..6a171b4ab7 100644 --- a/ballerina/build.gradle +++ b/ballerina/build.gradle @@ -50,6 +50,7 @@ def ballerinaLinuxDistributionZip = file("$project.buildDir/distributions/baller def ballerinaMacDistributionZip = file("$project.buildDir/distributions/ballerina-macos-${ballerinaLangVersion}.zip") def ballerinaMacArmDistributionZip = file("$project.buildDir/distributions/ballerina-macos-arm-${ballerinaLangVersion}.zip") def ballerinaWindowsDistributionZip = file("$project.buildDir/distributions/ballerina-windows-${ballerinaLangVersion}.zip") +def source = "https://api.central.ballerina.io/2.0/registry" task unpackBallerinaJre(type: Download) { group = "unpack_dependencies" @@ -80,6 +81,17 @@ task unpackDevTools(type: Copy) { } } +task downloadDocUi { + def response = new JsonSlurper().parseText(new URL(source).text) + def zipFileUrl = response.fileURL + def zipInputStream = new URL(zipFileUrl).openStream() + def outputFile = new File("${buildDir}/target/extracted-distributions/doc-ui-zip/ballerina-doc-ui.zip") + outputFile.parentFile.mkdirs() + outputFile.withOutputStream { outputStream -> + outputStream << zipInputStream + } +} + task unpackAwsLambdaBala(type: Copy) { group = "unpack_dependencies" configurations.awsLambdaBala.resolvedConfiguration.resolvedArtifacts.each { artifact -> @@ -271,8 +283,9 @@ task copyDevToolsCoverageReport(type: Copy) { into "$project.buildDir/target/extracted-distributions/jballerina-tools-zip/jballerina-tools-${ballerinaLangVersion}/lib/tools/coverage" rename("testerina-report-tools-${devToolsVersion}.zip", "report.zip") } + task copyDevToolsDocUi(type: Copy) { - from zipTree("$project.buildDir/target/extracted-distributions/ballerina-dev-tools-zip/docs/docerina-ui-${devToolsVersion}.zip") + from zipTree("$project.buildDir/target/extracted-distributions/doc-ui-zip/ballerina-doc-ui.zip") into "$project.buildDir/target/extracted-distributions/jballerina-tools-zip/jballerina-tools-${ballerinaLangVersion}/lib/tools/doc-ui" } @@ -1467,7 +1480,8 @@ task generateCache(dependsOn: ':cache-generator:build') { /* Unpack Dependencies */ unpackJballerinaTools.dependsOn unpackBallerinaJre unpackDevTools.dependsOn unpackJballerinaTools -unpackStdLibs.dependsOn unpackDevTools +downloadDocUi.dependsOn unpackDevTools +unpackStdLibs.dependsOn downloadDocUi unpackOpenAPILibs.dependsOn unpackStdLibs unpackC2cLibs.dependsOn unpackOpenAPILibs unpackC2cTooling.dependsOn unpackC2cLibs