Merge branch 'master' of https://github.com/robertjanetzko/LegendsBrowser2 into knowledgeStrings

This commit is contained in:
Zebbeni 2022-04-30 23:14:26 -06:00
commit ef1cdea1b7
No known key found for this signature in database
GPG Key ID: 9B06CB2C1E90C90A
9 changed files with 196 additions and 12 deletions

View File

@ -10,11 +10,15 @@ RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/
# [Optional] Uncomment this section to install additional OS packages.
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends graphviz
&& apt-get -y install --no-install-recommends graphviz cmake zlib1g-dev genisoimage
RUN cd /tmp && git clone https://github.com/hamstergene/libdmg-hfsplus \
&& cd libdmg-hfsplus && cmake . -B build && make -C build/dmg -j8 && cp build/dmg/dmg /usr/local/bin \
&& rm -rf /tmp/libdmg-hfsplus
# [Optional] Uncomment the next lines to use go get to install anything else you need
# USER vscode
USER vscode
# RUN go get -x <your-dependency-or-tool>
# RUN npm install -g @angular/CLI
# [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
RUN go install github.com/tc-hib/go-winres@latest

View File

@ -1,10 +0,0 @@
build:
cd backend && GOOS=linux GOARCH=386 go build -o ../bin/legendsbrowser-linux-386 main.go
cd backend && GOOS=linux GOARCH=amd64 go build -o ../bin/legendsbrowser-linux-x64 main.go
cd backend && GOOS=windows GOARCH=386 go build -o ../bin/legendsbrowser-386.exe main.go
cd backend && GOOS=windows GOARCH=amd64 go build -o ../bin/legendsbrowser-x64.exe main.go
cd backend && GOOS=darwin GOARCH=amd64 go build -o ../bin/legendsbrowser-macos-x64 main.go
cd backend && GOOS=darwin GOARCH=arm64 go build -o ../bin/legendsbrowser-macos-m1 main.go
run:
cd backend && go run main.go

16
backend/Makefile Normal file
View File

@ -0,0 +1,16 @@
build:
GOOS=linux GOARCH=386 go build -o ../bin/legendsbrowser-linux-386
GOOS=linux GOARCH=amd64 go build -o ../bin/legendsbrowser-linux-x64
GOOS=windows GOARCH=386 go build -o ../bin/legendsbrowser-386.exe
GOOS=windows GOARCH=amd64 go build -o ../bin/legendsbrowser-x64.exe
GOOS=darwin GOARCH=arm64 go build -o ../bin/legendsbrowser-macos-m1
buildMacOs:
mkdir -p /tmp/build/macos
cp -r macos/LegendsBrowser.app /tmp/build/macos/
GOOS=darwin GOARCH=amd64 go build -o /tmp/build/macos/LegendsBrowser.app/Contents/MacOS/LegendsBrowser
genisoimage -D -V "LegendsBrowser" -no-pad -r -apple -o /tmp/build/uncompressed.dmg /tmp/build/macos
dmg dmg /tmp/build/uncompressed.dmg ../bin/LegendsBrowser.dmg
run:
cd backend && go run main.go

85
backend/macappshell.sh Executable file
View File

