shenzhen 0.5.0 → 0.5.1

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: fb28a156e7d7ae587fd7111136ad03abcadbb2b0
4
- data.tar.gz: 36b8b8fd8718548b6e2cc815fc7724297f4a639d
3
+ metadata.gz: 662c8d1d475e2f3439b2d0a2c14f7bf5ff1b5418
4
+ data.tar.gz: aa47a3775e5be5b25467221bf76c841fee055ffd
5
5
  SHA512:
6
- metadata.gz: 5c18315a884e2e44e4c0630fcbdda1b23d8a31e762b26380766e48d4a47319f39d5f775d233ee5499170238bd3b86b4981b8b5f4caca90bb1fd98a022cece0f2
7
- data.tar.gz: ef91e63e346f9b012a8d236e1a0cc9a17a90c04203094d7ddeedb731074b0f5500dfac8ab727210eb3880dbeddacc86ea30c2102fad47aa17a114114bab2d600
6
+ metadata.gz: e56f40210167d925c100c5dde26272f19231c586fadeb0a34d9b71d54e4396d189ab13a7e53c00318f2c5c6bfe4506cfb5375115a43cd3251dffa1c89f075722
7
+ data.tar.gz: d6e3936ecbb5be845f25600a77e4e1c7932b0b568cfddeb548157b257dce0fcda61cdf1c96ce1a85916e09353b8fa95cc814f4e549d183f804801859186a3379
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shenzhen (0.5.0)
4
+ shenzhen (0.5.1)
5
5
  aws-sdk (~> 1.0)
6
6
  commander (~> 4.1)
7
7
  dotenv (~> 0.7)
@@ -25,7 +25,7 @@ GEM
25
25
  faraday_middleware (0.9.0)
26
26
  faraday (>= 0.7.4, < 0.9)
27
27
  highline (1.6.19)
28
- json (1.8.0)
28
+ json (1.8.1)
29
29
  multipart-post (1.2.0)
30
30
  net-sftp (2.1.2)
31
31
  net-ssh (>= 2.6.5)
data/lib/shenzhen.rb CHANGED
@@ -1,7 +1,4 @@
1
- module Shenzhen
2
- VERSION = '0.5.0'
3
- end
4
-
1
+ require 'shenzhen/version'
5
2
  require 'shenzhen/agvtool'
6
3
  require 'shenzhen/xcodebuild'
7
4
  require 'shenzhen/plistbuddy'
@@ -13,6 +13,7 @@ command :build do |c|
13
13
  c.option '--[no-]archive', 'Archive project after building'
14
14
  c.option '-d', '--destination DESTINATION', 'Destination. Defaults to current directory'
15
15
  c.option '-m', '--embed PROVISION', 'Sign .ipa file with .mobileprovision'
16
+ c.option '-sdk', '--sdk SDK', 'use SDK as the name or path of the base SDK when building the project'
16
17
 
17
18
  c.action do |args, options|
18
19
  validate_xcode_version!
@@ -23,6 +24,7 @@ command :build do |c|
23
24
  @xcodebuild_info = Shenzhen::XcodeBuild.info(:workspace => @workspace, :project => @project)
24
25
 
25
26
  @scheme = options.scheme
27
+ @sdk = options.sdk || 'iphoneos'
26
28
  @configuration = options.configuration
27
29
  @destination = options.destination || Dir.pwd
28
30
  FileUtils.mkdir_p(@destination) unless File.directory?(@destination)
@@ -35,14 +37,10 @@ command :build do |c|
35
37
  determine_scheme! unless @scheme
36
38
  say_error "Scheme #{@scheme} not found" and abort unless (@xcodebuild_info.schemes.include?(@scheme) rescue false)
37
39
 
38
- say_warning "Building \"#{@workspace || @project}\" with Scheme \"#{@scheme}\" and Configuration \"#{@configuration}\"\n" unless options.quiet
39
-
40
- log "xcodebuild", (@workspace || @project)
41
-
42
40
  @configuration = options.configuration
43
41
 
44
42
  flags = []
45
- flags << "-sdk iphoneos"
43
+ flags << "-sdk #{@sdk}"
46
44
  flags << "-workspace '#{@workspace}'" if @workspace
47
45
  flags << "-project '#{@project}'" if @project
48
46
  flags << "-scheme '#{@scheme}'" if @scheme
@@ -57,6 +55,7 @@ command :build do |c|
57
55
  end
58
56
 
59
57
  say_warning "Building \"#{@workspace || @project}\" with Scheme \"#{@scheme}\" and Configuration \"#{@configuration}\"\n" unless options.quiet
58
+ log "xcodebuild", (@workspace || @project)
60
59
 
61
60
  actions = []
62
61
  actions << :clean unless options.clean == false
@@ -76,7 +75,7 @@ command :build do |c|
76
75
  @ipa_path = File.expand_path(@ipa_name, @destination)
77
76
 
78
77
  log "xcrun", "PackageApplication"
