2021-07-22 11:31:30 +03:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
################################################################################
|
2023-11-22 21:49:23 +01:00
|
|
|
## File: install-kotlin.sh
|
|
|
|
|
## Desc: Install Kotlin
|
2023-10-23 14:36:13 +02:00
|
|
|
## Supply chain security: Kotlin - checksum validation
|
2021-07-22 11:31:30 +03:00
|
|
|
################################################################################
|
|
|
|
|
|
2023-12-29 12:36:27 +01:00
|
|
|
# Source the helpers for use with the script
|
2021-07-22 11:31:30 +03:00
|
|
|
source $HELPER_SCRIPTS/install.sh
|
|
|
|
|
|
|
|
|
|
KOTLIN_ROOT="/usr/share"
|
2025-03-21 20:03:57 +05:30
|
|
|
download_url=$(resolve_github_release_asset_url "JetBrains/kotlin" "contains(\"kotlin-compiler\") and endswith(\".zip\")" "2.1.10")
|
2023-11-29 20:25:29 +01:00
|
|
|
archive_path=$(download_with_retry "$download_url")
|
2021-07-22 11:31:30 +03:00
|
|
|
|
2023-10-23 14:36:13 +02:00
|
|
|
# Supply chain security - Kotlin
|
2024-03-07 21:01:25 +01:00
|
|
|
kotlin_hash_file=$(download_with_retry "${download_url}.sha256")
|
|
|
|
|
kotlin_hash=$(cat "$kotlin_hash_file")
|
2023-11-29 20:25:29 +01:00
|
|
|
use_checksum_comparison "$archive_path" "$kotlin_hash"
|
2023-10-23 14:36:13 +02:00
|
|
|
|
2023-11-29 20:25:29 +01:00
|
|
|
unzip -qq "$archive_path" -d $KOTLIN_ROOT
|
2021-07-22 11:31:30 +03:00
|
|
|
rm $KOTLIN_ROOT/kotlinc/bin/*.bat
|
|
|
|
|
ln -sf $KOTLIN_ROOT/kotlinc/bin/* /usr/bin
|
|
|
|
|
|
2023-10-23 14:36:13 +02:00
|
|
|
invoke_tests "Tools" "Kotlin"
|