From e5f67102f55254982b2b3c5448e6763ea0a181cb Mon Sep 17 00:00:00 2001 From: Geoffrey Foster Date: Thu, 6 Jun 2019 23:53:19 -0400 Subject: [PATCH] proper error output, deleting unneeded stuff, version bump --- Makefile | 42 ----------------------------------- Sources/XcoderKit/Error.swift | 6 ++++- Sources/xcoder/Version.swift | 2 +- Version.swift.template | 5 ----- overrides.xcconfig | 1 - 5 files changed, 6 insertions(+), 50 deletions(-) delete mode 100644 Makefile delete mode 100644 Version.swift.template delete mode 100644 overrides.xcconfig diff --git a/Makefile b/Makefile deleted file mode 100644 index 7e8d892..0000000 --- a/Makefile +++ /dev/null @@ -1,42 +0,0 @@ -TOOL_NAME = xcoder -VERSION = 0.3.0 - -REPO = https://github.com/g-Off/$(TOOL_NAME) -RELEASE_TAR = $(REPO)/archive/$(VERSION).tar.gz -SHA = $(shell curl -L -s $(RELEASE_TAR) | shasum -a 256 | sed 's/ .*//') - -PREFIX = /usr/local -INSTALL_PATH = $(PREFIX)/bin/$(TOOL_NAME) -BUILD_PATH = $(shell swift build --show-bin-path -c $(CONFIGURATION))/$(TOOL_NAME) - -SWIFTC_FLAGS = -Xswiftc "-target" -Xswiftc "x86_64-apple-macosx10.12" -CONFIGURATION = debug - -debug: generate_version -debug: build - -generate_version: - @sed 's/__VERSION__/$(VERSION)/g' Version.swift.template > Sources/xcoder/Version.swift - -release_sha: - @echo $(SHA) - -build: - swift build --configuration $(CONFIGURATION) $(SWIFTC_FLAGS) - -install: CONFIGURATION = release -install: SWIFTC_FLAGS += --static-swift-stdlib --disable-sandbox -install: clean build - mkdir -p $(PREFIX)/bin - cp -f $(BUILD_PATH) $(INSTALL_PATH) - -test: - swift test $(SWIFTC_FLAGS) - -xcode: generate_version -xcode: - swift package generate-xcodeproj --xcconfig-overrides=Overrides.xcconfig - xed . - -clean: - swift package clean diff --git a/Sources/XcoderKit/Error.swift b/Sources/XcoderKit/Error.swift index 2d3f503..8875843 100644 --- a/Sources/XcoderKit/Error.swift +++ b/Sources/XcoderKit/Error.swift @@ -7,7 +7,7 @@ import Foundation -enum Error: Swift.Error, CustomStringConvertible { +enum Error: LocalizedError, CustomStringConvertible { case invalidProject(path: String?) case invalidGroup(String) case invalidTarget(String) @@ -26,4 +26,8 @@ enum Error: Swift.Error, CustomStringConvertible { return "Invalid target \(targetName)" } } + + var errorDescription: String? { + return description + } } diff --git a/Sources/xcoder/Version.swift b/Sources/xcoder/Version.swift index 1781604..60c405c 100644 --- a/Sources/xcoder/Version.swift +++ b/Sources/xcoder/Version.swift @@ -1,5 +1,5 @@ import Utility extension Version { - static var current: Version = "0.3.1" + static var current: Version = "0.3.2" } diff --git a/Version.swift.template b/Version.swift.template deleted file mode 100644 index a6e9e7b..0000000 --- a/Version.swift.template +++ /dev/null @@ -1,5 +0,0 @@ -import Utility - -extension Version { - static var current: Version = "__VERSION__" -} diff --git a/overrides.xcconfig b/overrides.xcconfig deleted file mode 100644 index a94a510..0000000 --- a/overrides.xcconfig +++ /dev/null @@ -1 +0,0 @@ -MACOSX_DEPLOYMENT_TARGET = 10.11