2019-12-23 15:35:43 +03:00
|
|
|
# Tizen has issues on DevOps:
|
|
|
|
# - https://developer.tizen.org/forums/sdk-ide/cli-installer-v3.3-failing-on-azure-devops
|
|
|
|
# - https://developercommunity.visualstudio.com/content/problem/661596/the-updated-path-doesnt-kick-in.html
|
|
|
|
|
2019-02-09 21:23:09 +03:00
|
|
|
Param(
|
2020-12-26 01:42:28 +03:00
|
|
|
[string] $Version = "4.1",
|
|
|
|
[string] $InstallDestination = $null,
|
|
|
|
[boolean] $UpgradeLLVM = $true
|
2019-02-09 21:23:09 +03:00
|
|
|
)
|
|
|
|
|
2019-05-24 08:14:37 +03:00
|
|
|
$ErrorActionPreference = 'Stop'
|
2019-02-05 06:22:35 +03:00
|
|
|
|
2020-07-07 20:15:40 +03:00
|
|
|
$HOME_DIR = if ($env:HOME) { $env:HOME } else { $env:USERPROFILE }
|
|
|
|
|
2019-02-09 21:23:09 +03:00
|
|
|
if ($IsMacOS) {
|
|
|
|
$platform = "macos-64"
|
|
|
|
$ext = "bin"
|
|
|
|
} elseif ($IsLinux) {
|
|
|
|
$platform = "ubuntu-64"
|
|
|
|
$ext = "bin"
|
|
|
|
} else {
|
|
|
|
$platform = "windows-64"
|
|
|
|
$ext = "exe"
|
|
|
|
}
|
|
|
|
|
2019-07-26 16:05:54 +03:00
|
|
|
$url = "http://download.tizen.org/sdk/Installer/tizen-studio_${Version}/web-cli_Tizen_Studio_${Version}_${platform}.${ext}"
|
|
|
|
|
2020-07-07 20:15:40 +03:00
|
|
|
$ts = Join-Path "$HOME_DIR" "tizen-studio"
|
2019-07-26 16:05:54 +03:00
|
|
|
if ($InstallDestination) {
|
|
|
|
$ts = $InstallDestination
|
|
|
|
}
|
|
|
|
Write-Host "Install destination is '$ts'..."
|
|
|
|
|
2020-07-07 20:15:40 +03:00
|
|
|
$tsTemp = Join-Path "$HOME_DIR" "tizen-temp"
|
2019-05-01 03:19:56 +03:00
|
|
|
$install = Join-Path "$tsTemp" "tizen-install.$ext"
|
2020-12-26 01:42:28 +03:00
|
|
|
$packages = "MOBILE-4.0,MOBILE-4.0-NativeAppDevelopment,MOBILE-6.0,MOBILE-6.0-NativeAppDevelopment"
|
2019-02-05 06:22:35 +03:00
|
|
|
|
2019-02-09 21:23:09 +03:00
|
|
|
# download
|
2019-05-01 03:19:56 +03:00
|
|
|
Write-Host "Downloading SDK to '$install'..."
|
2019-02-09 21:23:09 +03:00
|
|
|
New-Item -ItemType Directory -Force -Path "$tsTemp" | Out-Null
|
2019-02-05 06:22:35 +03:00
|
|
|
(New-Object System.Net.WebClient).DownloadFile("$url", "$install")
|
|
|
|
|
2019-12-23 15:35:43 +03:00
|
|
|
# validation
|
|
|
|
Write-Host "Validating Java install..."
|
|
|
|
Write-Host "JAVA_HOME is: $env:JAVA_HOME"
|
|
|
|
Write-Host "PATH contains JAVA_HOME: $($env:PATH.Contains("$env:JAVA_HOME"))"
|
|
|
|
& "java" -version
|
|
|
|
|
2019-02-09 21:23:09 +03:00
|
|
|
# install
|
2019-05-01 03:19:56 +03:00
|
|
|
Write-Host "Installing SDK to '$ts'..."
|
2019-02-09 21:23:09 +03:00
|
|
|
if ($IsMacOS -or $IsLinux) {
|
|
|
|
& "bash" "$install" --accept-license --no-java-check "$ts"
|
|
|
|
} else {
|
|
|
|
& "$install" --accept-license --no-java-check "$ts"
|
|
|
|
}
|
2019-02-05 06:22:35 +03:00
|
|
|
|
|
|
|
# install packages
|
2019-05-01 03:19:56 +03:00
|
|
|
Write-Host "Installing Additional Packages: '$packages'..."
|
|
|
|
$packMan = Join-Path (Join-Path "$ts" "package-manager") "package-manager-cli.${ext}"
|
2019-02-09 21:23:09 +03:00
|
|
|
if ($IsMacOS -or $IsLinux) {
|
2019-05-01 03:19:56 +03:00
|
|
|
& "bash" "$packMan" install --no-java-check --accept-license "$packages"
|
2019-02-09 21:23:09 +03:00
|
|
|
} else {
|
2019-05-01 03:19:56 +03:00
|
|
|
& "$packMan" install --no-java-check --accept-license "$packages"
|
2019-02-09 21:23:09 +03:00
|
|
|
}
|
2019-02-05 06:22:35 +03:00
|
|
|
|
2021-03-13 07:09:56 +03:00
|
|
|
function Swap-Tool {
|
|
|
|
param ([string] $OldName, [string] $NewName)
|
|
|
|
|
2020-12-26 01:42:28 +03:00
|
|
|
$tsTools = Join-Path "$ts" "tools"
|
2021-03-13 07:09:56 +03:00
|
|
|
$llvm40 = Join-Path $tsTools $OldName
|
|
|
|
$llvm40OLD = Join-Path $tsTools "$OldName-OLD"
|
|
|
|
$llvm10 = Join-Path $tsTools $NewName
|
2020-12-26 01:42:28 +03:00
|
|
|
if (!(Test-Path $llvm40OLD)) {
|
|
|
|
Copy-Item $llvm40 $llvm40OLD -Recurse -Force
|
|
|
|
}
|
|
|
|
if (Test-Path $llvm40) {
|
|
|
|
Remove-Item $llvm40 -Recurse -Force
|
|
|
|
}
|
|
|
|
Copy-Item $llvm10 $llvm40 -Recurse -Force
|
|
|
|
}
|
|
|
|
|
2021-03-13 07:09:56 +03:00
|
|
|
# Upgrade LLVM 4 to LLVM 10 by literally replacing the folder
|
|
|
|
if ($UpgradeLLVM) {
|
|
|
|
Write-Host "Upgrading LLVM and GCC in place..."
|
|
|
|
Swap-Tool "llvm-4.0.0" "llvm-10"
|
2021-09-12 08:18:49 +03:00
|
|
|
# Swap-Tool "aarch64-linux-gnu-gcc-6.2" "aarch64-linux-gnu-gcc-9.2"
|
|
|
|
# Swap-Tool "arm-linux-gnueabi-gcc-6.2" "arm-linux-gnueabi-gcc-9.2"
|
|
|
|
# Swap-Tool "i586-linux-gnueabi-gcc-6.2" "i586-linux-gnueabi-gcc-9.2"
|
|
|
|
# Swap-Tool "x86_64-linux-gnu-gcc-6.2" "x86_64-linux-gnu-gcc-9.2"
|
2021-03-13 07:09:56 +03:00
|
|
|
}
|
|
|
|
|
2019-06-25 10:10:09 +03:00
|
|
|
# make sure that Tizen Studio is in TIZEN_STUDIO_HOME
|
|
|
|
Write-Host "##vso[task.setvariable variable=TIZEN_STUDIO_HOME;]$ts";
|
|
|
|
|
2019-02-05 06:22:35 +03:00
|
|
|
exit $LASTEXITCODE
|