xctasks 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -5
- data/lib/xctasks/test_task.rb +23 -4
- data/lib/xctasks/version.rb +1 -1
- data/spec/test_task_spec.rb +37 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 398b35d69e8cb72b95fbd9797f99d4fbbe7c0c99
|
4
|
+
data.tar.gz: 56bc397573f2e17add6b2d4955884817076b7dbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d710b1d4ae9f0f050a06b57f5a10ebe22f8db53452f4193a396b7b537b6b623fb7f8f0af06863c2641fb5677d91e84ad20dc10f1f5982f97a8c462811db06eca
|
7
|
+
data.tar.gz: b252c5756bd9ade5cb9959000604b80ed86ee6da4dfd705b7f4c19e3ca38f0a0862476717a343d83dc751e04844e8c3eb462a86a254b54427a0013560400f706
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
xctasks (0.
|
4
|
+
xctasks (0.6.0)
|
5
5
|
nokogiri (~> 1.6, >= 1.6.3.1)
|
6
6
|
rake (~> 10.0, >= 10.0.0)
|
7
7
|
|
@@ -19,11 +19,11 @@ GEM
|
|
19
19
|
debugger-linecache (1.2.0)
|
20
20
|
diff-lcs (1.2.5)
|
21
21
|
excon (0.26.0)
|
22
|
-
mini_portile (0.6.
|
22
|
+
mini_portile (0.6.2)
|
23
23
|
multi_json (1.9.0)
|
24
|
-
nokogiri (1.6.
|
25
|
-
mini_portile (
|
26
|
-
rake (10.
|
24
|
+
nokogiri (1.6.6.2)
|
25
|
+
mini_portile (~> 0.6.0)
|
26
|
+
rake (10.4.2)
|
27
27
|
rspec (2.14.1)
|
28
28
|
rspec-core (~> 2.14.0)
|
29
29
|
rspec-expectations (~> 2.14.0)
|
data/lib/xctasks/test_task.rb
CHANGED
@@ -156,6 +156,8 @@ module XCTasks
|
|
156
156
|
destination = Destination.new(specifier)
|
157
157
|
yield destination if block_given?
|
158
158
|
@destinations << destination
|
159
|
+
elsif specifier.kind_of?(Destination)
|
160
|
+
@destinations << specifier
|
159
161
|
else
|
160
162
|
raise ArgumentError, "Cannot configure a destination with a #{specifier}"
|
161
163
|
end
|
@@ -238,7 +240,6 @@ module XCTasks
|
|
238
240
|
def run_tests(options = {})
|
239
241
|
ios_version = options[:ios_version]
|
240
242
|
XCTasks::Command.run(%q{killall "iPhone Simulator"}, false) if sdk == :iphonesimulator
|
241
|
-
|
242
243
|
target = workspace ? "-workspace #{workspace}" : "-project #{project}"
|
243
244
|
|
244
245
|
output_log_command = output_log ? "| tee -a #{output_log}" : nil
|
@@ -297,13 +298,14 @@ module XCTasks
|
|
297
298
|
|
298
299
|
include ::Rake::DSL if defined?(::Rake::DSL)
|
299
300
|
|
300
|
-
attr_reader :namespace_name, :prepare_dependency, :config, :subtasks
|
301
|
+
attr_reader :namespace_name, :prepare_dependency, :config, :subtasks, :destination
|
301
302
|
extend Configuration::Delegations
|
302
303
|
|
303
304
|
def initialize(namespace_name = :test)
|
304
305
|
@namespace_name = namespace_name
|
305
306
|
@config = Configuration.new
|
306
307
|
@subtasks = []
|
308
|
+
@destination
|
307
309
|
@namespace_name = namespace_name.kind_of?(Hash) ? namespace_name.keys.first : namespace_name
|
308
310
|
@prepare_dependency = namespace_name.kind_of?(Hash) ? namespace_name.values.first : nil
|
309
311
|
|
@@ -312,7 +314,7 @@ module XCTasks
|
|
312
314
|
raise ConfigurationError, "At least one subtask must be configured" if subtasks.empty?
|
313
315
|
define_rake_tasks
|
314
316
|
end
|
315
|
-
|
317
|
+
|
316
318
|
def subtasks=(subtasks)
|
317
319
|
if subtasks.kind_of?(Hash)
|
318
320
|
subtasks.each { |name, scheme| subtask(name => scheme) }
|
@@ -324,9 +326,26 @@ module XCTasks
|
|
324
326
|
def subtask(name_options)
|
325
327
|
subtask = Subtask.new(name_options, config)
|
326
328
|
yield subtask if block_given?
|
329
|
+
if @destination
|
330
|
+
subtask.destination @destination
|
331
|
+
end
|
327
332
|
@subtasks << subtask
|
328
333
|
end
|
329
|
-
|
334
|
+
|
335
|
+
def destination(specifier = {})
|
336
|
+
if specifier.kind_of?(String)
|
337
|
+
raise ArgumentError, "Cannot configure a destination via a block when a complete String specifier is provided" if block_given?
|
338
|
+
@destinations << specifier.shellescape
|
339
|
+
elsif specifier.kind_of?(Hash)
|
340
|
+
destination = Destination.new(specifier)
|
341
|
+
yield destination if block_given?
|
342
|
+
@destination = destination
|
343
|
+
subtasks.each do |s|
|
344
|
+
s.destination destination
|
345
|
+
end
|
346
|
+
end
|
347
|
+
end
|
348
|
+
|
330
349
|
def define_rake_tasks
|
331
350
|
namespace self.namespace_name do
|
332
351
|
task (prepare_dependency ? { prepare: prepare_dependency} : :prepare ) do
|
data/lib/xctasks/version.rb
CHANGED
data/spec/test_task_spec.rb
CHANGED
@@ -350,6 +350,7 @@ describe XCTasks::TestTask do
|
|
350
350
|
end
|
351
351
|
end
|
352
352
|
end
|
353
|
+
|
353
354
|
|
354
355
|
describe 'spec:unit' do
|
355
356
|
subject { Rake.application['spec:unit'] }
|
@@ -377,6 +378,42 @@ describe XCTasks::TestTask do
|
|
377
378
|
end
|
378
379
|
end
|
379
380
|
|
381
|
+
describe 'Global destination configuration applies to multiple subtasks' do
|
382
|
+
let!(:task) do
|
383
|
+
XCTasks::TestTask.new(:spec) do |t|
|
384
|
+
t.workspace = 'LayerKit.xcworkspace'
|
385
|
+
t.runner = :xctool
|
386
|
+
t.subtasks = {unit: 'Unit Tests', functional: 'Functional Tests'}
|
387
|
+
t.destination do |d|
|
388
|
+
d.platform = :iossimulator
|
389
|
+
d.name = 'iPhone 6 Plus'
|
390
|
+
d.os = :latest
|
391
|
+
end
|
392
|
+
end
|
393
|
+
end
|
394
|
+
|
395
|
+
describe 'spec:unit' do
|
396
|
+
it "configures the destination for each subtask" do
|
397
|
+
task.subtasks do |t|
|
398
|
+
t.destination.platform.should == :iossimulator
|
399
|
+
t.destination.name.should == 'iPhone 6 Plus'
|
400
|
+
t.destination.os.should == :latest
|
401
|
+
end
|
402
|
+
end
|
403
|
+
end
|
404
|
+
|
405
|
+
describe 'spec:unit' do
|
406
|
+
subject { Rake.application['spec:unit'] }
|
407
|
+
it "configures the appropriate destination commands" do
|
408
|
+
subject.invoke
|
409
|
+
@commands.should == [
|
410
|
+
"killall \"iPhone Simulator\"",
|
411
|
+
"/usr/local/bin/xctool -workspace LayerKit.xcworkspace -scheme 'Unit Tests' -sdk iphonesimulator -destination platform='iOS Simulator',name='iPhone 6 Plus',OS='latest' clean build test"
|
412
|
+
]
|
413
|
+
end
|
414
|
+
end
|
415
|
+
end
|
416
|
+
|
380
417
|
describe 'SDK Configuration' do
|
381
418
|
let!(:task) do
|
382
419
|
XCTasks::TestTask.new(:spec) do |t|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xctasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Blake Watters
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|