Skip to content

Commit

Permalink
Merge branch 'upstream/master'
Browse files Browse the repository at this point in the history
* upstream/master: (235 commits)
  Changelog
  percent encode the filename used in the delta url
  Detect and fail if any two-way dependencies exist in the project
  Update Sparkle.strings
  Update Sparkle.strings
  Don't touch Info.plist unless git version changes
  Add my name to LICENSE
  Fix sparkle-project#1020
  Formatting
  Delta minor version fix
  Simplify minor delta version down to int
  Use the same fileSystemRepresentation function for both parts of the path
  Make normalizedInstallationPathForHost also normalize Unicode
  Test with non-ASCII names
  Typo
  Don't remove the temporary unarchive directory in unit tests
  Removed unimportant changelog entry
  Updated changelog
  Remove nonsense logging I had for debugging purposes
  Add kqueue based termination listener
  ...

# Conflicts:
#	Sparkle/SUBasicUpdateDriver.m
#	Sparkle/SUConstants.h
#	Sparkle/SUConstants.m
#	Sparkle/SUUpdater.h
  • Loading branch information
martinwinter committed Feb 10, 2017
2 parents dc61a5a + f43c836 commit 2c02498
Show file tree
Hide file tree
Showing 272 changed files with 6,937 additions and 4,297 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ Icon
.Spotlight-V100
.Trashes

# With Carthage, if Sparkle is included as a Git submodule (e.g. with the
# --use-submodules option), the main module's .gitignore can't reach all the
# way inside the submodule to ignore the added Carthage/Build symlink, and Git
# keeps complaining about untracked changes in the submodule forever, which
# is very annoying. To avoid that issue, ignore here in Sparkle instead.
Carthage/Build

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Expand Down
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
language: objective-c
osx_image: xcode7
osx_image: xcode8.2
before_install:
- brew update
- brew install macmade/tap/xcode-coveralls
script: make ci
after_success: xcode-coveralls --exclude /Applications --exclude Tests --exclude Vendor build/Build/Intermediates/Sparkle.build/Coverage/Sparkle.build/Objects-normal/x86_64
74 changes: 70 additions & 4 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,69 @@
# 1.17.0

* Added Touch Bar support (Bi11)
* Upgraded SULog to use logging APIs that Apple provides built-in (Zorg)
* Skip buttons are disabled if the update is marked as critical (Kornel Lesiński)
* Background updates ask OS for lower-priority networking (Kornel Lesiński)
* Refactorings to sync with upcoming 2.0
* Added kqueue based termination listener (Zorg)
* Added AppKit prevention guards to modules that shouldn't import it (Zorg)
* Added Obj-C generics where applicable (Zorg)
* Made SUBundleIcon & SUApplicationInfo take SUHost, not NSBundle (Zorg)
* Improved -[SUHost objectForInfoDictionaryKey:] (Zorg)
* Detect and fail if any two-way dependencies exist in the project (Zorg)
* generate_appcast:
* fixed handling of multiple directories in an archive
* percent encode the filename used in the delta url (Brett Walker)
* Update Sparkle.strings (BR Lingo)
* Improved handling of non-ASCII names in delta archives (Kornel Lesiński)
* Don't touch Info.plist unless git version changes (Václav Slavík)

# 1.16.0

* Guided package installs are now the default for updating packages (Zorg)
- `pkg` installers won't show any UI. If you require the old behavior of showing a full installer window, rename the `*.pkg` file to `*.sparkle_interactive.pkg`
* Previous version of the app is now deleted instead of staying in the trash (Zorg)
* Added `generate_appcast` helper tool (Kornel Lesiński)
* Made manual check resume pending automatic updates instead of starting a new update (Kornel Lesiński)
* Started using `length` value from RSS if HTTP doesn't give one (Zorg)
* Hidden automatic updates checkbox for information only updates (Bi11)
* Added progressbar for DMG and binary delta extraction (Kornel Lesiński)
* Fixed showing of download status if we attempt a 2nd download (Zorg)
* Refactorings to sync with upcoming 2.0
* Decoupled and simplified installation code using protocols (Zorg)
* Added nullability annotations (Zorg)
* Allowed delegate methods that return an object to return nil (Zorg)
* Decreased responsibility of SUHost and moved code into other components (Zorg)
* Removed Sparkle.pch and many file #includes (Zorg)

