-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·80 lines (65 loc) · 1.85 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·80 lines (65 loc) · 1.85 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
#!/bin/bash
# VarSync Build Script
# This script builds the Go core and sets up the project
set -e
echo "🚀 Building VarSync..."
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Function to print colored output
print_status() {
echo -e "${BLUE}[INFO]${NC} $1"
}
print_success() {
echo -e "${GREEN}[SUCCESS]${NC} $1"
}
print_warning() {
echo -e "${YELLOW}[WARNING]${NC} $1"
}
print_error() {
echo -e "${RED}[ERROR]${NC} $1"
}
# Check if Go is installed
if ! command -v go &> /dev/null; then
print_error "Go is not installed. Please install Go first."
exit 1
fi
print_status "Go version: $(go version)"
# Build Go core
print_status "Building Go core..."
cd core
if go build -o varsync main.go; then
print_success "Go core built successfully!"
else
print_error "Failed to build Go core"
exit 1
fi
cd ..
# Make the binary executable
chmod +x core/varsync
# Check if Python is available
if command -v python3 &> /dev/null; then
print_status "Python 3 is available"
print_status "To install Python wrapper: cd varbridge-py && pip install -e ."
else
print_warning "Python 3 not found. Python wrapper will not be available."
fi
# Check if Node.js is available
if command -v node &> /dev/null; then
print_status "Node.js is available"
print_status "To install Node.js wrapper: cd varbridge-js && npm install"
else
print_warning "Node.js not found. Node.js wrapper will not be available."
fi
print_success "Build completed!"
echo ""
echo "📋 Next steps:"
echo "1. Start the Go core: ./core/varsync"
echo "2. Install Python wrapper: cd varbridge-py && pip install -e ."
echo "3. Install Node.js wrapper: cd varbridge-js && npm install"
echo "4. Run examples: python3 examples/cross_language_demo.py"
echo ""
print_success "VarSync is ready to use! 🎉"