scan 0.3.3 → 0.4.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: a36b291dfc7c2e8139d915b07464b7b43fa0ccbc
4
- data.tar.gz: 58139086e5d430f38bb7c0f185f51930db66c384
3
+ metadata.gz: 533ce99c41f14c934f7bb3d544575cf113462fd3
4
+ data.tar.gz: bbe83676310a88b0e61a1b69cc152ce13e975aee
5
5
  SHA512:
6
- metadata.gz: 52fd21eca38e9ff6be57beec023170973fb143d92b3db59d72692bde7b20587d19ceaf44d5a009805cef78262ea5042c017e9a381abc357f9a929a0eee4479e0
7
- data.tar.gz: 222476d927b6e004c5b3a2367b33680c848293b6712b6e356b22174564ad7ce3042c2a495b71576bc79ab380d7c3b20fb64c074a52e75c6c7321a9f672129d06
6
+ metadata.gz: af7be52af7e0d12dc253e7ed1ca1234be0001ac825d86a1d6380f2fc9a4a3a5df5553e87fa1c0731c127f8ea8df13ead94b8f05ece0f5da0471edd3167ce1e77
7
+ data.tar.gz: 37ebc33597cadedd3ff96b52481f979022e48759ffbc4f3a79cc2f843d34e819c04ea7f9f587326a6f6442acf47b8f2724bd4453035d603b257da5938a7df0b1
data/README.md CHANGED
@@ -29,14 +29,14 @@
29
29
  scan
30
30
  ============
31
31
 