# 1.15.0

* A new icon! Thanks to 1024jp
* Show alert when an update is sent over insecure HTTP with no DSA key (Zorg)
- If you can't use HTTPS, you must at least sign updates with a DSA key.
* Improved binary delta implementation (Zorg)
* Added improved -validateMenuItem: as a method in SUUpdater.h for public use (Zorg)
* Removed reachability preflight check (Zorg)
* Clear update caches directory before downloading new update (Zorg)
* Check the bundle's parent directory for writability too (Zorg)
* Don't follow symbolic links for file operations (Zorg)
* Don't bring up an authorized dialog during cleanup (Zorg)
* Made Sparkle look for the highest compatible version regardless of timestamps (Zorg)
* Fixed compatibility with 10.7
* Fixed crash on 10.7 - subscript operator not available (kleuter)
* Fixed warnings caused by -Wpartial-availability (Zorg)
* Fixed german l10n. (Sebastian Volland)
* Error code for download errors (Kornel Lesiński)
* Update last update check date when the update driver finishes (Zorg)
* Scale app icon up if needed in Software Update window (Nicholas Riley)
* Don't register for termination notifications more than once (Zorg)
* Don't terminate the app if we're already terminating (Zorg)
* Removed SUEnableAutomaticChecksKeyOld and SUCheckAtStartup constants (Eitot)
* Updated Sparkle framework headers to use modules if modules are available (B. Kevin Hardman)
* Fixed warnings, fixed uses of SULocalizedString (Jerry Krinock)
* Improved signing verifier to take any host and s/application/bundle/ (Zorg)
* Improved Spotlight updates after delta extraction (Zorg)

# 1.14.0 (Mar 11, 2016)

* Disable javascript by default and make it opt-in (Zorg)
Expand Down Expand Up @@ -35,7 +101,7 @@ Important security fixes:
- Strong documentation, easier to read code.
* Automatic updates won't be installed if the system is about to shut off (Zorg)
* Deprecated serving over HTTP without DSA (Zorg)
- Note that Apple has deprecated insecure HTTP in OS X 10.11
- Note that Apple has deprecated insecure HTTP in macOS 10.11
* Improved Autoupdate application (Zorg)
* Do all the installation work after the runloop is set up
* TerminationListener only does termination listening now
Expand Down Expand Up @@ -133,12 +199,12 @@ Important security fixes:

# 1.8.0 (Jul 26, 2014)

* New SUDSAVerifier based on up-to-date OS X APIs (Zachary Waldowski)
* New SUDSAVerifier based on up-to-date macOS APIs (Zachary Waldowski)
* Detailed error log for failed signature checks (Kornel Lesiński)
* Converted Sparkle to ARC (C.W. Betts)
* Converted ivars to properties. (Jake Petroules)
* Cocoapod support (Xhacker Liu)
* Quarantine removal on OS X 10.10 (C.W. Betts)
* Quarantine removal on macOS 10.10 (C.W. Betts)
* Updated Japanese localization (1024jp)
* Added Greek localization

Expand All @@ -159,7 +225,7 @@ Important security fixes:

# 1.7.0

* Dropped support for OS X 10.6. Sparkle now supports 10.7 and newer (including 10.10 Yosemite) on 64-bit Intel Macs (the last 32-bit Mac was released in 2006).
* Dropped support for macOS 10.6. Sparkle now supports 10.7 and newer (including 10.10 Yosemite) on 64-bit Intel Macs (the last 32-bit Mac was released in 2006).
* Removed use of deprecated functions (Zachary Waldowski)
* Switched to modern Obj-C runtime and new literals syntax
* Removed pre-10.7 code. (C.W. Betts)
Expand Down
74 changes: 74 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at kornel+sparkle@geekhood.net. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
13 changes: 7 additions & 6 deletions Configurations/ConfigCommon.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

