Skip to content

Commit

Permalink
Improve app bundle structure
Browse files Browse the repository at this point in the history
  • Loading branch information
mokiat committed Sep 5, 2017
1 parent 144a050 commit 49054bc
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 4 deletions.
32 changes: 32 additions & 0 deletions bundle/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleName</key>
<string>Rally MKA</string>
<key>CFBundleIdentifier</key>
<string>com.mokiat.RallyMKA</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleExecutable</key>
<string>RallyMKA</string>
<key>LSMinimumSystemVersion</key>
<string>10.12</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2017 Momchil Atanasov. All rights reserved.</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleIconFile</key>
<string>AppIcon</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
</dict>
</plist>
Binary file added bundle/Resources/AppIcon.icns
Binary file not shown.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func main() {
panic(err)
}

assetsDir := path.Join(path.Dir(os.Args[0]), "assets")
assetsDir := path.Join(path.Dir(os.Args[0]), "..", "Resources", "assets")
if !dirExists(assetsDir) {
assetsDir = "assets"
}
Expand Down
17 changes: 14 additions & 3 deletions scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,20 @@ fi
mkdir $target_dir

app_name="RallyMKA"
macos_dir="${target_dir}/${app_name}.app/Contents/MacOS"

contents_dir="$target_dir/${app_name}.app/Contents"
mkdir -p "$contents_dir"

src_bundle_dir="$project_dir/bundle"
cp -r "$src_bundle_dir/" "$contents_dir"

resources_dir="$contents_dir/Resources"
mkdir -p "$resources_dir"

src_assets_dir="$project_dir/assets"
cp -r "$src_assets_dir" "$resources_dir"

macos_dir="$contents_dir/MacOS"
mkdir -p "$macos_dir"
go build -o "$macos_dir/${app_name}" "$project_dir/main.go"

assets_dir="$project_dir/assets"
cp -r "$assets_dir" "$macos_dir/"

0 comments on commit 49054bc

Please sign in to comment.