Skip to content

Commit

Permalink
Update api doc-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
khadijahazward committed Apr 2, 2024
1 parent 8b2d472 commit 4eeb072
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions ballerina/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 ->
Expand Down Expand Up @@ -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"
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4eeb072

Please sign in to comment.