SPARKLE_BUNDLE_IDENTIFIER = org.sparkle-project.Sparkle
SPARKLE_RELAUNCH_TOOL_NAME = Autoupdate
SPARKLE_FILEOP_TOOL_NAME = fileop

SPARKLE_APPEND_VERSION_NUMBER = 1

Expand All @@ -15,28 +16,29 @@ SPARKLE_AUTOMATED_DOWNGRADES = 0
SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME = 0

SPARKLE_VERSION_MAJOR = 1
SPARKLE_VERSION_MINOR = 14
SPARKLE_VERSION_MINOR = 17
SPARKLE_VERSION_PATCH = 0
SPARKLE_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)

CURRENT_PROJECT_VERSION = $(SPARKLE_VERSION)
ALWAYS_SEARCH_USER_PATHS = NO
ENABLE_STRICT_OBJC_MSGSEND = YES
GCC_PRECOMPILE_PREFIX_HEADER = YES
GCC_PREFIX_HEADER = Sparkle/Sparkle.pch
GCC_SYMBOLS_PRIVATE_EXTERN = YES
GCC_INLINES_ARE_PRIVATE_EXTERN = YES
ARCHS = $(ARCHS_STANDARD)
MACOSX_DEPLOYMENT_TARGET = 10.7
PRODUCT_NAME = ${TARGET_NAME}
PRODUCT_BUNDLE_IDENTIFIER = org.sparkle-project.Sparkle.${PRODUCT_NAME:rfc1034identifier}

GCC_PREPROCESSOR_DEFINITIONS_COMMON = SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME=$(SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME) SPARKLE_AUTOMATED_DOWNGRADES=$(SPARKLE_AUTOMATED_DOWNGRADES) SPARKLE_APPEND_VERSION_NUMBER=$(SPARKLE_APPEND_VERSION_NUMBER) SPARKLE_BUNDLE_IDENTIFIER=\"$(SPARKLE_BUNDLE_IDENTIFIER)\" SPARKLE_RELAUNCH_TOOL_NAME=\"$(SPARKLE_RELAUNCH_TOOL_NAME)\"
GCC_PREPROCESSOR_DEFINITIONS_COMMON = SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME=$(SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME) SPARKLE_AUTOMATED_DOWNGRADES=$(SPARKLE_AUTOMATED_DOWNGRADES) SPARKLE_APPEND_VERSION_NUMBER=$(SPARKLE_APPEND_VERSION_NUMBER) SPARKLE_BUNDLE_IDENTIFIER=\"$(SPARKLE_BUNDLE_IDENTIFIER)\" SPARKLE_RELAUNCH_TOOL_NAME=\"$(SPARKLE_RELAUNCH_TOOL_NAME)\" SPARKLE_FILEOP_TOOL_NAME=\"$(SPARKLE_FILEOP_TOOL_NAME)\"

CLANG_ENABLE_OBJC_ARC = YES
GCC_ENABLE_PASCAL_STRINGS = NO
GCC_NO_COMMON_BLOCKS = YES;
COMBINE_HIDPI_IMAGES = NO;

// Enable warnings
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES
Expand All @@ -51,7 +53,6 @@ CLANG_WARN_OBJC_EXPLICIT_OWNERSHIP_TYPE = YES
CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS = YES
CLANG_WARN_OBJC_RECEIVER_WEAK = YES
CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES
CLANG_WARN_UNREACHABLE_CODE = YES
Expand Down Expand Up @@ -87,4 +88,4 @@ CLANG_ENABLE_MODULES[sdk=macosx10.8] = NO
WARNING_CFLAGS_EXTRA = -Wno-custom-atomic-properties -Wno-implicit-atomic-properties

