Skip to content

Commit 10d6a42

Browse files
feat: add Makefile
1 parent c581323 commit 10d6a42

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

Makefile

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Variables
2+
SRC_NAME=Queuer
3+
4+
# Default target
5+
.DEFAULT_GOAL := help
6+
7+
.PHONY: help
8+
help:
9+
@echo "Available targets:"
10+
@awk 'BEGIN {FS = ":.*#"} /^[a-zA-Z_-]+:.*?#/ { printf " %-20s - %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
11+
12+
.PHONY: dependencies
13+
dependencies: # Install packages using SwiftPM
14+
@echo "Installing $(SRC_NAME) dependencies..."
15+
@swift package resolve
16+
17+
.PHONY: clean
18+
clean: # Clean up generated files
19+
@echo "Cleaning up build files..."
20+
@rm -rf .build
21+
22+
.PHONY: open
23+
open: # Open the project in Xcode
24+
@echo "Opening $(SRC_NAME) project..."
25+
@open Package.swift
26+
27+
.PHONY: lint
28+
lint: # Lint the project using swift-format
29+
@echo "Linting $(SRC_NAME) project..."
30+
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-format lint ./$(SRC_NAME) --recursive --configuration swift-format-config.json
31+
32+
.PHONY: format
33+
format: # Format the project using swift-format
34+
@echo "Formatting $(SRC_NAME) project..."
35+
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-format format ./$(SRC_NAME) --recursive --configuration swift-format-config.json --in-place
36+
37+
.PHONY: pre-commit-install
38+
pre-commit-install: # Install pre-commit hooks
39+
@echo "Installing pre-commit hooks..."
40+
@pre-commit install --hook-type commit-msg
41+
42+
.PHONY: setup
43+
setup: # Setup the project
44+
@echo "Setting up $(SRC_NAME) project..."
45+
@make clean
46+
@make pre-commit-install
47+
@make dependencies
48+
49+
.PHONY: test
50+
test: # Run tests
51+
@echo "Running tests..."
52+
@swift test
53+
54+
.PHONY: build
55+
build: # Build the project
56+
@echo "Building and uploading beta version..."
57+
@swift build

0 commit comments

Comments
 (0)