@ -0,0 +1,85 @@
#!/bin/bash
# Mac OSX .app builder
function die {
echo "ERROR: $1" > /dev/null 1>&2
exit 1
}
if [ "$#" -ne 2 ]; then
die "Usage: `basename $0` AppNameHere icon-file.svg"
fi
APPNAME=$1
ICONNAME=$2
if [ ! -f $ICONNAME ]; then
die "Image file for icon not found"
fi
mkdir -p "$APPNAME.app/Contents/"{MacOS,Resources}
cat > "$APPNAME.app/Contents/Info.plist" <<END
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleGetInfoString</key>
<string>$APPNAME</string>
<key>CFBundleExecutable</key>
<string>$APPNAME</string>
<key>CFBundleIdentifier</key>
<string>com.example.www</string>
<key>CFBundleName</key>
<string>$APPNAME</string>
<key>CFBundleIconFile</key>
<string>icon.icns</string>
<key>CFBundleShortVersionString</key>
<string>0.01</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>IFMajorVersion</key>
<integer>0</integer>
<key>IFMinorVersion</key>
<integer>1</integer>
<key>NSHighResolutionCapable</key><true/>
<key>NSSupportsAutomaticGraphicsSwitching</key><true/>
</dict>
</plist>
END
cp $ICONNAME "$APPNAME.app/Contents/Resources/"
cd "$APPNAME.app/Contents/Resources/"
fileName="$(basename $ICONNAME)"
postfix=${fileName##*.}
if [[ $postfix == 'svg' ]]; then
qlmanage -z -t -s 1024 -o ./ "$fileName"
fileName=${fileName}.png
fi
echo $fileName
mkdir icon.iconset
sips -z 16 16 "$fileName" --out icon.iconset/icon_16x16.png
sips -z 32 32 "$fileName" --out icon.iconset/icon_16x16@2x.png
cp icon.iconset/icon_16x16@2x.png icon.iconset/icon_32x32.png
sips -z 64 64 "$fileName" --out icon.iconset/icon_32x32@2x.png
sips -z 128 128 "$fileName" --out icon.iconset/icon_128x128.png
sips -z 256 256 "$fileName" --out icon.iconset/icon_128x128@2x.png
cp icon.iconset/icon_128x128@2x.png icon.iconset/icon_256x256.png
sips -z 512 512 "$fileName" --out icon.iconset/icon_256x256@2x.png
cp icon.iconset/icon_256x256@2x.png icon.iconset/icon_512x512.png
sips -z 1024 1024 "$fileName" --out icon.iconset/icon_512x512@2x.png
# Create .icns file
iconutil -c icns icon.iconset
# Cleanup
rm -R icon.iconset
rm $fileName

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleGetInfoString</key>
<string>LegendsBrowser</string>
<key>CFBundleExecutable</key>
<string>LegendsBrowser</string>
<key>CFBundleIdentifier</key>
<string>com.example.www</string>
<key>CFBundleName</key>
<string>LegendsBrowser</string>
<key>CFBundleIconFile</key>
<string>icon.icns</string>
<key>CFBundleShortVersionString</key>
<string>0.01</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>IFMajorVersion</key>
<integer>0</integer>
<key>IFMinorVersion</key>
<integer>1</integer>
<key>NSHighResolutionCapable</key><true/>
<key>NSSupportsAutomaticGraphicsSwitching</key><true/>
</dict>
</plist>

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,61 @@
{
"RT_GROUP_ICON": {
"APP": {
"0000": [
"icon.png",
"icon16.png"
]
}
},
"RT_MANIFEST": {
"#1": {
"0409": {
"identity": {
"name": "",
"version": ""
},
"description": "",
"minimum-os": "win7",
"execution-level": "as invoker",
"ui-access": false,
"auto-elevate": false,
"dpi-awareness": "system",
"disable-theming": false,
"disable-window-filtering": false,
"high-resolution-scrolling-aware": false,
"ultra-high-resolution-scrolling-aware": false,
"long-path-aware": false,
"printer-driver-isolation": false,
"gdi-scaling": false,
"segment-heap": false,
"use-common-controls-v6": false
}
}
},
"RT_VERSION": {
"#1": {
"0000": {
"fixed": {
"file_version": "0.0.0.0",
"product_version": "0.0.0.0"
},
"info": {
"0409": {
"Comments": "",
"CompanyName": "",
"FileDescription": "",
"FileVersion": "",
"InternalName": "",
"LegalCopyright": "",
"LegalTrademarks": "",
"OriginalFilename": "",
"PrivateBuild": "",
"ProductName": "",
"ProductVersion": "",
"SpecialBuild": ""
}
}
}
}
}
}