shenzhen 0.14.0 → 0.14.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: 4fb54f48748da28b11064014eb594646d3e09c1a
4
- data.tar.gz: b5f1fdd3849095b29285d766fa1aca0bc9ca7471
3
+ metadata.gz: 2de2ca4689c9602ec72a27711e71c8ed3c722336
4
+ data.tar.gz: 5424ace41fc9543662373c6fc141c9903772d667
5
5
  SHA512:
6
- metadata.gz: 25175719aa35e00ffab3de7ef8c7c84b357628535d1d8832b7cc703d18faff2a1591b3aabf7e21c194ed32af16ba9fc28e2eb6d362226dc4122abff5da01d5c1
7
- data.tar.gz: b8dcd3af4cd8cbb2220fadc731a6dc893426686c98ceca1502646f12534f1b2eebddf20def526ce3f9c1dfd4a114a23e66c649352c71ffa3b30a0d6cb62d1d1a
6
+ metadata.gz: e444b6f0051c69282896ebc51f1e1ff8884f98b3a6cac0f959a08a51a7c309269c20be2a4faff6bfa596aaf14d18af09c342affd7d5055b55358cdd82df9a66f
7
+ data.tar.gz: fd070ef5e7bd8fc534b048857fd12ff2280beae9a47b3ae578f8dc0151f9dd11e76affce1cb8e6a5bfafb0d0db73e8390b79a62adba0a9f379dd5d1135fcfe43
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shenzhen (0.14.0)
4
+ shenzhen (0.14.1)
5
5
  aws-sdk (~> 1.0)
6
6
  commander (~> 4.3)
7
- dotenv (~> 0.7)
7
+ dotenv (>= 0.7)
8
8
  faraday (~> 0.8.9)
9
9
  faraday_middleware (~> 0.9)
10
- highline (>= 1.7.1)
10
+ highline (>= 1.7.2)
11
11
  json (~> 1.8)
12
12
  net-sftp (~> 2.1.2)
13
13
  plist (~> 3.1.0)
@@ -23,17 +23,15 @@ GEM
23
23
  aws-sdk-v1 (1.64.0)
24
24
  json (~> 1.4)
25
25
  nokogiri (>= 1.4.4)
26
- commander (4.3.2)
27
- highline (~> 1.7.1)
26
+ commander (4.3.4)
27
+ highline (~> 1.7.2)
28
28
  diff-lcs (1.2.5)
29
- dotenv (0.11.1)
30
- dotenv-deployment (~> 0.0.2)
31
- dotenv-deployment (0.0.2)
29
+ dotenv (2.0.1)
32
30
  faraday (0.8.9)
33
31
  multipart-post (~> 1.2.0)
34
32
  faraday_middleware (0.9.1)
35
33
  faraday (>= 0.7.4, < 0.10)
36
- highline (1.7.1)
34
+ highline (1.7.2)
37
35
  json (1.8.2)
38
36
  mini_portile (0.6.2)
39
37
  multipart-post (1.2.0)
@@ -69,6 +69,8 @@ command :build do |c|
69
69
 
70
70
  log "xcodebuild", (@workspace || @project)
71
71
 
72
+ xcode = `xcode-select --print-path`.strip
73
+
72
74
  actions = []
73
75
  actions << :clean unless options.clean == false
74
76
  actions << :build
@@ -93,12 +95,13 @@ command :build do |c|
93
95
  puts command if $verbose
94
96
  abort unless system command
95
97
 
98
+
96
99
  # Determine whether this is a Swift project and, eventually, the list of libraries to copy from
97
100
  # Xcode's toolchain directory since there's no "xcodebuild" target to do just that (it is done
98
101
  # post-build when exporting an archived build from the "Organizer").
99
102
  @ipa_swift_frameworks = Dir["#{@app_path}/Frameworks/libswift*"]
100
103
 
101
- if not @ipa_swift_frameworks.empty? then
104
+ if not @ipa_swift_frameworks.empty?
102
105
  Dir.mktmpdir do |tmpdir|
103
106
  # Copy all necessary Swift libraries to a temporary "SwiftSupport" directory so that we can
104
107
  # easily add it to the .ipa later.
@@ -106,8 +109,6 @@ command :build do |c|
106
109
 
107
110
  Dir.mkdir(swift_support)
108
111
 
109
- xcode = `xcode-select --print-path`.strip
110
-
111
112
  @ipa_swift_frameworks.each do |path|
112
113
  framework = File.basename(path)
113
114
 
@@ -121,6 +122,21 @@ command :build do |c|
121
122
  end
122
123
  end
123
124
 
