XcodeGen/Makefile

50 lines
1.4 KiB
Makefile
Raw Normal View History

2018-02-27 03:41:46 +03:00
TOOL_NAME = XcodeGen
export EXECUTABLE_NAME = xcodegen
2024-04-10 13:49:49 +03:00
VERSION = 2.40.1
2017-07-28 15:13:41 +03:00
2017-09-23 18:22:22 +03:00
PREFIX = /usr/local
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)
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:
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)"
2018-02-25 11:11:48 +03:00
archive: build
2022-02-09 03:30:23 +03:00
./scripts/archive.sh "$(EXECUTABLE_PATH)"
swift package plugin --allow-writing-to-package-directory generate-artifact-bundle \
--package-version $(VERSION) \
--executable-name $(EXECUTABLE_NAME) \
--build-config release \
--include-resource-path LICENSE