// Turn on all warnings, then disable a few which are almost impossible to avoid
WARNING_CFLAGS = -Wall -Weverything -Wno-unused-macros -Wno-gnu-statement-expression -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wno-auto-import $(WARNING_CFLAGS_EXTRA)
WARNING_CFLAGS = -Wall -Weverything -Wno-unused-macros -Wno-gnu-statement-expression -Wno-arc-repeated-use-of-weak -Wno-auto-import $(WARNING_CFLAGS_EXTRA)
1 change: 0 additions & 1 deletion Configurations/ConfigCommonDebug.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// Debug only

GCC_OPTIMIZATION_LEVEL = 0
SWIFT_OPTIMIZATION_LEVEL = -Onone
DEBUG_INFORMATION_FORMAT = dwarf
ENABLE_TESTABILITY = YES
GCC_GENERATE_DEBUGGING_SYMBOLS = YES
Expand Down
1 change: 0 additions & 1 deletion Configurations/ConfigCommonRelease.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// Release only

GCC_OPTIMIZATION_LEVEL = s
SWIFT_OPTIMIZATION_LEVEL = -Ofast
DEBUG_INFORMATION_FORMAT = dwarf-with-dsym
GCC_GENERATE_DEBUGGING_SYMBOLS = YES
GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS_COMMON)
Expand Down
5 changes: 5 additions & 0 deletions Configurations/ConfigFileop.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Fileop tool only

PRODUCT_NAME = $(SPARKLE_FILEOP_TOOL_NAME)
SKIP_INSTALL = YES
CLANG_ENABLE_MODULES = NO
7 changes: 7 additions & 0 deletions Configurations/ConfigGenerateAppcast.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Generate Appcast only

#include "ConfigSwift.xcconfig"

SWIFT_OBJC_BRIDGING_HEADER = generate_appcast/Appcast-Bridging-Header.h
MACOSX_DEPLOYMENT_TARGET = 10.11
PRODUCT_NAME = generate_appcast
4 changes: 4 additions & 0 deletions Configurations/ConfigGenerateAppcastDebug.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Generate Appcast Debug

#include "ConfigGenerateAppcast.xcconfig"
#include "ConfigSwiftDebug.xcconfig"
4 changes: 4 additions & 0 deletions Configurations/ConfigGenerateAppcastRelease.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Generate Appcast Release

#include "ConfigGenerateAppcast.xcconfig"
#include "ConfigSwiftRelease.xcconfig"
1 change: 1 addition & 0 deletions Configurations/ConfigSwift.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SWIFT_VERSION = 3.0
1 change: 1 addition & 0 deletions Configurations/ConfigSwiftDebug.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SWIFT_OPTIMIZATION_LEVEL = -Onone
1 change: 1 addition & 0 deletions Configurations/ConfigSwiftRelease.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SWIFT_OPTIMIZATION_LEVEL = -Owholemodule
2 changes: 2 additions & 0 deletions Configurations/ConfigUITest.xcconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// UI Test only

#include "ConfigSwift.xcconfig"

INFOPLIST_FILE = UITests/UITests-Info.plist
WRAPPER_EXTENSION = xctest
MACOSX_DEPLOYMENT_TARGET = 10.11
Expand Down
1 change: 1 addition & 0 deletions Configurations/ConfigUITestDebug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include "ConfigUITest.xcconfig"
#include "ConfigSwiftDebug.xcconfig"
1 change: 1 addition & 0 deletions Configurations/ConfigUITestRelease.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include "ConfigUITest.xcconfig"
#include "ConfigSwiftRelease.xcconfig"
2 changes: 2 additions & 0 deletions Configurations/ConfigUnitTest.xcconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Unit Test only

#include "ConfigSwift.xcconfig"

INFOPLIST_FILE = Tests/SparkleTests-Info.plist
WRAPPER_EXTENSION = xctest
OTHER_CFLAGS = $(inherited) -iframework"$(DEVELOPER_FRAMEWORKS_DIR)" -iframework"$(PLATFORM_DIR)/Developer/Library/Frameworks"
Expand Down
1 change: 1 addition & 0 deletions Configurations/ConfigUnitTestDebug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include "ConfigUnitTest.xcconfig"
#include "ConfigSwiftDebug.xcconfig"
1 change: 1 addition & 0 deletions Configurations/ConfigUnitTestRelease.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include "ConfigUnitTest.xcconfig"
#include "ConfigSwiftRelease.xcconfig"
9 changes: 9 additions & 0 deletions Configurations/make-release-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,29 @@
set -e

