2018-02-27 03:41:46 +03:00
|
|
|
TOOL_NAME = XcodeGen
|
2018-03-03 02:02:38 +03:00
|
|
|
export EXECUTABLE_NAME = xcodegen
|
2024-02-14 13:48:13 +03:00
|
|
|
VERSION = 2.39.0
|
2017-07-28 15:13:41 +03:00
|
|
|
|
2017-09-23 18:22:22 +03:00
|
|
|
PREFIX = /usr/local
|
2018-03-03 02:02:38 +03:00
|
|
|
INSTALL_PATH = $(PREFIX)/bin/$(EXECUTABLE_NAME)
|
|
|
|
SHARE_PATH = $(PREFIX)/share/$(EXECUTABLE_NAME)
|
2017-07-28 14:55:36 +03:00
|
|
|
CURRENT_PATH = $(PWD)
|
2018-07-15 14:37:49 +03:00
|
|
|
REPO = https://github.com/yonaskolb/$(TOOL_NAME)
|
2017-10-28 20:58:56 +03:00
|
|
|
RELEASE_TAR = $(REPO)/archive/$(VERSION).tar.gz
|
|
|
|
SHA = $(shell curl -L -s $(RELEASE_TAR) | shasum -a 256 | sed 's/ .*//')
|
2021-02-25 05:51:50 +03:00
|
|
|
SWIFT_BUILD_FLAGS = --disable-sandbox -c release --arch arm64 --arch x86_64
|
2022-12-07 03:20:24 +03:00
|
|
|
BUILD_PATH = $(shell swift build $(SWIFT_BUILD_FLAGS) --show-bin-path)
|
|
|
|
EXECUTABLE_PATH = $(BUILD_PATH)/$(EXECUTABLE_NAME)
|
2017-10-28 20:58:56 +03:00
|
|
|
|
2019-11-01 02:13:27 +03:00
|
|
|
.PHONY: install build uninstall format_code brew release
|
2017-07-28 14:55:36 +03:00
|
|
|
|
2017-09-23 18:22:22 +03:00
|
|
|
install: build
|
|
|
|
mkdir -p $(PREFIX)/bin
|
2021-05-01 05:54:59 +03:00
|
|
|
cp -f $(EXECUTABLE_PATH) $(INSTALL_PATH)
|
2017-08-24 02:22:51 +03:00
|
|
|
mkdir -p $(SHARE_PATH)
|
|
|
|
cp -R $(CURRENT_PATH)/SettingPresets $(SHARE_PATH)/SettingPresets
|
2017-09-23 18:22:22 +03:00
|
|
|
|
|
|
|
build:
|
2021-02-25 05:51:50 +03:00
|
|
|
swift build $(SWIFT_BUILD_FLAGS)
|
2017-09-23 18:22:22 +03:00
|
|
|
|
2017-07-28 14:55:36 +03:00
|
|
|
uninstall:
|
2017-09-18 23:47:52 +03:00
|
|
|
rm -f $(INSTALL_PATH)
|
2017-09-23 18:22:22 +03:00
|
|
|
rm -rf $(SHARE_PATH)
|
|
|
|
|
2017-10-28 20:58:56 +03:00
|
|
|
format_code:
|
2019-01-28 14:18:27 +03:00
|
|
|
swiftformat .
|
2017-10-28 20:58:56 +03:00
|
|
|
|
2019-03-31 13:58:31 +03:00
|
|
|
release:
|
|
|
|
sed -i '' 's|\(let version = Version("\)\(.*\)\(")\)|\1$(VERSION)\3|' Sources/XcodeGen/main.swift
|
2019-04-09 15:14:21 +03:00
|
|
|
sed -i '' 's|\(.package(url: "https://github.com/yonaskolb/XcodeGen.git", from: "\)\(.*\)\(")\)|\1$(VERSION)\3|' README.md
|
2017-10-28 20:58:56 +03:00
|
|
|
|
|
|
|
git add .
|
|
|
|
git commit -m "Update to $(VERSION)"
|
2018-08-22 17:28:59 +03:00
|
|
|
#git tag $(VERSION)
|
2018-02-25 11:11:48 +03:00
|
|
|
|
2019-11-01 02:13:27 +03:00
|
|
|
publish: archive brew
|
2018-07-15 14:37:49 +03:00
|
|
|
echo "published $(VERSION)"
|
|
|
|
|
2019-11-01 02:13:27 +03:00
|
|
|
brew:
|
2018-08-19 07:27:51 +03:00
|
|
|
brew update
|
2018-08-19 07:54:27 +03:00
|
|
|
brew bump-formula-pr --url=$(RELEASE_TAR) XcodeGen
|
2018-07-15 14:37:49 +03:00
|
|
|
|
2018-02-25 11:11:48 +03:00
|
|
|
archive: build
|
2022-02-09 03:30:23 +03:00
|
|
|
./scripts/archive.sh "$(EXECUTABLE_PATH)"
|