diff --git a/Makefile b/Makefile index 331224d..3990800 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ TOOL_NAME = stringray -VERSION = 0.1.1 +VERSION = 0.2.0 REPO = https://github.com/g-Off/$(TOOL_NAME) RELEASE_TAR = $(REPO)/archive/$(VERSION).tar.gz @@ -13,8 +13,12 @@ SWIFTC_FLAGS = -Xswiftc "-target" -Xswiftc "x86_64-apple-macosx10.13" CONFIGURATION = debug +debug: generate_version debug: build +generate_version: + @sed 's/__VERSION__/$(VERSION)/g' Version.swift.template > Sources/stringray/Version.swift + release: @echo $(SHA) @@ -30,8 +34,10 @@ install: clean build test: swift test $(SWIFTC_FLAGS) +xcode: generate_version xcode: - swift package generate-xcodeproj --xcconfig-overrides=Overrides.xcconfig | xed . + swift package generate-xcodeproj --xcconfig-overrides=Overrides.xcconfig + xed . clean: swift package clean diff --git a/Sources/stringray/Version.swift b/Sources/stringray/Version.swift new file mode 100644 index 0000000..d93bfd1 --- /dev/null +++ b/Sources/stringray/Version.swift @@ -0,0 +1,5 @@ +import Utility + +extension Version { + static var current: Version = "0.2.0" +} diff --git a/Sources/stringray/main.swift b/Sources/stringray/main.swift index c5e5bfa..f393736 100644 --- a/Sources/stringray/main.swift +++ b/Sources/stringray/main.swift @@ -10,7 +10,7 @@ import Foundation import Utility import CommandRegistry -var registry = Registry(usage: " ", overview: "", version: Version(0, 1, 1)) +var registry = Registry(usage: " ", overview: "", version: Version.current) registry.register(command: MoveCommand.self) registry.register(command: CopyCommand.self) registry.register(command: SortCommand.self) diff --git a/Version.swift.template b/Version.swift.template new file mode 100644 index 0000000..a6e9e7b --- /dev/null +++ b/Version.swift.template @@ -0,0 +1,5 @@ +import Utility + +extension Version { + static var current: Version = "__VERSION__" +}