[macOS] Move Ruby and Go versions to toolset (#4046)

This commit is contained in:
Dibir Magomedsaygitov
2021-09-10 14:41:17 +03:00
committed by GitHub
parent 045e638562
commit d022b0d6a8
15 changed files with 81 additions and 39 deletions

View File

@@ -19,9 +19,6 @@ if is_Less_Catalina; then
echo "export USE_BAZEL_VERSION=${USE_BAZEL_VERSION}" >> "${HOME}/.bashrc"
fi
# Create symlinks for Go 1.15 to preserve backward compatibility
ln -sf $(brew --prefix go@1.15)/bin/* /usr/local/bin/
# Invoke bazel to download bazel version via bazelisk
bazel

View File

@@ -0,0 +1,11 @@
#!/bin/bash -e -o pipefail
source ~/utils/utils.sh
DEFAULT_GO_VERSION=$(get_toolset_value '.go.default')
echo "Installing Go..."
brew_smart_install "go@${DEFAULT_GO_VERSION}"
# Create symlinks to preserve backward compatibility. Symlinks are not created when non-latest go is being installed
ln -sf $(brew --prefix go@${DEFAULT_GO_VERSION})/bin/* /usr/local/bin/
invoke_tests "Common" "Go"

View File

@@ -1,8 +1,9 @@
#!/bin/bash -e -o pipefail
source ~/utils/utils.sh
DEFAULT_RUBY_VERSION=$(get_toolset_value '.ruby.default')
echo Installing Ruby...
brew_smart_install "ruby@2.7"
brew_smart_install "ruby@${DEFAULT_RUBY_VERSION}"
#if High Sierra - skip installation from toolset
if is_HighSierra; then

View File

@@ -4,7 +4,7 @@ source ~/utils/utils.sh
echo Updating RubyGems...
gem update --system
gemsToInstall=$(get_toolset_value ".rubygems[]")
gemsToInstall=$(get_toolset_value '.ruby.rubygems | .[]')
if [ -n "$gemsToInstall" ]; then
for gem in $gemsToInstall; do
echo "Installing gem $gem"

View File

@@ -159,6 +159,7 @@
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
"scripts": [
"./provision/core/commonutils.sh",
"./provision/core/golang.sh",
"./provision/core/openjdk.sh",
"./provision/core/php.sh",
"./provision/core/aws.sh",

View File

@@ -159,6 +159,7 @@
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
"scripts": [
"./provision/core/commonutils.sh",
"./provision/core/golang.sh",
"./provision/core/swiftlint.sh",
"./provision/core/openjdk.sh",
"./provision/core/php.sh",

View File

@@ -160,6 +160,7 @@
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
"scripts": [
"./provision/core/commonutils.sh",
"./provision/core/golang.sh",
"./provision/core/swiftlint.sh",
"./provision/core/openjdk.sh",
"./provision/core/php.sh",

View File

@@ -165,6 +165,7 @@
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}",
"scripts": [
"./provision/core/commonutils.sh",
"./provision/core/golang.sh",
"./provision/core/swiftlint.sh",
"./provision/core/openjdk.sh",
"./provision/core/php.sh",

View File

@@ -24,11 +24,6 @@ Describe "SwiftFormat" {
}
}
Describe "Go" {
It "Go" {
"go version" | Should -ReturnZeroExitCode
}
}
Describe "GnuPG" {
It "GnuPG" {

View File

@@ -98,3 +98,9 @@ Describe "Bicep" {
"bicep --version" | Should -ReturnZeroExitCode
}
}
Describe "Go" {
It "Go" {
"go version" | Should -ReturnZeroExitCode
}
}

View File

@@ -1,5 +1,5 @@
Describe "RubyGems" {
$gemTestCases = Get-ToolsetValue -KeyPath "rubygems" | ForEach-Object {
$gemTestCases = Get-ToolsetValue -KeyPath "ruby.rubygems" | ForEach-Object {
@{gemName = $_}
}

View File

@@ -229,7 +229,6 @@
"gh",
"gnupg",
"gnu-tar",
"go@1.15",
"helm",
"libpq",
"llvm",
@@ -279,5 +278,19 @@
"versions": [
"2.1"
]
},
"ruby": {
"default": "2.7",
"rubygems": [
"xcode-install",
"cocoapods",
"nomad-cli",
"xcpretty",
"bundler",
"fastlane"
]
},
"go": {
"default": "1.15"
}
}

View File

@@ -250,7 +250,6 @@
"gh",
"gnupg",
"gnu-tar",
"go@1.15",
"helm",
"kotlin",
"libpq",
@@ -350,6 +349,8 @@
"2.1"
]
},
"ruby": {
"default": "2.7",
"rubygems": [
"xcode-install",
"cocoapods",
@@ -358,4 +359,8 @@
"bundler",
"fastlane"
]
},
"go": {
"default": "1.15"
}
}

View File

@@ -201,7 +201,6 @@
"gh",
"gnupg",
"gnu-tar",
"go@1.15",
"helm",
"kotlin",
"libpq",
@@ -304,6 +303,8 @@
"5.0"
]
},
"ruby": {
"default": "2.7",
"rubygems": [
"xcode-install",
"cocoapods",
@@ -312,4 +313,8 @@
"bundler",
"fastlane"
]
},
"go": {
"default": "1.15"
}
}

View File

@@ -147,7 +147,6 @@
"gh",
"gnupg",
"gnu-tar",
"go@1.15",
"helm",
"kotlin",
"libpq",
@@ -239,6 +238,8 @@
"5.0"
]
},
"ruby": {
"default": "2.7",
"rubygems": [
"xcode-install",
"cocoapods",
@@ -247,4 +248,8 @@
"bundler",
"fastlane"
]
},
"go": {
"default": "1.15"
}
}