125
+ log "Adding WatchKit support files", "#{xcode}/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/Library/Application Support/WatchKit/WK"
126
+ Dir.mktmpdir do |tmpdir|
127
+ # Make watchkit support directory
128
+ watchkit_support = File.join(tmpdir, "WatchKitSupport")
129
+ Dir.mkdir(watchkit_support)
130
+
131
+ # Copy WK from Xcode into WatchKitSupport
132
+ FileUtils.copy_file("#{xcode}/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/Library/Application Support/WatchKit/WK", File.join(watchkit_support, "WK"))
133
+
134
+ # Add "WatchKitSupport" to the .ipa archive
135
+ Dir.chdir(tmpdir) do
136
+ abort unless system %{zip --recurse-paths "#{@ipa_path}" "WatchKitSupport" #{'> /dev/null' unless $verbose}}
137
+ end
138
+ end
139
+
124
140
  log "zip", @dsym_filename
125
141
  abort unless system %{cp -r "#{@dsym_path}" "#{@destination}" && pushd "#{File.dirname(@dsym_filename)}" && zip -r "#{@dsym_filename}.zip" "#{File.basename(@dsym_filename)}" #{'> /dev/null' unless $verbose} && popd && rm -rf "#{@dsym_filename}"}
126
142
 
@@ -10,29 +10,44 @@ command :info do |c|
10
10
 
11
11
  c.action do |args, options|
12
12
  say_error "`security` command not found in $PATH" and abort if `which security` == ""
13
+ say_error "`codesign` command not found in $PATH" and abort if `which codesign` == ""
13
14
 
14
15
  determine_file! unless @file = args.pop
15
16
  say_error "Missing or unspecified .ipa file" and abort unless @file and ::File.exist?(@file)
16
17
 
17
18
  Zip::File.open(@file) do |zipfile|
18
- entry = zipfile.find_entry("Payload/#{File.basename(@file, File.extname(@file))}.app/embedded.mobileprovision")
19
+ app_entry = zipfile.find_entry("Payload/#{File.basename(@file, File.extname(@file))}.app")
20
+ provisioning_profile_entry = zipfile.find_entry("#{app_entry.name}embedded.mobileprovision") if app_entry
19
21
 
20
- if (!entry)
22
+ if (!provisioning_profile_entry)
21
23
  zipfile.dir.entries("Payload").each do |dir_entry|
22
24
  if dir_entry =~ /.app$/
23
25
  say "Using .app: #{dir_entry}"
24
- entry = zipfile.find_entry("Payload/#{dir_entry}/embedded.mobileprovision")
26
+ app_entry = zipfile.find_entry("Payload/#{dir_entry}")
27
+ provisioning_profile_entry = zipfile.find_entry("#{app_entry.name}embedded.mobileprovision") if app_entry
25
28
  break
26
29
  end
27
30
  end
28
31
  end
29
32
 
30
- say_error "Embedded mobile provisioning file not found in #{@file}" and abort unless entry
33
+ say_error "Embedded mobile provisioning file not found in #{@file}" and abort unless provisioning_profile_entry
31
34
 
32
- tempfile = Tempfile.new(::File.basename(entry.name))
35
+ tempdir = ::File.new(Dir.mktmpdir)
33
36
  begin
34
- zipfile.extract(entry, tempfile.path){ override = true }
35
- plist = Plist::parse_xml(`security cms -D -i #{tempfile.path}`)
37
+ zipfile.each do |zip_entry|
38
+ temp_entry_path = ::File.join(tempdir.path, zip_entry.name)
39
+
40
+ FileUtils.mkdir_p(::File.dirname(temp_entry_path))
41
+ zipfile.extract(zip_entry, temp_entry_path) unless ::File.exist?(temp_entry_path)
42
+ end
43
+
44
+ temp_provisioning_profile = ::File.new(::File.join(tempdir.path, provisioning_profile_entry.name))
45
+ temp_app_directory = ::File.new(::File.join(tempdir.path, app_entry.name))
46
+
47
+ plist = Plist::parse_xml(`security cms -D -i #{temp_provisioning_profile.path}`)
48
+
49
+ codesign = `codesign -dv "#{temp_app_directory.path}" 2>&1`
50
+ codesigned = /Signed Time/ === codesign
36
51
 
37
52
  table = Terminal::Table.new do |t|
38
53
  plist.each do |key, value|
@@ -51,6 +66,8 @@ command :info do |c|
51
66
 
52
67
  t << columns
53
68
  end
69
+
70
+ t << ["Codesigned", codesigned.to_s.capitalize]
54
71
  end
55
72
 
56
73
  puts table
@@ -58,7 +75,7 @@ command :info do |c|
58
75
  rescue => e
59
76
  say_error e.message
60
77
  ensure
61
- tempfile.close and tempfile.unlink
78
+ FileUtils.remove_entry_secure tempdir
62
79
  end
63
80
  end
64
81
  end
@@ -78,11 +78,10 @@ command :'distribute:deploygate' do |c|
78
78
 
79
79
  client = Shenzhen::Plugins::DeployGate::Client.new(@api_token, @user_name)
80
80
  response = client.upload_build(@file, parameters)
81
- case response.status
82
- when 200...300
81
+ if (200...300) === response.status and not response.body["error"]
83
82
  say_ok "Build successfully uploaded to DeployGate"
84
83
  else
85
- say_error "Error uploading to DeployGate: #{response.body}" and abort
84
+ say_error "Error uploading to DeployGate: #{response.body["error"] || "(Unknown Error)"}" and abort
86
85
  end
87
86
  end
88
87
 
@@ -45,10 +45,11 @@ module Shenzhen::Plugins
45
45
  tool = File.join(File.dirname(xcode), "Applications/Application Loader.app/Contents/MacOS/itms/bin/iTMSTransporter").gsub(/\s/, '\ ')
46
46
  tool = File.join(File.dirname(xcode), "Applications/Application Loader.app/Contents/itms/bin/iTMSTransporter").gsub(/\s/, '\ ') if !File.exist?(tool)
47
47
 
48
- args = [tool, "-m upload", "-f Package.itmsp", "-u #{Shellwords.escape(@account)}", "-p #{Shellwords.escape(@password)}"]
48
+ escaped_password = Shellwords.escape(@password)
49
+ args = [tool, "-m upload", "-f Package.itmsp", "-u #{Shellwords.escape(@account)}", "-p #{escaped_password}"]
49
50
  command = args.join(' ')
50
51
 
51
- puts "#{command}" if $verbose
52
+ puts command.sub("-p #{escaped_password}", "-p ******") if $verbose
52
53
 
53
54
  output = `#{command} 2> /dev/null`
54
55
  puts output.chomp if $verbose
@@ -1,3 +1,3 @@
1
1
  module Shenzhen
2
- VERSION = '0.14.0'
2
+ VERSION = '0.14.1'
3
3
  end
@@ -29,7 +29,7 @@ module Shenzhen::XcodeBuild
29
29
  class << self
30
30
  def info(*args)
31
31
  options = args.last.is_a?(Hash) ? args.pop : {}
32
- output = `xcodebuild -list #{(args + args_from_options(options)).join(" ")} 2>&1`
32
+ output = `xcrun xcodebuild -list #{(args + args_from_options(options)).join(" ")} 2>&1`
33
33
 
34
34
  raise Error.new $1 if /^xcodebuild\: error\: (.+)$/ === output
35
35
 
@@ -62,7 +62,7 @@ module Shenzhen::XcodeBuild
62
62
 
63
63
  def settings(*args)
64
64
  options = args.last.is_a?(Hash) ? args.pop : {}
65
- output = `xcodebuild #{(args + args_from_options(options)).join(" ")} -showBuildSettings 2> /dev/null`
65
+ output = `xcrun xcodebuild #{(args + args_from_options(options)).join(" ")} -showBuildSettings 2> /dev/null`
66
66
 
67
67
  return nil unless /\S/ === output
68
68
 
@@ -86,7 +86,7 @@ module Shenzhen::XcodeBuild
86
86
  end
87
87
 
88
88
  def version
89
- output = `xcodebuild -version`
89
+ output = `xcrun xcodebuild -version`
90
90
  output.scan(/([\d+\.?]+)/).flatten.first rescue nil
91
91
  end
92
92
 
Binary file
@@ -15,12 +15,12 @@ Gem::Specification.new do |s|
15
15
  s.description = "CLI for Building & Distributing iOS Apps (.ipa Files)"
16
16
 
17
17
  s.add_dependency "commander", "~> 4.3"
18
- s.add_dependency "highline", ">= 1.7.1"
18
+ s.add_dependency "highline", ">= 1.7.2"
19
19
  s.add_dependency "terminal-table", "~> 1.4.5"
20
20
  s.add_dependency "json", "~> 1.8"
21
21
  s.add_dependency "faraday", "~> 0.8.9"
22
22
  s.add_dependency "faraday_middleware", "~> 0.9"
23
- s.add_dependency "dotenv", "~> 0.7"
23
+ s.add_dependency "dotenv", ">= 0.7"
24
24
  s.add_dependency "aws-sdk", "~> 1.0"
25
25
  s.add_dependency "net-sftp", "~> 2.1.2"
26
26
  s.add_dependency "plist", "~> 3.1.0"
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.14.0
4
+ version: 0.14.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: 2015-04-17 00:00:00.000000000 Z
11
+ date: 2015-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '>='
32
32
  - !ruby/object:Gem::Version
33
- version: 1.7.1
33
+ version: 1.7.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '>='
39
39
  - !ruby/object:Gem::Version
40
- version: 1.7.1
40
+ version: 1.7.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: terminal-table
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -98,14 +98,14 @@ dependencies:
98
98
  name: dotenv
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ~>
101
+ - - '>='
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0.7'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ~>
108
+ - - '>='
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0.7'
111
111
  - !ruby/object:Gem::Dependency
@@ -238,6 +238,7 @@ files:
238
238
  - ./Rakefile
239
239
  - ./README.md
240
240
  - ./shenzhen-0.13.2.gem
241
+ - ./shenzhen-0.14.0.gem
241
242
  - ./shenzhen.gemspec
242
243
  - bin/ipa
243
244
  homepage: http://nomad-cli.com