nixenvironment 0.0.137 → 0.0.138

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a3df4462e5038ca23d1003c27b7d87625bdd4b34
4
- data.tar.gz: 15b3d2a35b397aa822c46dc8a37c211bd1632e08
3
+ metadata.gz: 8a27eca3d5da6e42c8d35203e9b4753326d79610
4
+ data.tar.gz: 24d3909d283c43fd1e873b390adc0edc71dadd2a
5
5
  SHA512:
6
- metadata.gz: 460ac0f9aa4561caed03b21307059174556a56bdcad52044d00b3340d17d4328de48b3f8769d8288f8bfd6a859da7f9ee3155a7c0742bba23435a34587767a78
7
- data.tar.gz: d54826405ff3bea10dd66f1eecd3d90b46b192a99087cc1f53a33f05828ec86ae7c93c88f54bde25b957c2afcfe465d1b0d41d4f70e797b7867afe516a97f026
6
+ metadata.gz: d6359e2d57731b1705e65d74e35dbe7d9608bbe2cc3ed2a25a1b1e42f91a838566405051d29ee9bf93bd2c732dce5dd980be2ab9af4dc09928ec65c50a80226b
7
+ data.tar.gz: 76337eb3d88d45e91eb8ace785e8868bbf2d9f8513fc20aa058a56ff156e71d0fd6a74e7e8847eba6e8f583f6e5d26712c6135037d2ac1b8ad590030c86426d5
data/bin/Config CHANGED
@@ -18,7 +18,7 @@ EXCLUDE_PATTERN_FOR_CODE_DUPLICATION: "**/Vendor|**/Scripts|**/Pods"
18
18
  # DEPLOY_PASSWORD:
19
19
 
20
20
  # set these var if you want to add build number on icon
21
- ICONS_PATH: Resources/Images/Images.xcassets
21
+ ICONS_PATH: Resources/Images/Images.xcassets/AppIcon.appiconset
22
22
 
23
23
  # specifies the device to be used as destination
24
24
  XCTEST_DESTINATION_DEVICE: platform=iOS Simulator,name=iPhone 5,OS=latest
data/bin/nixenvironment CHANGED
@@ -73,7 +73,7 @@ command :build do |c|
73
73
  c.option '--key_alias_password PASSWORD', String, 'Specify the password for accessing an alias name'
74
74
  c.option '--unity_platform TARGET PLATFORM', String, 'Select target platform for unity build (ios | macos | android | winphone | webgl)'
75
75
  c.option '--ndsym', 'Disable .dsym generation for ios project'
76
- c.option '--icon_tagger MODE', String, 'Set XcodeIconTagger mode (full, short, off)'
76
+ c.option '--icon_tagger MODE', String, 'Set XcodeIconTagger mode (on, off)'
77
77
  c.option '--app_version VERSION', String, 'Specify the version of the app (not implemented for unity-android)' # TODO: implement for unity-android
78
78
  c.option '--build_number BUILD_NUMBER', String, 'Specify the build number of the app (not implemented for unity-android)' # TODO: implement for unity-android
79
79
  c.option '--requires_fullscreen', 'Set UIRequiresFullScreen to YES in Info.plist (ios)'
@@ -86,7 +86,7 @@ command :build do |c|
86
86
  $scheme = options.scheme
87
87
  $sdk = options.sdk
88
88
 
89
- options.default :config => 'Debug', :ipa => 'device', :icon_tagger => 'full', :unity_path => 'UNITY'
89
+ options.default :config => 'Debug', :ipa => 'device', :icon_tagger => 'on', :unity_path => 'UNITY'
90
90
  unity_platform = options.unity_platform
91
91
  is_unity_platform = unity_platform.present?
92
92
  need_to_build_ios = true
@@ -97,7 +97,6 @@ command :build do |c|
97
97
  $build_number = options.build_number
98
98
 
99
99
  if is_unity_platform
100
- ENV['UNITY_BUILD'] = 'UNITY_BUILD'
101
100
  unity_path = ENV[options.unity_path] || options.unity_path
102
101
  unity_build(options.config, unity_platform, unity_path, options.development_build, options.connect_profiler,
103
102
  options.keystore_path, options.keystore_password, options.key_alias_name, options.key_alias_password)
@@ -571,6 +570,19 @@ def build(config, xcconfig, ipa, ndsym, icon_tagger, xc_args)
571
570
 
572
571
  FileUtils.rm_rf IOS_BUILD_DIRECTORY_NAME
573
572
 
573
+ if sdk.include?('iphoneos')
574
+
575
+ if config == 'Release'
576
+ puts 'IconTagger: configuration is Release. Skipping ...'
577
+ else
578
+ case icon_tagger
579
+ when 'on' then tag_icon
580
+ when 'off' then puts 'IconTagger is disabled. Skipping ...'
581
+ else puts "Unknown IconTagger mode: '#{icon_tagger}'. Skipping ..."
582
+ end
583
+ end
584
+ end
585
+
574
586
  Xcodebuild.build(sdk, config, xcconfig, project, workspace, scheme, env_var_prefix, xc_args)
575
587
 
