]> Cypherpunks repositories - gostls13.git/commitdiff
misc/dist/windows: distro builder updates
authorJoe Poirier <jdpoirier@gmail.com>
Fri, 17 Feb 2012 17:07:34 +0000 (11:07 -0600)
committerJoe Poirier <jdpoirier@gmail.com>
Fri, 17 Feb 2012 17:07:34 +0000 (11:07 -0600)
files moved from misc/windows, bash packager file replaced with Windows batch file

R=golang-dev, alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/5677074

misc/dist/windows/README [moved from misc/windows/README with 100% similarity]
misc/dist/windows/dist.bat [new file with mode: 0755]
misc/dist/windows/godocserver.bat [moved from misc/windows/godocserver.bat with 100% similarity]
misc/dist/windows/goenv.bat [moved from misc/windows/goenv.bat with 100% similarity]
misc/dist/windows/installer.wxs [moved from misc/windows/installer.wxs with 100% similarity]
misc/windows/LICENSE [deleted file]
misc/windows/package.bash [deleted file]

similarity index 100%
rename from misc/windows/README
rename to misc/dist/windows/README
diff --git a/misc/dist/windows/dist.bat b/misc/dist/windows/dist.bat
new file mode 100755 (executable)
index 0000000..ec8841d
--- /dev/null
@@ -0,0 +1,54 @@
+:: Copyright 2012 The Go Authors. All rights reserved.\r
+:: Use of this source code is governed by a BSD-style\r
+:: license that can be found in the LICENSE file.\r
+@echo off\r
+\r
+setlocal\r
+\r
+:: Requires WiX (candle light heat), 7zip, and hg\r
+\r
+echo # Setting variable info\r
+for /f %%i in ('hg.exe root') do set ROOT=%%i\r
+for /f %%i in ('hg.exe id -n') do set ID=%%i\r
+for /f "tokens=3" %%i in ('%ROOT%\bin\go.exe version') do set VER=%%i\r
+if errorlevel 1 goto end\r
+\r
+echo # Getting GOARCH\r
+%ROOT%\bin\go tool dist env > env.txt\r
+set GOARCH /p = find "GOARCH" "env.txt">NUL\r
+del /F /Q /S env.txt>NUL\r
+if errorlevel 1 goto end\r
+\r
+rmdir /S /Q go>NUL\r
+mkdir go\r
+\r
+echo # Cloning the go tree\r
+hg clone -r %ID% %ROOT% go\r
+if errorlevel 1 goto end\r
+\r
+rmdir /S /Q  go\.hg>NUL\r
+del /F /Q /S go\.hgignore go\.hgtags>NUL\r
+\r
+echo # Copying pkg, bin and src/pkg/runtime/z*\r
+xcopy %ROOT%\pkg                   go\pkg /V /E /Y /I\r
+xcopy %ROOT%\bin                   go\bin /V /E /Y /I\r
+xcopy %ROOT%\src\pkg\runtime\z*.c  go\src\pkg\runtime  /V /E /Y\r
+xcopy %ROOT%\src\pkg\runtime\z*.go go\src\pkg\runtime  /V /E /Y\r
+xcopy %ROOT%\src\pkg\runtime\z*.h  go\src\pkg\runtime  /V /E /T\r
+\r
+echo # Starting zip packaging\r
+7za a -tzip -mx=9 gowin%GOARCH%"_"%VER%.zip "go/"\r
+if errorlevel 1 goto end\r
+\r
+echo # Starting Go directory file harvesting\r
+heat dir go -nologo -cg AppFiles -gg -g1 -srd -sfrag -template fragment -dr INSTALLDIR -var var.SourceDir -out AppFiles.wxs\r
+if errorlevel 1 goto end\r
+\r
+echo # Starting installer packaging\r
+candle -nologo -dVersion=%VER% -dArch=%GOARCH% -dSourceDir=go installer.wxs AppFiles.wxs\r
+light -nologo -ext WixUIExtension -ext WixUtilExtension installer.wixobj AppFiles.wixobj -o gowin%GOARCH%"_"%VER%.msi\r
+if errorlevel 1 goto end\r
+\r
+del /F /Q /S *.wixobj AppFiles.wxs *.wixpdb>NUL\r
+\r
+:end\r
diff --git a/misc/windows/LICENSE b/misc/windows/LICENSE
deleted file mode 100644 (file)
index b2b0be6..0000000
Binary files a/misc/windows/LICENSE and /dev/null differ
diff --git a/misc/windows/package.bash b/misc/windows/package.bash
deleted file mode 100755 (executable)
index 995e47d..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2011 The Go Authors.  All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-set -e
-
-PROGS="
-       candle
-       light
-       heat
-"
-
-echo "%%%%% Checking for WiX executables %%%%%" 1>&2
-for i in $PROGS; do
-       if ! which -a $1 >/dev/null; then
-               echo "Cannot find '$i' on search path." 1>$2
-               exit 1
-       fi
-done
-
-echo "%%%%% Checking the packager's path %%%%%" 1>&2
-if ! test -f ../../src/env.bash; then
-       echo "package.bash must be run from $GOROOT/misc/windows" 1>&2
-fi
-
-echo "%%%%% Setting the go package version info %%%%%" 1>&2
-ver="$(bash ../../src/version.bash | sed 's/ .*//')"
-
-rm -rf go
-mkdir go
-
-echo "%%%%% Cloning the go tree %%%%%" 1>&2
-hg clone -r $(hg id -n | sed 's/+//') $(hg root) go
-
-rm -rf ./go/.hg ./go/.hgignore ./go/.hgtags
-
-echo "%%%%% Copying pkg, bin and src/pkg/runtime/z* %%%%%" 1>&2
-cp -a ../../pkg go/pkg
-cp -a ../../bin go/bin
-cp ../../src/pkg/runtime/z*.c go/src/pkg/runtime/
-cp ../../src/pkg/runtime/z*.go go/src/pkg/runtime/
-cp ../../src/pkg/runtime/z*.h go/src/pkg/runtime/
-
-echo "%%%%% Starting zip packaging %%%%%" 1>&2
-7za a -tzip -mx=9 gowin$GOARCH"_"$ver.zip "go/" >/dev/null
-
-echo "%%%%% Starting Go directory file harvesting %%%%%" 1>&2
-heat dir go -nologo -cg AppFiles -gg -g1 -srd -sfrag -template fragment -dr INSTALLDIR -var var.SourceDir -out AppFiles.wxs
-
-echo "%%%%% Starting installer packaging %%%%%" 1>&2
-candle -nologo -dVersion=$ver -dArch=$GOARCH -dSourceDir=go installer.wxs AppFiles.wxs
-light -nologo -ext WixUIExtension -ext WixUtilExtension installer.wixobj AppFiles.wixobj -o gowin$GOARCH"_"$ver.msi
-
-rm -f *.wixobj AppFiles.wxs *.wixpdb
-