shenzhen 0.12.1 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c1a21292d93e5d9f84968aa673f6a1de23981f66
4
- data.tar.gz: faac39ff132a922848cf03d0760ab7f8f543b604
3
+ metadata.gz: 6b1e9afd67a7e0daf11f13f0140c2d4bae5a471d
4
+ data.tar.gz: 4a841f8932528bc3c265b8008243e4b78045cdf6
5
5
  SHA512:
6
- metadata.gz: f3e4f0dd6d6d78be3e9fd14514f4287a6a11f3ce56730cf9bc87b04b14549cdae74c8cd8a808500fac1c8b000406c253af2ea3086f9736efebfc3d7c7112e342
7
- data.tar.gz: 7eaf374e7e1e0ee295b854d6ab68caa1fc47f9caf874aed112fd973b3701d41a957a4baceff5fab247d59f6bd0c69dbf5acaef31bb301fb0da695ddb7a2df040
6
+ metadata.gz: 8c1220461c1d3f6106a9fd7e9e4639dab72f77cca682ad44b63132add081fcea6b044863edcb7b018e8d155131bde764ca2cb63b7ff37fb2a45454a5e7dfd354
7
+ data.tar.gz: e296e21dcd6beb2222d21761c15a8d599ae8fbb7f0c292efb3914bb8e1aed9ae1c4ec38e2654175234cd3c90a18b16861f67d44e00832246edc2dfed24822ae5
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shenzhen (0.12.1)
4
+ shenzhen (0.13.0)
5
5
  aws-sdk (~> 1.0)
6
6
  commander (~> 4.3)
7
7
  dotenv (~> 0.7)
@@ -75,9 +75,9 @@ command :build do |c|
75
75
  actions << :archive unless options.archive == false
76
76
 
77
77
  ENV['CC'] = nil # Fix for RVM
