aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/packages/chocolatey
diff options
context:
space:
mode:
authorGravatar Peter Mounce <pete@neverrunwithscissors.com>2016-10-11 09:21:09 +0000
committerGravatar Yue Gan <yueg@google.com>2016-10-11 13:26:17 +0000
commit22d36737aa2a37edecf6c855e61f82df3c79596b (patch)
treea40fc59e4a658dd196346e153905f821c118f2f7 /scripts/packages/chocolatey
parentc925f34ee5a04126da64882ad63c7a29a0b560c4 (diff)
Changes necessary for releasing 0.3.2 chocolatey package.
Note - the chocolatey package to satisfy this has not yet been released, but it _will_ be according to [this trail](https://github.com/userzimmermann/choco-packages/issues/7#issuecomment-252605193) Closes #1905. -- Reviewed-on: https://github.com/bazelbuild/bazel/pull/1905 MOS_MIGRATED_REVID=135774603
Diffstat (limited to 'scripts/packages/chocolatey')
-rw-r--r--scripts/packages/chocolatey/.gitignore1
-rw-r--r--scripts/packages/chocolatey/bazel.nuspec.template2
-rw-r--r--scripts/packages/chocolatey/build.ps125
-rw-r--r--scripts/packages/chocolatey/chocolateyinstall.ps1.template3
-rw-r--r--scripts/packages/chocolatey/test.ps12
5 files changed, 20 insertions, 13 deletions
diff --git a/scripts/packages/chocolatey/.gitignore b/scripts/packages/chocolatey/.gitignore
index 1959b85442..12bcf8228a 100644
--- a/scripts/packages/chocolatey/.gitignore
+++ b/scripts/packages/chocolatey/.gitignore
@@ -2,5 +2,6 @@
*.zip
bazel.nuspec
chocolateyinstall.ps1
+chocolateyuninstall.ps1
tools/*.exe
tools/LICENSE.txt
diff --git a/scripts/packages/chocolatey/bazel.nuspec.template b/scripts/packages/chocolatey/bazel.nuspec.template
index 583ce93987..7c81c9a9f7 100644
--- a/scripts/packages/chocolatey/bazel.nuspec.template
+++ b/scripts/packages/chocolatey/bazel.nuspec.template
@@ -76,7 +76,7 @@ Supply like `--params="/option:value ..."` ([see docs for --params](https://gith
</dependencies>-->
<dependencies>
<dependency id="jdk8" version="[8.0.102,)"/>
- <dependency id="msys2" version="[20150916.0.1,)"/>
+ <dependency id="msys2" version="[20160205,)"/>
<dependency id="python2" version="[2.7.11,3.0)"/>
</dependencies>
<!-- chocolatey-uninstall.extension - If supporting 0.9.9.x (or below) and including a chocolateyUninstall.ps1 file to uninstall an EXE/MSI, you probably want to include chocolatey-uninstall.extension as a dependency. Please verify whether you are using a helper function from that package. -->
diff --git a/scripts/packages/chocolatey/build.ps1 b/scripts/packages/chocolatey/build.ps1
index daa24e12ce..032c6c8249 100644
--- a/scripts/packages/chocolatey/build.ps1
+++ b/scripts/packages/chocolatey/build.ps1
@@ -1,10 +1,10 @@
param(
- [string] $version = "0.3.1",
+ [string] $version = "0.3.2",
[switch] $isRelease
)
$tvVersion = $version
-$tvFilename = "bazel_$($version)_windows_x86_64.zip"
+$tvFilename = "bazel-$($version)-windows-x86_64.zip"
if ($isRelease) {
$tvUri = "https://github.com/bazelbuild/bazel/releases/download/$($version)/$($tvFilename)"
} else {
@@ -17,14 +17,19 @@ rm -force -ErrorAction SilentlyContinue ./*.zip
rm -force -ErrorAction SilentlyContinue ./bazel.nuspec
rm -force -ErrorAction SilentlyContinue ./tools/chocolateyinstall.ps1
-Add-Type -A System.IO.Compression.FileSystem
-$outputDir = "$pwd/../../../output"
-$zipFile = "$pwd/$($tvFilename)"
-write-host "Creating zip package with $outputDir/bazel.exe: $zipFile"
-Compress-Archive -Path "$outputDir/bazel.exe" -DestinationPath $zipFile
-$tvChecksum = (get-filehash $zipFile -algorithm sha256).Hash
-write-host "zip sha256: $tvChecksum"
-
+if ($isRelease) {
+ Invoke-WebRequest "$($tvUri).sha256" -UseBasicParsing -passthru -outfile sha256.txt
+ $tvChecksum = (gc sha256.txt).split(' ')[0]
+ rm sha256.txt
+} else {
+ Add-Type -A System.IO.Compression.FileSystem
+ $outputDir = "$pwd/../../../output"
+ $zipFile = "$pwd/$($tvFilename)"
+ write-host "Creating zip package with $outputDir/bazel.exe: $zipFile"
+ Compress-Archive -Path "$outputDir/bazel.exe" -DestinationPath $zipFile
+ $tvChecksum = (get-filehash $zipFile -algorithm sha256).Hash
+ write-host "zip sha256: $tvChecksum"
+}
$nuspecTemplate = get-content "bazel.nuspec.template" | out-string
$nuspecExpanded = $ExecutionContext.InvokeCommand.ExpandString($nuspecTemplate)
add-content -value $nuspecExpanded -path bazel.nuspec
diff --git a/scripts/packages/chocolatey/chocolateyinstall.ps1.template b/scripts/packages/chocolatey/chocolateyinstall.ps1.template
index 595631e88b..4d12ed270f 100644
--- a/scripts/packages/chocolatey/chocolateyinstall.ps1.template
+++ b/scripts/packages/chocolatey/chocolateyinstall.ps1.template
@@ -54,11 +54,12 @@ if (ps_var_packageParameters)
}
Install-ChocolateyPath -PathToInstall "ps_var_msys2Path\usr\bin" -PathType "Machine"
+ps_var_addToMsysPath = (ps_var_packageDir -replace 'c:\\','/c/') -replace '\\','/'
write-host @"
bazel installed to ps_var_packageDir
To use it in msys2, you should add that to your msys2 PATH:
- export PATH=ps_var_(ps_var_packageDir):escape_charps_var_PATH
+ export PATH=ps_var_(ps_var_addToMsysPath):escape_charps_var_PATH
You also need, in your msys2 environment:
export JAVA_HOME="escape_charps_var_(ls -d C:/Program\ Files/Java/jdk* | sort | tail -n 1)escape_char"
diff --git a/scripts/packages/chocolatey/test.ps1 b/scripts/packages/chocolatey/test.ps1
index c6561bdec7..642cd2b05e 100644
--- a/scripts/packages/chocolatey/test.ps1
+++ b/scripts/packages/chocolatey/test.ps1
@@ -1,5 +1,5 @@
param(
- [string] $version = "0.3.1"
+ [string] $version = "0.3.2"
)
choco uninstall bazel --force -y