diff --git a/PoseGallery/PoseGallery.xcodeproj/project.pbxproj b/PoseGallery/PoseGallery.xcodeproj/project.pbxproj index 4d74bb1..98c4b3f 100644 --- a/PoseGallery/PoseGallery.xcodeproj/project.pbxproj +++ b/PoseGallery/PoseGallery.xcodeproj/project.pbxproj @@ -41,7 +41,7 @@ FA44C9DC1A499BCE00776BD6 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../../README.md; sourceTree = ""; }; FA44C9E01A4DE7E900776BD6 /* .travis.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = .travis.yml; path = ../../.travis.yml; sourceTree = ""; }; FA44CA151A4E0D0600776BD6 /* .slather.yml */ = {isa = PBXFileReference; lastKnownFileType = text; name = .slather.yml; path = ../../.slather.yml; sourceTree = ""; }; - FA6E64A11A279B7700395E94 /* Poses Pro.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Poses Pro.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + FA6E64A11A279B7700395E94 /* Poses Pro∆.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Poses Pro∆.app"; sourceTree = BUILT_PRODUCTS_DIR; }; FA6E64A51A279B7700395E94 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; FA6E64A61A279B7700395E94 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; FA6E64A81A279B7700395E94 /* FirstViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirstViewController.swift; sourceTree = ""; }; @@ -57,6 +57,7 @@ FAB13EF71A3878850053620A /* project_PoseGallery.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = project_PoseGallery.xcconfig; sourceTree = ""; }; FAB13EFF1A3878850053620A /* target_PoseGallery.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = target_PoseGallery.xcconfig; sourceTree = ""; }; FAB13F001A3878850053620A /* target_PoseGalleryTests.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = target_PoseGalleryTests.xcconfig; sourceTree = ""; }; + FAD9A7E01A4E5D70000DE885 /* script_tag_icon.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = script_tag_icon.sh; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -120,7 +121,7 @@ FA6E64A21A279B7700395E94 /* Products */ = { isa = PBXGroup; children = ( - FA6E64A11A279B7700395E94 /* Poses Pro.app */, + FA6E64A11A279B7700395E94 /* Poses Pro∆.app */, FA6E64B81A279B7800395E94 /* "PoseGalleryTests".xctest */, ); name = Products; @@ -179,6 +180,7 @@ children = ( FAB13EF41A3878850053620A /* script_build_begin.sh */, FAB13EF51A3878850053620A /* script_build_end.sh */, + FAD9A7E01A4E5D70000DE885 /* script_tag_icon.sh */, FAB13EF71A3878850053620A /* project_PoseGallery.xcconfig */, FAB13EFF1A3878850053620A /* target_PoseGallery.xcconfig */, FAB13F001A3878850053620A /* target_PoseGalleryTests.xcconfig */, @@ -209,7 +211,7 @@ ); name = PoseGallery; productName = PoseGallery; - productReference = FA6E64A11A279B7700395E94 /* Poses Pro.app */; + productReference = FA6E64A11A279B7700395E94 /* Poses Pro∆.app */; productType = "com.apple.product-type.application"; }; FA6E64B71A279B7800395E94 /* PoseGalleryTests */ = { diff --git a/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/Contents.json b/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/Contents.json index 36d2c80..6dab49f 100644 --- a/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/Contents.json @@ -1,8 +1,9 @@ { "images" : [ { - "idiom" : "iphone", "size" : "29x29", + "idiom" : "iphone", + "filename" : "icon-58.png", "scale" : "2x" }, { @@ -11,18 +12,21 @@ "scale" : "3x" }, { - "idiom" : "iphone", "size" : "40x40", + "idiom" : "iphone", + "filename" : "icon-80.png", "scale" : "2x" }, { - "idiom" : "iphone", "size" : "40x40", + "idiom" : "iphone", + "filename" : "icon-120.png", "scale" : "3x" }, { - "idiom" : "iphone", "size" : "60x60", + "idiom" : "iphone", + "filename" : "icon-120-1.png", "scale" : "2x" }, { @@ -31,33 +35,39 @@ "scale" : "3x" }, { - "idiom" : "ipad", "size" : "29x29", + "idiom" : "ipad", + "filename" : "icon-29-1.png", "scale" : "1x" }, { - "idiom" : "ipad", "size" : "29x29", + "idiom" : "ipad", + "filename" : "icon-58-1.png", "scale" : "2x" }, { - "idiom" : "ipad", "size" : "40x40", + "idiom" : "ipad", + "filename" : "icon-40.png", "scale" : "1x" }, { - "idiom" : "ipad", "size" : "40x40", + "idiom" : "ipad", + "filename" : "icon-80-1.png", "scale" : "2x" }, { - "idiom" : "ipad", "size" : "76x76", + "idiom" : "ipad", + "filename" : "icon-76.png", "scale" : "1x" }, { - "idiom" : "ipad", "size" : "76x76", + "idiom" : "ipad", + "filename" : "icon-152.png", "scale" : "2x" } ], diff --git a/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-120-1.png b/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-120-1.png new file mode 100644 index 0000000..6e527f6 Binary files /dev/null and b/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-120-1.png differ diff --git a/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-120.png b/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-120.png new file mode 100644 index 0000000..6e527f6 Binary files /dev/null and b/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-120.png differ diff --git a/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-152.png b/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-152.png new file mode 100644 index 0000000..c121acc Binary files /dev/null and b/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-152.png differ diff --git a/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-29-1.png b/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-29-1.png new file mode 100644 index 0000000..d29327e Binary files /dev/null and b/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-29-1.png differ diff --git a/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-40.png b/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-40.png new file mode 100644 index 0000000..15f84eb Binary files /dev/null and b/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-40.png differ diff --git a/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-58-1.png b/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-58-1.png new file mode 100644 index 0000000..c555f94 Binary files /dev/null and b/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-58-1.png differ diff --git a/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-58.png b/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-58.png new file mode 100644 index 0000000..c555f94 Binary files /dev/null and b/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-58.png differ diff --git a/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-76.png b/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-76.png new file mode 100644 index 0000000..c43d374 Binary files /dev/null and b/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-76.png differ diff --git a/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-80-1.png b/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-80-1.png new file mode 100644 index 0000000..673b964 Binary files /dev/null and b/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-80-1.png differ diff --git a/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-80.png b/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-80.png new file mode 100644 index 0000000..673b964 Binary files /dev/null and b/PoseGallery/PoseGallery/resources/Images.xcassets/AppIcon.appiconset/icon-80.png differ diff --git a/PoseGallery/PoseGallery/resources/branded/brand_PoseGallery.xcconfig b/PoseGallery/PoseGallery/resources/branded/brand_PoseGallery.xcconfig index 4da663b..3a3e6dd 100644 --- a/PoseGallery/PoseGallery/resources/branded/brand_PoseGallery.xcconfig +++ b/PoseGallery/PoseGallery/resources/branded/brand_PoseGallery.xcconfig @@ -5,7 +5,21 @@ // Copyright (c) 2015 Trollwerks Inc. All rights reserved. // -PRODUCT_NAME = Poses Pro +// for simultaneous install of each configuration + +BUNDLE_ID_SUFFIX = $(BUNDLE_ID_SUFFIX_$(CONFIGURATION)) +BUNDLE_ID_SUFFIX_Debug = .debug +BUNDLE_ID_SUFFIX_Adhoc = .adhoc +BUNDLE_ID_SUFFIX_Release = + +BUNDLE_DISPLAY_NAME_SUFFIX = $(BUNDLE_DISPLAY_NAME_SUFFIX_$(CONFIGURATION)) +BUNDLE_DISPLAY_NAME_SUFFIX_Debug = ∆ +BUNDLE_DISPLAY_NAME_SUFFIX_Adhoc = ß +BUNDLE_DISPLAY_NAME_SUFFIX_Release = + +// base branding + +PRODUCT_NAME = Poses Pro$(BUNDLE_DISPLAY_NAME_SUFFIX) PRODUCT_VERSION_STRING = 3.0 -PRODUCT_BUNDLE_VERSION = 66 -PRODUCT_BUNDLE_IDENTIFIER = com.trollwerks.posespro \ No newline at end of file +PRODUCT_BUNDLE_VERSION = 1 +PRODUCT_BUNDLE_IDENTIFIER = com.trollwerks.posespro$(BUNDLE_ID_SUFFIX) \ No newline at end of file diff --git a/PoseGallery/PoseGalleryConfig/project_PoseGallery.xcconfig b/PoseGallery/PoseGalleryConfig/project_PoseGallery.xcconfig index 34a380c..9398313 100644 --- a/PoseGallery/PoseGalleryConfig/project_PoseGallery.xcconfig +++ b/PoseGallery/PoseGalleryConfig/project_PoseGallery.xcconfig @@ -6,13 +6,11 @@ // // for Slather's coveralls.io support + //# https://github.com/venmo/slather/issues/39 -- track Swift support status GCC_GENERATE_TEST_COVERAGE_FILES = NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO -// read http://danwright.info/blog/2012/10/xcode-build-configurations/ about new debug/release format to see if it's Xcode 5 friendly - - // Environment and processing management //SDKROOT = iphoneos diff --git a/PoseGallery/PoseGalleryConfig/script_build_begin.sh b/PoseGallery/PoseGalleryConfig/script_build_begin.sh index 70c7492..02f4cc1 100644 --- a/PoseGallery/PoseGalleryConfig/script_build_begin.sh +++ b/PoseGallery/PoseGalleryConfig/script_build_begin.sh @@ -9,7 +9,13 @@ # Crashlytics magic -./PoseGallery/libraries/Fabric.framework/run 186ef2a41f30e2ce39a21f35b61600d3ae927290 3ce3168d4276f7278273f34fbc45d96dd492c71a98dc7a3dcd8f1fc3da321e50 +#./PoseGallery/libraries/Fabric.framework/run 186ef2a41f30e2ce39a21f35b61600d3ae927290 3ce3168d4276f7278273f34fbc45d96dd492c71a98dc7a3dcd8f1fc3da321e50 + +# icon tagging + +if [ $CONFIGURATION != "Release" ] ; then +${SRCROOT}/PoseGalleryConfig/script_tag_icon.sh tag PoseGallery/resources/Images.xcassets/AppIcon.appiconset +fi # finished diff --git a/PoseGallery/PoseGalleryConfig/script_build_end.sh b/PoseGallery/PoseGalleryConfig/script_build_end.sh index 430330f..6e3c765 100644 --- a/PoseGallery/PoseGalleryConfig/script_build_end.sh +++ b/PoseGallery/PoseGalleryConfig/script_build_end.sh @@ -36,10 +36,10 @@ echo Build date set to current date: $CFBuildDate # https://gist.github.com/dulaccc/a52154ac4c007db2be55 -update_icon() +restore_icon() { if [ $CONFIGURATION != "Release" ] ; then -${SRCROOT}/PoseGallery/PoseGalleryConfig/tag_icons.sh tag YourApp/Images.xcassets/AppIcon.appiconset +${SRCROOT}/PoseGalleryConfig/script_tag_icon.sh cleanup PoseGallery/resources/Images.xcassets/AppIcon.appiconset fi } @@ -56,7 +56,7 @@ find -L ${SRCROOT}// -type f -not -name “.*” -not -name “`basename ${INFOP echo Setting info in plist $plist: update_bundle_version update_build_date -#update_icon +restore_icon #copy_branding # reveal the binary in the Finder if you like diff --git a/PoseGallery/PoseGalleryConfig/script_tag_icon.sh b/PoseGallery/PoseGalleryConfig/script_tag_icon.sh new file mode 100755 index 0000000..4792009 --- /dev/null +++ b/PoseGallery/PoseGalleryConfig/script_tag_icon.sh @@ -0,0 +1,153 @@ +#!/bin/sh + +# +# script_tag_icon.sh +# from iconVersioning.h, https://github.com/krzysztofzablocki/KZBootstrap +# + +export PATH=/opt/local/bin/:/opt/local/sbin:$PATH:/usr/local/bin: + +convertPath=`which convert` +echo ${convertPath} +if [[ ! -f ${convertPath} || -z ${convertPath} ]]; then +echo "WARNING: Skipping Icon versioning, you need to install ImageMagick and ghostscript (fonts) first, you can use brew to simplify process: +brew install imagemagick +brew install ghostscript" +exit 0; +fi + +git=`sh /etc/profile; which git` +build_num=`"$git" rev-list --all |wc -l` +branch=`"$git" rev-parse --abbrev-ref HEAD` +commit=`"$git" rev-parse --short HEAD` +#version=`/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${INFOPLIST_FILE}"` +version=${PRODUCT_VERSION_STRING} + +#DIR="${BASH_SOURCE%/*}" +#if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi +#. "$DIR/buildNumber.sh" + +branch="${branch}->${BUNDLE_DISPLAY_NAME_SUFFIX}" + +#SRCROOT=.. +#CONFIGURATION_BUILD_DIR=. +#UNLOCALIZED_RESOURCES_FOLDER_PATH=. + +#commit="3783bab" +#branch="master" +#version="3.4" +#build_num="9999" + +shopt -s extglob +build_num="${build_num##*( )}" +shopt -u extglob +caption="${version} ($build_num)\n${branch}\n${commit}" +echo $caption + +function abspath() { pushd . > /dev/null; if [ -d "$1" ]; then cd "$1"; dirs -l +0; else cd "`dirname \"$1\"`"; cur_dir=`dirs -l +0`; if [ "$cur_dir" == "/" ]; then echo "$cur_dir`basename \"$1\"`"; else echo "$cur_dir/`basename \"$1\"`"; fi; fi; popd > /dev/null; } + +function processIcon() { +base_file=$1 + +cd "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +base_path=`find . -name ${base_file}` + +real_path=$( abspath "${base_path}" ) +echo "base path ${real_path}" + +if [[ ! -f ${base_path} || -z ${base_path} ]]; then +return; +fi + +# TODO: if they are the same we need to fix it by introducing temp +target_file=`basename $base_path` +target_path="${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/${target_file}" + +base_tmp_normalizedFileName="${base_file%.*}-normalized.${base_file##*.}" +base_tmp_path=`dirname $base_path` +base_tmp_normalizedFilePath="${base_tmp_path}/${base_tmp_normalizedFileName}" + +stored_original_file="${base_tmp_normalizedFilePath}-tmp" +if [[ -f ${stored_original_file} ]]; then +echo "found previous file at path ${stored_original_file}, using it as base" +mv "${stored_original_file}" "${base_path}" +fi + +if [ $CONFIGURATION = "Release" ]; then +cp "${base_path}" "$target_path" +return 0; +fi + +echo "Reverting optimized PNG to normal" +# Normalize +echo "xcrun -sdk iphoneos pngcrush -revert-iphone-optimizations -q ${base_path} ${base_tmp_normalizedFilePath}" +xcrun -sdk iphoneos pngcrush -revert-iphone-optimizations -q "${base_path}" "${base_tmp_normalizedFilePath}" + +# move original pngcrush png to tmp file +echo "moving pngcrushed png file at ${base_path} to ${stored_original_file}" +#rm "$base_path" +mv "$base_path" "${stored_original_file}" + +# Rename normalized png's filename to original one +echo "Moving normalized png file to original one ${base_tmp_normalizedFilePath} to ${base_path}" +mv "${base_tmp_normalizedFilePath}" "${base_path}" + +width=`identify -format %w ${base_path}` +height=`identify -format %h ${base_path}` +band_height=$((($height * 47) / 100)) +band_position=$(($height - $band_height)) +text_position=$(($band_position - 3)) +point_size=$(((13 * $width) / 100)) + +echo "Image dimensions ($width x $height) - band height $band_height @ $band_position - point size $point_size" + +# +# blur band and text +# +convert ${base_path} -blur 10x8 /tmp/blurred.png +convert /tmp/blurred.png -gamma 0 -fill white -draw "rectangle 0,$band_position,$width,$height" /tmp/mask.png +convert -size ${width}x${band_height} xc:none -fill 'rgba(0,0,0,0.2)' -draw "rectangle 0,0,$width,$band_height" /tmp/labels-base.png +convert -background none -size ${width}x${band_height} -pointsize $point_size -fill white -gravity center -gravity South caption:"$caption" /tmp/labels.png + +convert ${base_path} /tmp/blurred.png /tmp/mask.png -composite /tmp/temp.png + +rm /tmp/blurred.png +rm /tmp/mask.png + +# +# compose final image +# +filename=New${base_file} +convert /tmp/temp.png /tmp/labels-base.png -geometry +0+$band_position -composite /tmp/labels.png -geometry +0+$text_position -geometry +${w}-${h} -composite "${target_path}" + +# clean up +rm /tmp/temp.png +rm /tmp/labels-base.png +rm /tmp/labels.png + +echo "Overlayed ${target_path}" +} + +icon_count=`/usr/libexec/PlistBuddy -c "Print CFBundleIcons:CFBundlePrimaryIcon:CFBundleIconFiles" "${CONFIGURATION_BUILD_DIR}/${INFOPLIST_PATH}" | wc -l` +last_icon_index=$((${icon_count} - 2)) + +i=0 +while [ $i -lt $last_icon_index ]; do +icon=`/usr/libexec/PlistBuddy -c "Print CFBundleIcons:CFBundlePrimaryIcon:CFBundleIconFiles:$i" "${CONFIGURATION_BUILD_DIR}/${INFOPLIST_PATH}"` + +if [[ $icon == *.png ]] || [[ $icon == *.PNG ]] +then +processIcon $icon +else +processIcon "${icon}.png" +processIcon "${icon}@2x.png" +fi +let i=i+1 +done + +# Workaround to fix issue#16 to use wildcard * to actually find the file +# Only 72x72 and 76x76 that we need for ipad app icons +processIcon "AppIcon72x72~ipad*" +processIcon "AppIcon72x72@2x~ipad*" +processIcon "AppIcon76x76~ipad*" +processIcon "AppIcon76x76@2x~ipad*" \ No newline at end of file diff --git a/README.md b/README.md index 08bf812..6f25bdd 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ -[![Build Status](https://travis-ci.org/alexcurylo/swift-pose-gallery.svg?branch=master)](https://travis-ci.org/alexcurylo/swift-pose-gallery) [![Stories in Ready](https://badge.waffle.io/alexcurylo/swift-pose-gallery.png?label=ready&title=Ready)](https://waffle.io/alexcurylo/swift-pose-gallery) +[![Build Status](https://travis-ci.org/alexcurylo/swift-pose-gallery.svg?branch=master)](https://travis-ci.org/alexcurylo/swift-pose-gallery) +[![Stories in Ready](https://badge.waffle.io/alexcurylo/swift-pose-gallery.png?label=ready&title=Ready)](https://waffle.io/alexcurylo/swift-pose-gallery) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/alexcurylo/swift-pose-gallery?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + swift-pose-gallery ==================