Skip to content

Commit 966395f

Browse files
[Ubuntu] Add kotlin (actions#3755)
1 parent 05781cc commit 966395f

File tree

6 files changed

+53
-1
lines changed

6 files changed

+53
-1
lines changed

images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ function Get-SwiftVersion {
124124
return "Swift $swiftVersion"
125125
}
126126

127+
function Get-KotlinVersion {
128+
$kotlinVersion = kotlin -version | Out-String | Take-OutputPart -Part 2
129+
return "Kotlin $kotlinVersion"
130+
}
131+
127132
function Get-JuliaVersion {
128133
$juliaVersion = julia --version | Take-OutputPart -Part 2
129134
return "Julia $juliaVersion"

images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ $runtimesList = @(
4949
(Get-Python3Version),
5050
(Get-RubyVersion),
5151
(Get-SwiftVersion),
52-
(Get-JuliaVersion)
52+
(Get-JuliaVersion),
53+
(Get-KotlinVersion)
5354
)
5455

5556
if (Test-IsUbuntu20) {
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash -e
2+
################################################################################
3+
## File: kotlin.sh
4+
## Desc: Installs Kotlin
5+
################################################################################
6+
7+
source $HELPER_SCRIPTS/install.sh
8+
9+
KOTLIN_ROOT="/usr/share"
10+
11+
URL=$(curl -s https://api.github.com/repos/JetBrains/kotlin/releases/latest | jq -r '.assets[].browser_download_url | select(contains("kotlin-compiler"))')
12+
download_with_retries $URL "/tmp"
13+
14+
unzip -qq /tmp/kotlin-compiler*.zip -d $KOTLIN_ROOT
15+
rm $KOTLIN_ROOT/kotlinc/bin/*.bat
16+
ln -sf $KOTLIN_ROOT/kotlinc/bin/* /usr/bin
17+
18+
invoke_tests "Tools" "Kotlin"

images/linux/scripts/tests/Tools.Tests.ps1

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,3 +383,29 @@ Describe "yq" {
383383
"yq -V" | Should -ReturnZeroExitCode
384384
}
385385
}
386+
387+
Describe "Kotlin" {
388+
It "kapt" {
389+
"kapt -version"| Should -ReturnZeroExitCode
390+
}
391+
392+
It "kotlin" {
393+
"kotlin -version"| Should -ReturnZeroExitCode
394+
}
395+
396+
It "kotlinc" {
397+
"kotlinc -version"| Should -ReturnZeroExitCode
398+
}
399+
400+
It "kotlinc-js" {
401+
"kotlinc-js -version"| Should -ReturnZeroExitCode
402+
}
403+
404+
It "kotlinc-jvm" {
405+
"kotlinc-jvm -version"| Should -ReturnZeroExitCode
406+
}
407+
408+
It "kotlin-dce-js" {
409+
"kotlin-dce-js -version"| Should -ReturnZeroExitCode
410+
}
411+
}

images/linux/ubuntu1804.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@
223223
"{{template_dir}}/scripts/installers/mercurial.sh",
224224
"{{template_dir}}/scripts/installers/miniconda.sh",
225225
"{{template_dir}}/scripts/installers/mono.sh",
226+
"{{template_dir}}/scripts/installers/kotlin.sh",
226227
"{{template_dir}}/scripts/installers/mysql.sh",
227228
"{{template_dir}}/scripts/installers/mssql-cmd-tools.sh",
228229
"{{template_dir}}/scripts/installers/sqlpackage.sh",

images/linux/ubuntu2004.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@
224224
"{{template_dir}}/scripts/installers/mercurial.sh",
225225
"{{template_dir}}/scripts/installers/miniconda.sh",
226226
"{{template_dir}}/scripts/installers/mono.sh",
227+
"{{template_dir}}/scripts/installers/kotlin.sh",
227228
"{{template_dir}}/scripts/installers/mysql.sh",
228229
"{{template_dir}}/scripts/installers/mssql-cmd-tools.sh",
229230
"{{template_dir}}/scripts/installers/sqlpackage.sh",

0 commit comments

Comments
 (0)