docker_image_name := "swift-hpa" install_path := "~/.local/share/bin/hpa" completion_path := "~/.local/share/zsh/completions/_hpa" tap_url := "https://git.housh.dev/michael/homebrew-formula" tap := "michael/formula" formula := "hpa" # Build and bottle homebrew formula. bottle: @brew uninstall {{formula}} || true @brew tap {{tap}} {{tap_url}} @brew install --build-bottle {{formula}} @brew bottle {{formula}} --json bottle="$(ls *.gz)" && mv "${bottle}" "${bottle/--/-}" # Build the command-line tool. build mode="debug": swift build -c {{mode}} alias b := build # Build the docker image. build-docker file="Dockerfile" tag="latest": @docker build \ --file docker/{{file}} \ --tag {{docker_image_name}}:{{tag}} . build-docker-test: (build-docker "Dockerfile.test" "test") # Build the docker test image used for testing. build-docker-test: (build-docker "Dockerfile.test" "test") # Run tests. test *ARGS: swift test {{ARGS}} alias t := test # Run tests in docker container. test-docker *ARGS: (build-docker-test) @docker run --rm \ --network host \ {{docker_image_name}}:test \ swift test {{ARGS}} # Run the application. run *ARGS: swift run hpa {{ARGS}} alias r := run # Clean the build folder. clean: rm -rf .build # Bump the version based on the git tag. update-version: @swift package \ --disable-sandbox \ --allow-writing-to-package-directory \ update-version \ hpa