diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 index 48c10986e..324032a5b 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 @@ -124,6 +124,11 @@ function Get-SwiftVersion { return "Swift $swiftVersion" } +function Get-KotlinVersion { + $kotlinVersion = kotlin -version | Out-String | Take-OutputPart -Part 2 + return "Kotlin $kotlinVersion" +} + function Get-JuliaVersion { $juliaVersion = julia --version | Take-OutputPart -Part 2 return "Julia $juliaVersion" diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index 34dd7d111..8595d0b2a 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -49,7 +49,8 @@ $runtimesList = @( (Get-Python3Version), (Get-RubyVersion), (Get-SwiftVersion), - (Get-JuliaVersion) + (Get-JuliaVersion), + (Get-KotlinVersion) ) if (Test-IsUbuntu20) { diff --git a/images/linux/scripts/installers/kotlin.sh b/images/linux/scripts/installers/kotlin.sh new file mode 100644 index 000000000..4a34f8749 --- /dev/null +++ b/images/linux/scripts/installers/kotlin.sh @@ -0,0 +1,18 @@ +#!/bin/bash -e +################################################################################ +## File: kotlin.sh +## Desc: Installs Kotlin +################################################################################ + +source $HELPER_SCRIPTS/install.sh + +KOTLIN_ROOT="/usr/share" + +URL=$(curl -s https://api.github.com/repos/JetBrains/kotlin/releases/latest | jq -r '.assets[].browser_download_url | select(contains("kotlin-compiler"))') +download_with_retries $URL "/tmp" + +unzip -qq /tmp/kotlin-compiler*.zip -d $KOTLIN_ROOT +rm $KOTLIN_ROOT/kotlinc/bin/*.bat +ln -sf $KOTLIN_ROOT/kotlinc/bin/* /usr/bin + +invoke_tests "Tools" "Kotlin" \ No newline at end of file diff --git a/images/linux/scripts/tests/Tools.Tests.ps1 b/images/linux/scripts/tests/Tools.Tests.ps1 index d3b0cfbf5..fb0e81657 100644 --- a/images/linux/scripts/tests/Tools.Tests.ps1 +++ b/images/linux/scripts/tests/Tools.Tests.ps1 @@ -383,3 +383,29 @@ Describe "yq" { "yq -V" | Should -ReturnZeroExitCode } } + +Describe "Kotlin" { + It "kapt" { + "kapt -version"| Should -ReturnZeroExitCode + } + + It "kotlin" { + "kotlin -version"| Should -ReturnZeroExitCode + } + + It "kotlinc" { + "kotlinc -version"| Should -ReturnZeroExitCode + } + + It "kotlinc-js" { + "kotlinc-js -version"| Should -ReturnZeroExitCode + } + + It "kotlinc-jvm" { + "kotlinc-jvm -version"| Should -ReturnZeroExitCode + } + + It "kotlin-dce-js" { + "kotlin-dce-js -version"| Should -ReturnZeroExitCode + } +} diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index 6841b6180..569e40857 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -223,6 +223,7 @@ "{{template_dir}}/scripts/installers/mercurial.sh", "{{template_dir}}/scripts/installers/miniconda.sh", "{{template_dir}}/scripts/installers/mono.sh", + "{{template_dir}}/scripts/installers/kotlin.sh", "{{template_dir}}/scripts/installers/mysql.sh", "{{template_dir}}/scripts/installers/mssql-cmd-tools.sh", "{{template_dir}}/scripts/installers/sqlpackage.sh", diff --git a/images/linux/ubuntu2004.json b/images/linux/ubuntu2004.json index 5cc79cce4..5999e6a33 100644 --- a/images/linux/ubuntu2004.json +++ b/images/linux/ubuntu2004.json @@ -224,6 +224,7 @@ "{{template_dir}}/scripts/installers/mercurial.sh", "{{template_dir}}/scripts/installers/miniconda.sh", "{{template_dir}}/scripts/installers/mono.sh", + "{{template_dir}}/scripts/installers/kotlin.sh", "{{template_dir}}/scripts/installers/mysql.sh", "{{template_dir}}/scripts/installers/mssql-cmd-tools.sh", "{{template_dir}}/scripts/installers/sqlpackage.sh",