Add build system for native applications

- PyInstaller spec file for cross-platform builds
- Build scripts for Linux/macOS (build.sh) and Windows (build.bat)
- requirements.txt with all dependencies
- Updated README with build and installation instructions
- Support for creating standalone executables for all platforms

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-06 08:37:23 -07:00
parent 80a249edcc
commit 8005a53b48
6 changed files with 238 additions and 2 deletions

70
build.sh Executable file
View File

@@ -0,0 +1,70 @@
#!/bin/bash
# Build script for Word Search application
# This script builds the application for the current platform
echo "========================================="
echo "Word Search Application Builder"
echo "========================================="
echo ""
# Check if PyInstaller is installed
if ! command -v pyinstaller &> /dev/null; then
echo "PyInstaller not found. Installing dependencies..."
pip install -r requirements.txt
fi
# Clean previous builds
echo "Cleaning previous builds..."
rm -rf build dist
# Detect platform
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
PLATFORM="Linux"
OUTPUT_NAME="WordSearch"
elif [[ "$OSTYPE" == "darwin"* ]]; then
PLATFORM="macOS"
OUTPUT_NAME="WordSearch.app"
elif [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "win32" ]]; then
PLATFORM="Windows"
OUTPUT_NAME="WordSearch.exe"
else
PLATFORM="Unknown"
OUTPUT_NAME="WordSearch"
fi
echo "Building for platform: $PLATFORM"
echo ""
# Build the application
echo "Running PyInstaller..."
pyinstaller word_search.spec
# Check if build was successful
if [ -d "dist" ]; then
echo ""
echo "========================================="
echo "Build completed successfully!"
echo "========================================="
echo ""
echo "Platform: $PLATFORM"
echo "Output location: dist/"
if [[ "$PLATFORM" == "macOS" ]]; then
echo "Application: dist/WordSearch.app"
echo ""
echo "To run: open dist/WordSearch.app"
elif [[ "$PLATFORM" == "Linux" ]]; then
echo "Executable: dist/WordSearch"
echo ""
echo "To run: ./dist/WordSearch"
chmod +x dist/WordSearch
else
echo "Executable: dist/WordSearch.exe"
echo ""
echo "To run: dist\\WordSearch.exe"
fi
else
echo ""
echo "Build failed! Check the error messages above."
exit 1
fi