576
588
  error('Build error!') unless Xcodebuild.last_cmd_success?
@@ -586,19 +598,6 @@ def build(config, xcconfig, ipa, ndsym, icon_tagger, xc_args)
586
598
  elsif sdk.include?('iphoneos')
587
599
  puts
588
600
 
589
- if config == 'Release'
590
- puts 'IconTagger: configuration is Release. Skipping ...'
591
- else
592
- case icon_tagger
593
- when 'full' then tag_icon(false)
594
- when 'short' then tag_icon(true)
595
- when 'off' then puts 'IconTagger is disabled. Skipping ...'
596
- else puts "Unknown IconTagger mode: '#{icon_tagger}'. Skipping ..."
597
- end
598
- end
599
-
600
- puts
601
-
602
601
  ipa.split.each do |current_ipa|
603
602
  begin
604
603
  case current_ipa
@@ -674,22 +673,15 @@ def unity_build(configuration, unity_platform, unity_path, development_build, co
674
673
  success("Unity build complete!\n")
675
674
  end
676
675
 
677
- def tag_icon(short_version)
676
+ def tag_icon
678
677
  plist_path = @config_settings[PRODUCT_SETTINGS_PATH_KEY]
679
678
  info_plist = Plist.from_file(plist_path)
680
679
  version = info_plist['CFBundleShortVersionString']
681
- style = short_version ? 'OneLine' : 'TwoLine'
682
- mask_path = File.join(TAGGER_UTILITY_DIRECTORY, "masks/#{style}Mask.png")
683
680
  icons_dir = File.join(Dir.pwd, @config_settings[ICONS_PATH_KEY])
684
- app_product = File.join(@config_settings[BUILT_PRODUCTS_DIR_KEY], @config_settings[EXECUTABLE_NAME_KEY]) + APP_EXT
685
681
 
686
- system("#{TAGGER_UTILITY_PATH} --shortVersion='#{version}'\
687
- --buildNumber='#{build_number}'\
688
- --style='#{style}'\
689
- --maskPath='#{mask_path}'\
690
- --plist='#{plist_path}'\
691
- --sourceIconsPath='#{icons_dir}'\
692
- --destinationIconsPath='#{app_product}'")
682
+ workspaces_in_dir = Dir.pwd
683
+
684
+ system("#{TAGGER_UTILITY_PATH} '#{version}' '#{build_number}' '#{workspaces_in_dir}' '#{icons_dir}'")
693
685
  end
694
686
 
695
687
  def backup_info_plists
@@ -833,4 +825,4 @@ end
833
825
  def success(msg)
834
826
  puts
835
827
  puts msg.green.bold
836
- end
828
+ end
@@ -20,8 +20,7 @@ module Nixenvironment
20
20
  # utils
21
21
  UTILS_PATH = File.expand_path('../../../utils', __FILE__)
22
22
  IDENTITIESLIST_UTILITY_PATH = File.join(UTILS_PATH, 'identitieslist')
23
- TAGGER_UTILITY_DIRECTORY = File.join(UTILS_PATH, 'XcodeIconTagger')
24
- TAGGER_UTILITY_PATH = File.join(TAGGER_UTILITY_DIRECTORY, 'IconTagger')
23
+ TAGGER_UTILITY_PATH = File.join(UTILS_PATH, 'AddVersionToIcons.sh')
25
24
 
26
25
  # macos
27
26
  MACOS_PROJECTS_DEPLOY_PATH = 'Projects/macOSProjects'
@@ -123,7 +123,7 @@ module Nixenvironment
123
123
 
124
124
  skip_submission = deliver_deploy ? '' : '--skip_submission'
125
125
  team_name = deploy_team_name.present? ? "-r \"#{deploy_team_name}\"" : ''
126
- system("fastlane pilot upload -i '#{ipa_product}' -u '#{deploy_itunesconnect_user}' #{team_name} #{skip_submission}")
126
+ system("fastlane pilot upload -i '#{ipa_product}' -u '#{deploy_itunesconnect_user}' #{team_name} #{skip_submission} --wait_for_uploaded_build")
127
127
  end
128
128
 
129
129
  # zip dsym
@@ -1,3 +1,3 @@
1
1
  module Nixenvironment
2
- VERSION = '0.0.137'
2
+ VERSION = '0.0.138'
3
3
  end
@@ -0,0 +1,106 @@
1
+ #!/bin/sh -ex
2
+ # Based on Krzysztof Zablocki Boostrap library - https://github.com/krzysztofzablocki/Bootstrap
3
+
4
+ convertPath=`which convert`
5
+ echo ${convertPath}
6
+ if [[ ! -f ${convertPath} || -z ${convertPath} ]]; then
7
+ echo "warning: Skipping Icon versioning, you need to install ImageMagick and ghostscript (fonts) first, you can use brew to simplify process:
8
+ brew install imagemagick
9
+ brew install ghostscript"
10
+ exit -1;
11
+ fi
12
+
13
+ version=$1
14
+ build_num=$2
15
+ project_root_path=$3
16
+
17
+ shopt -s extglob
18
+ shopt -u extglob
19
+ caption="${version}\n${build_num}"
20
+ echo $caption
21
+
22
+ function processIcon() {
23
+ base_file=$1
24
+ temp_path=$2
25
+ dest_path=$3
26
+
27
+ echo "${base_file} ${temp_path} ${dest_path}"
28
+
29
+ if [[ ! -e $base_file ]]; then
30
+ echo "error: file does not exist: ${base_file}"
31
+ exit -1;
32
+ fi
33
+
34
+ if [[ -z $temp_path ]]; then
35
+ echo "error: temp_path does not exist: ${temp_path}"
36
+ exit -1;
37
+ fi
38
+
39
+ if [[ -z $dest_path ]]; then
40
+ echo "error: dest_path does not exist: ${dest_path}"
41
+ exit -1;
42
+ fi
43
+
44
+ file_name=$(basename "$base_file")
45
+ final_file_path="${dest_path}/${file_name}"
46
+
47
+ base_tmp_normalizedFileName="${file_name%.*}-normalized.${file_name##*.}"
48
+ base_tmp_normalizedFilePath="${temp_path}/${base_tmp_normalizedFileName}"
49
+
50
+ # Normalize
51
+ echo "Reverting optimized PNG to normal"
52
+ echo "xcrun -sdk iphoneos pngcrush -revert-iphone-optimizations -q '${base_file}' '${base_tmp_normalizedFilePath}'"
53
+ xcrun -sdk iphoneos pngcrush -revert-iphone-optimizations -q "${base_file}" "${base_tmp_normalizedFilePath}"
54
+
55
+ width=`identify -format %w "${base_tmp_normalizedFilePath}"`
56
+ height=`identify -format %h "${base_tmp_normalizedFilePath}"`
57
+
58
+ band_height=$((($height * 33) / 100))
59
+ band_position=$(($height - $band_height))
60
+ text_position=$(($band_position - 3))
61
+ point_size=$(((13 * $width) / 100))
62
+
63
+ echo "Image dimensions ($width x $height) - band height $band_height @ $band_position - point size $point_size"
64
+
65
+ #
66
+ # blur band and text
67
+ #
68
+ convert "${base_tmp_normalizedFilePath}" -blur 10x8 /tmp/blurred.png
69
+ convert /tmp/blurred.png -gamma 0 -fill white -draw "rectangle 0,$band_position,$width,$height" /tmp/mask.png
70
+ 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
71
+ convert -background none -size ${width}x${band_height} -pointsize $point_size -fill white -gravity center -gravity South caption:"$caption" /tmp/labels.png
72
+
73
+ convert "${base_tmp_normalizedFilePath}" /tmp/blurred.png /tmp/mask.png -composite /tmp/temp.png
74
+
75
+ rm /tmp/blurred.png
76
+ rm /tmp/mask.png
77
+
78
+ #
79
+ # compose final image
80
+ #
81
+ filename=New"${base_file}"
82
+ convert /tmp/temp.png /tmp/labels-base.png -geometry +0+$band_position -composite /tmp/labels.png -geometry +0+$text_position -geometry +${w}-${h} -composite -alpha remove "${final_file_path}"
83
+
84
+ # clean up
85
+ rm /tmp/temp.png
86
+ rm /tmp/labels-base.png
87
+ rm /tmp/labels.png
88
+ rm "${base_tmp_normalizedFilePath}"
89
+
90
+ echo "Overlayed ${final_file_path}"
91
+ }
92
+
93
+ if [ -n "$4" ]; then
94
+ icons_path=$4
95
+ else
96
+ asset_path=$(find ${project_root_path} -name "Images.xcassets" -print -quit)
97
+ icons_path=$(find ${asset_path} -name "AppIcon.appiconset" -print -quit)
98
+ fi
99
+
100
+ echo "icons_path: ${icons_path}"
101
+
102
+ find "${icons_path}" -type f -name "*.png" -print0 |
103
+ while IFS= read -r -d '' file; do
104
+ echo "$file"
105
+ processIcon "${file}" "${icons_path}" "${icons_path}"
106
+ done
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nixenvironment
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.137
4
+ version: 0.0.138
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karen
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-08-28 00:00:00.000000000 Z
12
+ date: 2018-08-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cocoapods
@@ -313,9 +313,7 @@ files:
313
313
  - lib/nixenvironment/xcodebuild.rb
314
314
  - nixenvironment.gemspec
315
315
  - test.sh
316
- - utils/XcodeIconTagger/IconTagger
317
- - utils/XcodeIconTagger/masks/OneLineMask.png
318
- - utils/XcodeIconTagger/masks/TwoLineMask.png
316
+ - utils/AddVersionToIcons.sh
319
317
  - utils/aapt
320
318
  - utils/identitieslist
321
319
  - utils/simian-2.3.33.jar
@@ -339,7 +337,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
339
337
  version: '0'
340
338
  requirements: []
341
339
  rubyforge_project:
342
- rubygems_version: 2.5.1
340
+ rubygems_version: 2.5.2.3
343
341
  signing_key:
344
342
  specification_version: 4
345
343
  summary: NIX projects build and deploy utility
Binary file