-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJustfile
More file actions
133 lines (109 loc) · 3.42 KB
/
Copy pathJustfile
File metadata and controls
133 lines (109 loc) · 3.42 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
# TesseractSwift build commands
# Default command - show available commands
default:
@just --list
# Build the Swift package
build:
swift build
# Build for release
build-release:
swift build -c release
# Run tests
test:
swift test
# Run tests with coverage
test-coverage:
swift test --enable-code-coverage
# Clean build artifacts
clean:
swift package clean
rm -rf .build
# Update package dependencies
update:
swift package update
# Generate Xcode project
xcode:
swift package generate-xcodeproj
open *.xcodeproj
# Build documentation
docs:
swift package generate-documentation
# Lint Swift code
lint:
if command -v swiftlint >/dev/null 2>&1; then \
swiftlint; \
else \
echo "SwiftLint not installed. Install with: brew install swiftlint"; \
fi
# Format Swift code
format:
if command -v swift-format >/dev/null 2>&1; then \
swift-format -i -r Sources/ Tests/; \
else \
echo "swift-format not installed. Install with: brew install swift-format"; \
fi
# Create XCFrameworks from static libraries
create-xcframeworks:
./Scripts/create-xcframeworks.sh
# Patch XCFramework headers
patch-headers:
./Scripts/patch-headers.sh
# Build for iOS simulator
build-ios:
xcodebuild -scheme TesseractSwift -destination 'platform=iOS Simulator,name=iPhone 15,OS=latest'
# Build for macOS
build-macos:
xcodebuild -scheme TesseractSwift -destination 'platform=macOS'
# Run example
run-example:
swift run TesseractSwiftExample
# Check Swift package manifest
check-manifest:
swift package dump-package
# Resolve package dependencies
resolve:
swift package resolve
# Show package dependencies
deps:
swift package show-dependencies
# Archive for release
archive NAME="TesseractSwift":
mkdir -p build/{{NAME}}
cp -r Sources build/{{NAME}}/
cp -r Tests build/{{NAME}}/
cp Package.swift build/{{NAME}}/
cp README.md build/{{NAME}}/
cp LICENSE build/{{NAME}}/
cp CHANGELOG.md build/{{NAME}}/
cd build && zip -r {{NAME}}.zip {{NAME}}
rm -rf build/{{NAME}}
echo "Archive created at build/{{NAME}}.zip"
# Validate package for Swift Package Index
validate-spi:
@echo "Validating package for Swift Package Index..."
@echo "✓ Checking Package.swift..."
@test -f Package.swift && echo " Package.swift exists" || echo " ❌ Package.swift missing"
@echo "✓ Checking README.md..."
@test -f README.md && echo " README.md exists" || echo " ❌ README.md missing"
@echo "✓ Checking LICENSE..."
@test -f LICENSE && echo " LICENSE exists" || echo " ❌ LICENSE missing"
@echo "✓ Checking version tag..."
@git describe --tags 2>/dev/null && echo " Version tags exist" || echo " ⚠️ No version tags (create with: git tag -a 1.0.0 -m 'Version 1.0.0')"
@echo "✓ Package validation complete!"
# Tag a new version
tag VERSION:
git tag -a v{{VERSION}} -m "Version {{VERSION}}"
@echo "Tagged version {{VERSION}}"
@echo "Push tags with: git push origin v{{VERSION}}"
# Full CI run
ci: clean lint build test
# Prepare for release
release VERSION: ci
@echo "Preparing release {{VERSION}}..."
just tag {{VERSION}}
just archive TesseractSwift-{{VERSION}}
@echo "Release {{VERSION}} prepared!"
@echo "Next steps:"
@echo "1. git push origin main"
@echo "2. git push origin v{{VERSION}}"
@echo "3. Create GitHub release with build/TesseractSwift-{{VERSION}}.zip"