if [ "$ACTION" = "" ] ; then
# Sanity check that the Podspec version matches the Sparkle version
spec_version=$(printf "require 'cocoapods'\nspec = %s\nprint spec.version" "$(cat "$SRCROOT/Sparkle.podspec")" | LANG=en_US.UTF-8 ruby)
if [ "$spec_version" != "$CURRENT_PROJECT_VERSION" ] ; then
echo "podspec version '$spec_version' does not match the current project version '$CURRENT_PROJECT_VERSION'" >&2
exit 1
fi

rm -rf "$CONFIGURATION_BUILD_DIR/staging"
rm -f "Sparkle-$CURRENT_PROJECT_VERSION.tar.bz2"

mkdir -p "$CONFIGURATION_BUILD_DIR/staging"
cp "$SRCROOT/CHANGELOG" "$SRCROOT/LICENSE" "$SRCROOT/Resources/SampleAppcast.xml" "$CONFIGURATION_BUILD_DIR/staging"
cp -R "$SRCROOT/bin" "$CONFIGURATION_BUILD_DIR/staging"
cp "$CONFIGURATION_BUILD_DIR/BinaryDelta" "$CONFIGURATION_BUILD_DIR/staging/bin"
cp "$CONFIGURATION_BUILD_DIR/generate_appcast" "$CONFIGURATION_BUILD_DIR/staging/bin"
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app" "$CONFIGURATION_BUILD_DIR/staging"
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.framework" "$CONFIGURATION_BUILD_DIR/staging"

# Only copy dSYMs for Release builds, but don't check for the presence of the actual files
# because missing dSYMs in a release build SHOULD trigger a build failure
if [ "$CONFIGURATION" = "Release" ] ; then
cp -R "$CONFIGURATION_BUILD_DIR/BinaryDelta.dSYM" "$CONFIGURATION_BUILD_DIR/staging/bin"
cp -R "$CONFIGURATION_BUILD_DIR/generate_appcast.dSYM" "$CONFIGURATION_BUILD_DIR/staging/bin"
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app.dSYM" "$CONFIGURATION_BUILD_DIR/staging"
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.framework.dSYM" "$CONFIGURATION_BUILD_DIR/staging"
fi
Expand Down
26 changes: 19 additions & 7 deletions Configurations/set-git-version-info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,28 @@ if [ -z "$SRCROOT" ] || \
exit 1
fi

# Get the current Git master hash
version=$(cd "$SRCROOT" ; git show-ref --abbrev heads/master | awk '{print $1}')
if [ -z "$version" ] ; then
echo "$0: Can't find a Git hash!" 1>&2
version="$CURRENT_PROJECT_VERSION"

# Get version in format 1.x.x-commits-hash
gitversion=$( cd "$SRCROOT"; git describe --tags --match '[12].*' || true )
if [ -z "$gitversion" ] ; then
echo "$0: Can't find a Git hash!" 1>&2
exit 0
fi

version="$CURRENT_PROJECT_VERSION git-$version"
# remove everything before the first "-" to keep the hash part only
versionsuffix=${gitversion#*-};
if [ "$versionsuffix" != "$gitversion" ]; then
version="$version $versionsuffix"
fi

# and use it to set the CFBundleShortVersionString value
export PATH="$PATH:/usr/libexec"
PlistBuddy -c "Set :CFBundleShortVersionString '$version'" \
"$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH"

if [ -f "$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH" ] ; then
oldversion=$(PlistBuddy -c "Print :CFBundleShortVersionString" "$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH")
fi
if [ "$version" != "$oldversion" ] ; then
PlistBuddy -c "Set :CFBundleShortVersionString '$version'" \
"$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH"
fi
Loading

0 comments on commit 2c02498

Please sign in to comment.