78
- cmd = %{xcodebuild #{flags.join(' ')} #{actions.join(' ')} #{'1> /dev/null' unless $verbose}}
79
- say_warning cmd
80
- abort unless system cmd
78
+ command = %{xcodebuild #{flags.join(' ')} #{actions.join(' ')} #{'1> /dev/null' unless $verbose}}
79
+ puts command if $verbose
80
+ abort unless system command
81
81
 
82
82
  @target, @xcodebuild_settings = Shenzhen::XcodeBuild.settings(*flags).detect{|target, settings| settings['WRAPPER_EXTENSION'] == "app"}
83
83
  say_error "App settings could not be found." and abort unless @xcodebuild_settings
@@ -89,7 +89,9 @@ command :build do |c|
89
89
  @ipa_path = File.expand_path(@ipa_name, @destination)
90
90
 
91
91
  log "xcrun", "PackageApplication"
92
- abort unless system %{xcrun -sdk #{@sdk} PackageApplication -v "#{@app_path}" -o "#{@ipa_path}" --embed "#{options.embed || @dsym_path}" #{"-s \"#{options.identity}\"" if options.identity} #{'1> /dev/null' unless $verbose}}
92
+ command = %{xcrun -sdk #{@sdk} PackageApplication -v "#{@app_path}" -o "#{@ipa_path}" --embed "#{options.embed || @dsym_path}" #{"-s \"#{options.identity}\"" if options.identity} #{'--verbose' if $verbose} #{'1> /dev/null' unless $verbose}}
93
+ puts command if $verbose
94
+ abort unless system command
93
95
 
94
96
  # Determine whether this is a Swift project and, eventually, the list of libraries to copy from
95
97
  # Xcode's toolchain directory since there's no "xcodebuild" target to do just that (it is done
@@ -94,7 +94,7 @@ command :'distribute:fir' do |c|
94
94
  determine_app_version! unless @app_version = options.app_version
95
95
 
96
96
  determine_short_version! unless @short_version = options.short_version
97
-
97
+
98
98
  client = Shenzhen::Plugins::Fir::Client.new(@user_token)
99
99
  app_response = client.get_app_info(@app_id)
100
100
  if app_response.status == 200
@@ -24,17 +24,19 @@ module Shenzhen::Plugins
24
24
  size = File.size(@ipa)
25
25
  checksum = Digest::MD5.file(@ipa)
26
26
 
27
- FileUtils.mkdir_p("Package.itmsp")
28
- FileUtils.copy_entry(@ipa, "Package.itmsp/#{@filename}")
29
-
30
- File.write("Package.itmsp/metadata.xml", metadata(@apple_id, checksum, size))
31
-
32
- case transport
33
- when /(error)|(fail)/i
34
- say_error "An error occurred when trying to upload the build to iTunesConnect.\nRun with --verbose for more info." and abort
27
+ begin
28
+ FileUtils.mkdir_p("Package.itmsp")
29
+ FileUtils.copy_entry(@ipa, "Package.itmsp/#{@filename}")
30
+
31
+ File.write("Package.itmsp/metadata.xml", metadata(@apple_id, checksum, size))
32
+
33
+ case transport
34
+ when /(error)|(fail)/i
35
+ say_error "An error occurred when trying to upload the build to iTunesConnect.\nRun with --verbose for more info." and abort
36
+ end
37
+ ensure
38
+ FileUtils.rm_rf("Package.itmsp", :secure => true)
35
39
  end
36
-
37
- FileUtils.rmdir("Package.itmsp")
38
40
  end
39
41
 
40
42
  private
@@ -46,18 +48,14 @@ module Shenzhen::Plugins
46
48
  args = [tool, "-m upload", "-f Package.itmsp", "-u #{Shellwords.escape(@account)}", "-p #{Shellwords.escape(@password)}"]
47
49
  command = args.join(' ')
48
50
 
49
- say "#{command}" if verbose?
51
+ puts "#{command}" if $verbose
50
52
 
51
53
  output = `#{command} 2> /dev/null`
52
- say output.chomp if verbose?
54
+ puts output.chomp if $verbose
53
55
 
54
56
  output
55
57
  end
56
58
 
57
- def verbose?
58
- @params.collect(&:to_sym).include?(:verbose)
59
- end
60
-
61
59
  def metadata(apple_id, checksum, size)
62
60
  %{<?xml version="1.0" encoding="UTF-8"?>
63
61
  <package version="software4.7" xmlns="http://apple.com/itunes/importer">
@@ -88,7 +86,6 @@ command :'distribute:itunesconnect' do |c|
88
86
  c.option '-w', '--warnings', "Check for warnings when validating the ipa"
89
87
  c.option '-e', '--errors', "Check for errors when validating the ipa"
90
88
  c.option '-i', '--apple-id STRING', "Apple ID from iTunes Connect"
91
- c.option '--verbose', "Run commands verbosely"
92
89
  c.option '--sdk SDK', "SDK to use when validating the ipa. Defaults to 'iphoneos'"
93
90
  c.option '--save-keychain', "Save the provided account in the keychain for future use"
94
91
 
@@ -115,15 +112,19 @@ command :'distribute:itunesconnect' do |c|
115
112
  Security::GenericPassword.add(Shenzhen::Plugins::ITunesConnect::ITUNES_CONNECT_SERVER, @account, @password, {:U => nil}) if options.save_keychain
116
113
  end
117
114
 
115
+ unless /^[0-9a-zA-Z]*$/ === @password
116
+ say_warning "Password contains special characters, which may not be handled properly by iTMSTransporter. If you experience problems uploading to iTunes Connect, please consider changing your password to something with only alphanumeric characters."
117
+ end
118
+
118
119
  parameters = []
119
- parameters << :verbose if options.verbose
120
120
  parameters << :warnings if options.warnings
121
121
  parameters << :errors if options.errors
122
122
 
123
123
  client = Shenzhen::Plugins::ITunesConnect::Client.new(@file, apple_id, options.sdk, @account, @password, parameters)
124
124
 
125
125
  client.upload_build!
126
- say_ok "Upload complete. You may want to double check iTunes Connect to make sure it was received correctly."
126
+ say_ok "Upload complete."
127
+ say_warning "You may want to double check iTunes Connect to make sure it was received correctly."
127
128
  end
128
129
 
129
130
  private
@@ -16,6 +16,8 @@ module Shenzhen::Plugins
16
16
 
17
17
  bucket = @s3.buckets[options[:bucket]]
18
18
 
19
+ uploaded_urls = []
20
+
19
21
  files = []
20
22
  files << ipa
21
23
  files << options[:dsym] if options[:dsym]
@@ -23,9 +25,12 @@ module Shenzhen::Plugins
23
25
  basename = File.basename(file)
24
26
  key = path ? File.join(path, basename) : basename
25
27
  File.open(file) do |descriptor|
26
- bucket.objects.create(key, descriptor, :acl => options[:acl])
28
+ obj = bucket.objects.create(key, descriptor, :acl => options[:acl])
29
+ uploaded_urls << obj.public_url.to_s
27
30
  end
28
31
  end
32
+
33
+ uploaded_urls
29
34
  end
30
35
 
31
36
  private
@@ -99,7 +104,8 @@ command :'distribute:s3' do |c|
99
104
  client = Shenzhen::Plugins::S3::Client.new(@access_key_id, @secret_access_key, @region)
100
105
 
101
106
  begin
102
- client.upload_build @file, {:bucket => @bucket, :create => !!options.create, :acl => @acl, :dsym => @dsym, :path => @path}
107
+ urls = client.upload_build @file, {:bucket => @bucket, :create => !!options.create, :acl => @acl, :dsym => @dsym, :path => @path}
108
+ urls.each { |url| say_ok url}
103
109
  say_ok "Build successfully uploaded to S3"
104
110
  rescue => exception
105
111
  say_error "Error while uploading to S3: #{exception}"
@@ -1,3 +1,3 @@
1
1
  module Shenzhen
2
- VERSION = '0.12.1'
2
+ VERSION = '0.13.0'
3
3
  end
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shenzhen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.1
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mattt Thompson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-05 00:00:00.000000000 Z
11
+ date: 2015-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander
@@ -229,6 +229,7 @@ files:
229
229
  - ./shenzhen-0.11.1.gem
230
230
  - ./shenzhen-0.11.2.gem
231
231
  - ./shenzhen-0.12.0.gem
232
+ - ./shenzhen-0.12.1.gem
232
233
  - ./shenzhen.gemspec
233
234
  - bin/ipa
234
235
  homepage: http://nomad-cli.com