From 6ae6806e79df5ce22e90b65a4e0d9c5c30652c60 Mon Sep 17 00:00:00 2001 From: Guillaume Algis Date: Mon, 28 Sep 2015 21:19:22 +0200 Subject: [PATCH] Use Alcatraz-Info.plist as the single source of thruth for bundle version Removed ATZVersion.h --- Alcatraz.xcodeproj/project.pbxproj | 2 -- Alcatraz/ATZVersion.h | 30 ------------------- Alcatraz/Alcatraz-Info.plist | 2 +- .../Controllers/ATZPluginWindowController.m | 3 +- Makefile | 5 ++-- 5 files changed, 4 insertions(+), 38 deletions(-) delete mode 100644 Alcatraz/ATZVersion.h diff --git a/Alcatraz.xcodeproj/project.pbxproj b/Alcatraz.xcodeproj/project.pbxproj index 1f583d6..e707c7f 100644 --- a/Alcatraz.xcodeproj/project.pbxproj +++ b/Alcatraz.xcodeproj/project.pbxproj @@ -66,7 +66,6 @@ 0C7AF64F186B4E890064EE7B /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 32BDEBC2173A46A900513A7C /* eye_icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = eye_icon.png; sourceTree = ""; }; 32D86503173A4555009C724B /* eye_icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "eye_icon@2x.png"; sourceTree = ""; }; - 6449530218CE826C009494BD /* ATZVersion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ATZVersion.h; sourceTree = ""; }; 64EDC500188CB55A00D45F1D /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 890A4B3F171F031300AFE577 /* Alcatraz.xcplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Alcatraz.xcplugin; sourceTree = BUILT_PRODUCTS_DIR; }; 890A4B42171F031300AFE577 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; @@ -220,7 +219,6 @@ 890A4B4C171F031300AFE577 /* Alcatraz.h */, 890A4B4D171F031300AFE577 /* Alcatraz.m */, 890A4B47171F031300AFE577 /* Supporting Files */, - 6449530218CE826C009494BD /* ATZVersion.h */, ); path = Alcatraz; sourceTree = ""; diff --git a/Alcatraz/ATZVersion.h b/Alcatraz/ATZVersion.h deleted file mode 100644 index 55e4386..0000000 --- a/Alcatraz/ATZVersion.h +++ /dev/null @@ -1,30 +0,0 @@ -// -// ATZVersion.h -// -// Copyright (c) 2014 Marin Usalj | supermar.in -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#ifndef Alcatraz_Version_h -#define Alcatraz_Version_h - -#define ATZ_VERSION "1.1.8" - -#endif - diff --git a/Alcatraz/Alcatraz-Info.plist b/Alcatraz/Alcatraz-Info.plist index 9a06dea..6de8881 100644 --- a/Alcatraz/Alcatraz-Info.plist +++ b/Alcatraz/Alcatraz-Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.0 + 1.1.8 CFBundleSignature ???? CFBundleVersion diff --git a/Alcatraz/Controllers/ATZPluginWindowController.m b/Alcatraz/Controllers/ATZPluginWindowController.m index 43e0412..fc98e46 100644 --- a/Alcatraz/Controllers/ATZPluginWindowController.m +++ b/Alcatraz/Controllers/ATZPluginWindowController.m @@ -26,7 +26,6 @@ #import "ATZDownloader.h" #import "Alcatraz.h" #import "ATZPackageFactory.h" -#import "ATZVersion.h" #import "ATZPlugin.h" #import "ATZColorScheme.h" @@ -274,7 +273,7 @@ - (void)displayImage:(NSImage *)image withTitle:(NSString*)title { } - (void)addVersionToWindow { - self.versionTextField.stringValue = @(ATZ_VERSION); + self.versionTextField.stringValue = [[[Alcatraz sharedPlugin] bundle] infoDictionary][@"CFBundleShortVersionString"]; } @end diff --git a/Makefile b/Makefile index 436c366..eebef7d 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,9 @@ ARCHIVE = "Alcatraz.tar.gz" BUNDLE_NAME = "Alcatraz.xcplugin" -VERSION_LOCATION = "Alcatraz/ATZVersion.h" INSTALL_PATH = ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/${BUNDLE_NAME}/ TEST_BUILD_ARGS = -workspace TestProject/TestProject.xcworkspace -scheme TestProject XCODEBUILD = xcodebuild $(TEST_BUILD_ARGS) -VERSION = $(shell grep 'ATZ_VERSION' Alcatraz/ATZVersion.h | cut -d " " -f 3 | tr -d '"') +VERSION = $(shell /usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" Alcatraz/Alcatraz-Info.plist) default: test @@ -56,6 +55,6 @@ tag: git tag $(VERSION) update_install_url: - sed -i '' -e 's/[.0-9]\{3,5\}/${VERSION}/' Scripts/install.sh + sed -i '' -Ee 's/[0-9]+(\.[0-9]+){2}/${VERSION}/' Scripts/install.sh git commit -am "updated install script for version $(VERSION)"