[Windows] Rework Kotlin installation (#4083)

This commit is contained in:
Dibir Magomedsaygitov
2021-09-16 11:35:11 +03:00
committed by GitHub
parent db5e4084fe
commit ecfc9c43da
9 changed files with 32 additions and 14 deletions

View File

@@ -0,0 +1,18 @@
################################################################################
## File: Install-Kotlin.ps1
## Desc: Install Kotlin
################################################################################
# Install Kotlin
$url = "https://api.github.com/repos/JetBrains/kotlin/releases/latest"
[System.String] $kotlinLatest = (Invoke-RestMethod -Uri $url).assets.browser_download_url -match "kotlin-compiler"
$kotlinInstallerPath = Start-DownloadWithRetry -Url $kotlinLatest -Name "kotlin-compiler.zip"
Write-Host "Expand Kotlin archive"
$kotlinPath = "C:\tools"
Extract-7Zip -Path $kotlinInstallerPath -DestinationPath $kotlinPath
# Add to PATH
Add-MachinePathItem "$kotlinPath\kotlinc\bin"
Invoke-PesterTests -TestFile "Tools" -TestName "Kotlin"