WIP: move winresources into cmd package

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-01-10 13:54:22 +01:00
parent f472dda2e9
commit 2932d316f9
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
13 changed files with 18 additions and 18 deletions

View file

@ -1,4 +1,4 @@
.git
bundles/
cli/winresources/**/winres.json
cli/winresources/**/*.syso
cmd/*/winresources/*.syso
cmd/*/winresources/winres.json

4
.gitignore vendored
View file

@ -15,8 +15,8 @@ thumbs.db
# build artifacts
bundles/
cli/winresources/*/*.syso
cli/winresources/*/winres.json
cmd/*/winresources/*.syso
cmd/*/winresources/winres.json
contrib/builder/rpm/*/changelog
# ci artifacts

View file

@ -608,8 +608,8 @@ RUN <<EOT
fi
EOT
RUN --mount=type=bind,target=.,rw \
--mount=type=tmpfs,target=cli/winresources/dockerd \
--mount=type=tmpfs,target=cli/winresources/docker-proxy \
--mount=type=tmpfs,target=cmd/dockerd/winresources \
--mount=type=tmpfs,target=cmd/docker-proxy/winresources \
--mount=type=cache,target=/root/.cache/go-build,id=moby-build-$TARGETPLATFORM <<EOT
set -e
target=$([ "$DOCKER_STATIC" = "1" ] && echo "binary" || echo "dynbinary")

View file

@ -1,5 +1,5 @@
//go:generate go-winres make --arch=386,amd64,arm,arm64 --in=../../cli/winresources/docker-proxy/winres.json --out=../../cli/winresources/docker-proxy/resource
//go:generate go-winres make --arch=386,amd64,arm,arm64 --in=winresources/winres.json --out=winresources/resource
package main
import _ "github.com/docker/docker/cli/winresources/docker-proxy"
import _ "github.com/docker/docker/cmd/docker-proxy/winresources"

View file

@ -1,5 +1,5 @@
//go:generate go-winres make --arch=386,amd64,arm,arm64 --in=../../cli/winresources/dockerd/winres.json --out=../../cli/winresources/dockerd/resource
//go:generate go-winres make --arch=386,amd64,arm,arm64 --in=winresources/winres.json --out=winresources/resource
package main
import _ "github.com/docker/docker/cli/winresources/dockerd"
import _ "github.com/docker/docker/cmd/dockerd/winresources"

View file

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 100 KiB

View file

@ -127,13 +127,13 @@ try {
}'
# Write the file
$outputFile="$(Get-Location)\cli\winresources\dockerd\winres.json"
$outputFile="$(Get-Location)\cmd\dockerd\winresources\winres.json"
if (Test-Path $outputFile) { Remove-Item $outputFile }
[System.IO.File]::WriteAllText($outputFile, $mkwinresContents)
Get-Content $outputFile | Out-Host
# Create winresources package stub if removed while using tmpfs in Dockerfile
$stubPackage="$(Get-Location)\cli\winresources\dockerd\winresources.go"
$stubPackage="$(Get-Location)\cmd\dockerd\winresources.go"
if(![System.IO.File]::Exists($stubPackage)){
Set-Content -NoNewline -Path $stubPackage -Value 'package winresources'
}

View file

@ -16,11 +16,11 @@ VERSION_QUAD=$(printf "%s" "$VERSION" | sed -re 's/^([0-9.]*).*$/\1/' | sed -re
# Microsoft Windows Version Information and an icon using go-winres.
# https://docs.microsoft.com/en-us/windows/win32/menurc/stringfileinfo-block
# https://github.com/tc-hib/go-winres#json-format
cat > "./cli/winresources/${BINARY_NAME}/winres.json" << EOL
cat > "./cmd/${BINARY_NAME}/winresources/winres.json" << EOL
{
"RT_GROUP_ICON": {
"#1": {
"0409": "../../winresources/docker.ico"
"0409": "winresources/docker.ico"
}
},
"RT_MANIFEST": {
@ -47,7 +47,7 @@ cat > "./cli/winresources/${BINARY_NAME}/winres.json" << EOL
},
"RT_MESSAGETABLE": {
"#1": {
"0409": "../../winresources/event_messages.bin"
"0409": "winresources/event_messages.bin"
}
},
"RT_VERSION": {
@ -76,10 +76,10 @@ cat > "./cli/winresources/${BINARY_NAME}/winres.json" << EOL
EOL
(
set -x
cat "./cli/winresources/${BINARY_NAME}/winres.json"
cat "./cmd/${BINARY_NAME}/winresources/winres.json"
)
# Create winresources package stub if removed while using tmpfs in Dockerfile
if [ ! -f "./cli/winresources/${BINARY_NAME}/winresources.go" ]; then
echo "package winresources" > "./cli/winresources/${BINARY_NAME}/winresources.go"
if [ ! -f "./cmd/${BINARY_NAME}/winresources/winresources.go" ]; then
echo "package winresources" > "./cmd/${BINARY_NAME}/winresources/winresources.go"
fi