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 +4 -4
- data/README.md +2 -2
- data/lib/scan/detect_values.rb +49 -4
- data/lib/scan/options.rb +2 -0
- data/lib/scan/test_command_generator.rb +4 -0
- data/lib/scan/version.rb +1 -1
- data/lib/scan.rb +1 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 533ce99c41f14c934f7bb3d544575cf113462fd3
|
4
|
+
data.tar.gz: bbe83676310a88b0e61a1b69cc152ce13e975aee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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: @
|
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: [@
|
39
|
+
Get in contact with the developer on Twitter: [@FastlaneTools](https://twitter.com/FastlaneTools)
|
40
40
|
|
41
41
|
-------
|
42
42
|
<p align="center">
|
data/lib/scan/detect_values.rb
CHANGED
@@ -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
|
-
|
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.
|
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
|
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),
|
data/lib/scan/version.rb
CHANGED
data/lib/scan.rb
CHANGED
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.
|
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:
|
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.
|
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.
|
29
|
+
version: 0.32.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 1.0.0
|