32
- [![Twitter: @KauseFx](https://img.shields.io/badge/contact-@KrauseFx-blue.svg?style=flat)](https://twitter.com/KrauseFx)
32
+ [![Twitter: @FastlaneTools](https://img.shields.io/badge/contact-@FastlaneTools-blue.svg?style=flat)](https://twitter.com/FastlaneTools)
33
33
  [![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/fastlane/scan/blob/master/LICENSE)
34
34
  [![Gem](https://img.shields.io/gem/v/scan.svg?style=flat)](http://rubygems.org/gems/scan)
35
35
  [![Build Status](https://img.shields.io/travis/fastlane/scan/master.svg?style=flat)](https://travis-ci.org/fastlane/scan)
36
36
 
37
37
  ###### The easiest way to run tests of your iOS and Mac app
38
38
 
39
- Get in contact with the developer on Twitter: [@KrauseFx](https://twitter.com/KrauseFx)
39
+ Get in contact with the developer on Twitter: [@FastlaneTools](https://twitter.com/FastlaneTools)
40
40
 
41
41
  -------
42
42
  <p align="center">
@@ -6,29 +6,36 @@ module Scan
6
6
  def self.set_additional_default_values
7
7
  config = Scan.config
8
8
 
9
+ # First, try loading the Scanfile from the current directory
10
+ config.load_configuration_file(Scan.scanfile_name)
11
+
12
+ # Detect the project
9
13
  FastlaneCore::Project.detect_projects(config)
10
14
  Scan.project = FastlaneCore::Project.new(config)
11
15
 
12
- # Go into the project's folder
16
+ # Go into the project's folder, as there might be a Snapfile there
13
17
  Dir.chdir(File.expand_path("..", Scan.project.path)) do
14
18
  config.load_configuration_file(Scan.scanfile_name)
15
19
  end
16
20
 
17
21
  Scan.project.select_scheme
18
22
 
19
- default_device if Scan.project.ios?
23
+ default_device_ios if Scan.project.ios?
24
+ default_device_tvos if Scan.project.tvos?
20
25
  detect_destination
21
26
 
22
27
  return config
23
28
  end
24
29
 
25
- def self.default_device
30
+ def self.default_device_ios
26
31
  config = Scan.config
27
32
 
28
33
  if config[:device] # make sure it actually exists
29
34
  device = config[:device].to_s.strip.tr('()', '') # Remove parenthesis
30
35
 
31
- found = FastlaneCore::Simulator.all.find { |d| (d.name + " " + d.ios_version).include? device }
36
+ found = FastlaneCore::Simulator.all.find do |d|
37
+ (d.name + " " + d.ios_version).include? device
38
+ end
32
39
 
33
40
  if found
34
41
  Scan.device = found
@@ -56,6 +63,42 @@ module Scan
56
63
  raise "No simulators found".red unless Scan.device
57
64
  end
58
65
 
66
+ def self.default_device_tvos
67
+ config = Scan.config
68
+
69
+ if config[:device] # make sure it actually exists
70
+ device = config[:device].to_s.strip.tr('()', '') # Remove parenthesis
71
+
72
+ found = FastlaneCore::SimulatorTV.all.find do |d|
73
+ (d.name + " " + d.tvos_version).include? device
74
+ end
75
+
76
+ if found
77
+ Scan.device = found
78
+ return
79
+ else
80
+ Helper.log.error "Couldn't find simulator '#{config[:device]}' - falling back to default simulator".red
81
+ end
82
+ end
83
+
84
+ sims = FastlaneCore::SimulatorTV.all
85
+ xcode_target = Scan.project.build_settings(key: "TVOS_DEPLOYMENT_TARGET")
86
+
87
+ # Filter out any simulators that are not the same major version of our deployment target
88
+ if xcode_target.to_s.length > 0
89
+ min_target = xcode_target.split(".").first.to_i
90
+ sims = sims.select { |s| s.ios_version.to_i >= min_target }
91
+ end
92
+
93
+ # Apple TV 1080p is useful for tests
94
+ found = sims.find { |d| d.name == "Apple TV 1080p" }
95
+ found ||= sims.first # anything is better than nothing
96
+
97
+ Scan.device = found
98
+
99
+ raise "No simulators found".red unless Scan.device
100
+ end
101
+
59
102
  # Is it an iOS device or a Mac?
60
103
  def self.detect_destination
61
104
  if Scan.config[:destination]
@@ -69,6 +112,8 @@ module Scan
69
112
  # building up the destination now
70
113
  if Scan.project.ios?
71
114
  Scan.config[:destination] = "platform=iOS Simulator,id=#{Scan.device.udid}"
115
+ elsif Scan.project.tvos?
116
+ Scan.config[:destination] = "platform=tvOS Simulator,id=#{Scan.device.udid}"
72
117
  else
73
118
  Scan.config[:destination] = "platform=OS X"
74
119
  end
data/lib/scan/options.rb CHANGED
@@ -108,6 +108,7 @@ module Scan
108
108
  raise "File not found at path '#{File.expand_path(value)}'".red unless File.exist?(value)
109
109
  end),
110
110
  FastlaneCore::ConfigItem.new(key: :slack_url,
111
+ short_option: "-i",
111
112
  env_name: "SLACK_URL",
112
113
  description: "Create an Incoming WebHook for your Slack group to post results there",
113
114
  optional: true,
@@ -115,6 +116,7 @@ module Scan
115
116
  raise "Invalid URL, must start with https://" unless value.start_with? "https://"
116
117
  end),
117
118
  FastlaneCore::ConfigItem.new(key: :slack_channel,
119
+ short_option: "-e",
118
120
  env_name: "SCAN_SLACK_CHANNEL",
119
121
  description: "#channel or @username",
120
122
  optional: true),
@@ -66,6 +66,10 @@ module Scan
66
66
  Helper.log.info "Automatically switched to Travis formatter".green
67
67
  end
68
68
 
69
+ if Helper.colors_disabled?
70
+ formatter << "--no-color"
71
+ end
72
+
69
73
  if Scan.config[:output_style] == 'basic'
70
74
  formatter << "--no-utf"
71
75
  end
data/lib/scan/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Scan
2
- VERSION = "0.3.3"
2
+ VERSION = "0.4.1"
3
3
  DESCRIPTION = "Making sure no bad code gets on board"
4
4
  end
data/lib/scan.rb CHANGED
@@ -34,4 +34,5 @@ module Scan
34
34
  end
35
35
 
36
36
  Helper = FastlaneCore::Helper # you gotta love Ruby: Helper.* should use the Helper class contained in FastlaneCore
37
+ UI = FastlaneCore::UI
37
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-16 00:00:00.000000000 Z
11
+ date: 2016-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane_core
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.26.6
19
+ version: 0.32.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 1.0.0
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.26.6
29
+ version: 0.32.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 1.0.0