github.com/sijibomii/docker@v0.0.0-20231230191044-5cf6ca554647/hack/make/.go-autogen (about) 1 #!/bin/bash 2 3 rm -rf autogen 4 5 cat > dockerversion/version_autogen.go <<DVEOF 6 // +build autogen 7 8 // Package dockerversion is auto-generated at build-time 9 package dockerversion 10 11 // Default build-time variable for library-import. 12 // This file is overridden on build with build-time informations. 13 const ( 14 GitCommit string = "$GITCOMMIT" 15 Version string = "$VERSION" 16 BuildTime string = "$BUILDTIME" 17 IAmStatic string = "${IAMSTATIC:-true}" 18 ) 19 // AUTOGENERATED FILE; see $BASH_SOURCE 20 DVEOF 21 22 # Compile the Windows resources into the sources 23 mkdir -p autogen/winresources 24 cat > autogen/winresources/resources.go <<WREOF 25 // Package winresources is auto-generated at build-time 26 // AUTOGENERATED FILE; see $BASH_SOURCE 27 package winresources 28 29 /* 30 31 This package is for embedding a manifest file and an icon into docker.exe. 32 The benefit of this is that a manifest file does not need to be alongside 33 the .exe, and there is an icon when docker runs, or viewed through Windows 34 explorer. 35 36 When make binary is run, the Dockerfile prepares the build environment by: 37 38 - Cloning github.com/akavel/rsrc 39 40 - Go-installing the rsrc executable 41 42 make.sh invokes hack/make/.go-autogen to: 43 44 - Run rsrc to create a binary file (autogen/winresources/rsrc.syso) that 45 contains the manifest and icon. This file is automatically picked up by 46 'go build', so no post-processing steps are required. The sources for 47 rsrc.syso are under hack/make/.resources-windows. 48 49 */ 50 WREOF 51 if [ "$(go env GOOS)" = 'windows' ]; then 52 rsrc \ 53 -manifest hack/make/.resources-windows/docker.exe.manifest \ 54 -ico hack/make/.resources-windows/docker.ico \ 55 -arch "amd64" \ 56 -o autogen/winresources/rsrc_amd64.syso > /dev/null 57 58 rsrc \ 59 -manifest hack/make/.resources-windows/docker.exe.manifest \ 60 -ico hack/make/.resources-windows/docker.ico \ 61 -arch "386" \ 62 -o autogen/winresources/rsrc_386.syso > /dev/null 63 fi