-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquick_build.sh
More file actions
137 lines (116 loc) Β· 3.61 KB
/
quick_build.sh
File metadata and controls
137 lines (116 loc) Β· 3.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/bin/bash
# Quick Build Script for Auralis
# Usage: ./scripts/quick_build.sh [options]
set -e # Exit on error
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Default options
SKIP_TESTS=false
PORTABLE_ONLY=false
CLEAN_FIRST=false
# Parse command line arguments
while [[ $# -gt 0 ]]; do
case $1 in
--skip-tests)
SKIP_TESTS=true
shift
;;
--portable-only)
PORTABLE_ONLY=true
shift
;;
--clean)
CLEAN_FIRST=true
shift
;;
--help|-h)
echo "Quick Build Script for Auralis"
echo ""
echo "Usage: $0 [options]"
echo ""
echo "Options:"
echo " --skip-tests Skip running tests before building"
echo " --portable-only Create portable package only"
echo " --clean Clean build directories first"
echo " --help, -h Show this help message"
echo ""
exit 0
;;
*)
echo "Unknown option: $1"
echo "Use --help for usage information"
exit 1
;;
esac
done
# Header
echo -e "${BLUE}π΅ Auralis Quick Build Script${NC}"
echo "=================================="
# Check if we're in the right directory
if [ ! -f "auralis_gui.py" ]; then
echo -e "${RED}β Error: Please run this script from the Auralis root directory${NC}"
exit 1
fi
# Clean if requested
if [ "$CLEAN_FIRST" = true ]; then
echo -e "${YELLOW}π§Ή Cleaning build directories...${NC}"
rm -rf build/ dist/ __pycache__/
find . -name "*.pyc" -delete
find . -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true
fi
# Check Python version
PYTHON_VERSION=$(python --version 2>&1 | cut -d' ' -f2 | cut -d'.' -f1,2)
echo -e "${BLUE}π Python version: $PYTHON_VERSION${NC}"
if [ "$(echo "$PYTHON_VERSION 3.11" | awk '{print ($1 >= $2)}')" != "1" ]; then
echo -e "${YELLOW}β οΈ Warning: Python 3.11+ recommended, you have $PYTHON_VERSION${NC}"
fi
# Install dependencies if needed
echo -e "${BLUE}π¦ Checking dependencies...${NC}"
if ! python -c "import customtkinter" 2>/dev/null; then
echo -e "${YELLOW}π¦ Installing dependencies...${NC}"
pip install -r requirements-desktop.txt
fi
if ! python -c "import PyInstaller" 2>/dev/null; then
echo -e "${YELLOW}π¦ Installing PyInstaller...${NC}"
pip install pyinstaller
fi
# Build arguments
BUILD_ARGS=""
if [ "$SKIP_TESTS" = true ]; then
BUILD_ARGS="$BUILD_ARGS --skip-tests"
fi
if [ "$PORTABLE_ONLY" = true ]; then
BUILD_ARGS="$BUILD_ARGS --portable-only"
fi
# Start build
echo -e "${GREEN}π¨ Starting build...${NC}"
START_TIME=$(date +%s)
python build_auralis.py $BUILD_ARGS
END_TIME=$(date +%s)
DURATION=$((END_TIME - START_TIME))
# Build complete
echo ""
echo -e "${GREEN}β
Build completed in ${DURATION}s!${NC}"
# Show results
if [ -d "dist" ]; then
echo -e "${BLUE}π Build Results:${NC}"
echo "=================="
if [ -f "dist/Auralis-"*".tar.gz" ]; then
PACKAGE_SIZE=$(du -h dist/Auralis-*.tar.gz | cut -f1)
echo -e "π¦ Portable package: ${GREEN}$PACKAGE_SIZE${NC}"
fi
if [ -d "dist/Auralis" ]; then
INSTALL_SIZE=$(du -sh dist/Auralis | cut -f1)
echo -e "πΏ Installation size: ${GREEN}$INSTALL_SIZE${NC}"
fi
echo ""
echo -e "${BLUE}π Ready for distribution!${NC}"
echo "To test: cd dist/Auralis && ./Auralis"
else
echo -e "${RED}β Build failed - no dist directory created${NC}"
exit 1
fi