79
- abort unless system %{xcrun -sdk iphoneos PackageApplication -v "#{@app_path}" -o "#{@ipa_path}" --embed "#{options.embed || @dsym_path}" 1> /dev/null}
78
+ abort unless system %{xcrun -sdk #{@sdk} PackageApplication -v "#{@app_path}" -o "#{@ipa_path}" --embed "#{options.embed || @dsym_path}" 1> /dev/null}
80
79
 
81
80
  log "zip", @dsym_filename
82
81
  abort unless system %{cp -r "#{@dsym_path}" "#{@destination}" && zip -r "#{@dsym_filename}.zip" "#{@dsym_filename}" >/dev/null && rm -rf "#{@dsym_filename}"}
@@ -114,6 +113,8 @@ command :build do |c|
114
113
  end
115
114
 
116
115
  def determine_scheme!
116
+ say_error "No schemes found in Xcode project or workspace" and abort unless @xcodebuild_info.schemes
117
+
117
118
  if @xcodebuild_info.schemes.length == 1
118
119
  @scheme = @xcodebuild_info.schemes.first
119
120
  else
@@ -51,6 +51,7 @@ command :'distribute:hockeyapp' do |c|
51
51
  c.option '-t', '--token TOKEN', "API Token. Available at https://rink.hockeyapp.net/manage/auth_tokens"
52
52
  c.option '-i', '--identifier PUBLIC_IDENTIFIER', "Public identifier of the app you are targeting, if not specified HockeyApp will use the bundle identifier to choose the right"
53
53
  c.option '-m', '--notes NOTES', "Release notes for the build (Default: Textile)"
54
+ c.option '-r', '--release RELEASE', [:alpha, :beta, :live], "Release type: 0 - Beta, 1 - Live, 2 - Alpha (Default: alpha)"
54
55
  c.option '--markdown', 'Notes are written with Markdown'
55
56
  c.option '--tags TAGS', "Comma separated list of tags which will receive access to the build"
56
57
  c.option '--notify', "Notify permitted teammates to install the build"
@@ -79,6 +80,14 @@ command :'distribute:hockeyapp' do |c|
79
80
  parameters[:tags] = options.tags if options.tags
80
81
  parameters[:dsym_filename] = @dsym if @dsym
81
82
  parameters[:mandatory] = "1" if options.mandatory
83
+ parameters[:release_type] = case options.release
84
+ when "beta", "0"
85
+ "0"
86
+ when "live", "1"
87
+ "1"
88
+ else
89
+ "2"
90
+ end
82
91
 
83
92
  client = Shenzhen::Plugins::HockeyApp::Client.new(@api_token)
84
93
  response = client.upload_build(@file, parameters)
@@ -21,7 +21,9 @@ module Shenzhen::Plugins
21
21
  files << options[:dsym]
22
22
  files.each do |file|
23
23
  key = File.join(path, File.basename(file))
24
- bucket.objects.create(key, File.open(file), :acl => options[:acl])
24
+ File.open(file) do |descriptor|
25
+ bucket.objects.create(key, descriptor, :acl => options[:acl])
26
+ end
25
27
  end
26
28
  end
27
29
 
@@ -36,7 +38,7 @@ module Shenzhen::Plugins
36
38
  Dir.mktmpdir do |dir|
37
39
  system "unzip -q #{ipa} -d #{dir} 2> /dev/null"
38
40
 
39
- plist = Dir["#{dir}/**/Info.plist"].last
41
+ plist = Dir["#{dir}/**/*.app/Info.plist"].last
40
42
 
41
43
  substitutions.uniq.each do |substitution|
42
44
  key = substitution[1...-1]
@@ -115,7 +117,7 @@ command :'distribute:s3' do |c|
115
117
 
116
118
  def determine_secret_access_key!
117
119
  @secret_access_key ||= ENV['AWS_SECRET_ACCESS_KEY']
118
- @secret_access_key ||= secret_access_key "Secret Access Key:"
120
+ @secret_access_key ||= ask "Secret Access Key:"
119
121
  end
120
122
 
121
123
  def determine_bucket!
@@ -10,7 +10,7 @@ module Shenzhen::Plugins
10
10
 
11
11
  def initialize(api_token, team_token)
12
12
  @api_token, @team_token = api_token, team_token
13
- @connection = Faraday.new(:url => "http://#{HOSTNAME}") do |builder|
13
+ @connection = Faraday.new(:url => "http://#{HOSTNAME}", :request => { :timeout => 120 }) do |builder|
14
14
  builder.request :multipart
15
15
  builder.request :json
16
16
  builder.response :json, :content_type => /\bjson$/
@@ -33,6 +33,9 @@ module Shenzhen::Plugins
33
33
  @connection.post("/api/builds.json", options).on_complete do |env|
34
34
  yield env[:status], env[:body] if block_given?
35
35
  end
36
+
37
+ rescue Faraday::Error::TimeoutError
38
+ say_error "Timed out while uploading build. Check https://testflightapp.com/dashboard/applications/ to see if the upload was completed." and abort
36
39
  end
37
40
  end
38
41
  end
@@ -0,0 +1,3 @@
1
+ module Shenzhen
2
+ VERSION = '0.5.1'
3
+ end
data/shenzhen.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
- require "shenzhen"
4
+ require "shenzhen/version"
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "shenzhen"
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.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mattt Thompson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-04 00:00:00.000000000 Z
11
+ date: 2013-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander
@@ -154,10 +154,10 @@ files:
154
154
  - ./lib/shenzhen/plugins/hockeyapp.rb
155
155
  - ./lib/shenzhen/plugins/s3.rb
156
156
  - ./lib/shenzhen/plugins/testflight.rb
157
+ - ./lib/shenzhen/version.rb
157
158
  - ./lib/shenzhen/xcodebuild.rb
158
159
  - ./lib/shenzhen.rb
159
160
  - ./LICENSE
160
- - ./nada.ipa
161
161
  - ./Rakefile
162
162
  - ./README.md
163
163
  - ./shenzhen.gemspec
data/nada.ipa DELETED
File without changes