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:
70
build.sh
Executable file
70
build.sh
Executable 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
|
||||
Reference in New Issue
Block a user