cuesmash 0.1.1 → 0.1.2

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: 7fc1559a4ad5b36b20017ffd68426fadaaf94946
4
- data.tar.gz: 7bc71e05fe986b27d87ed6bd96a7c57a67752b3e
3
+ metadata.gz: 114640d3f030cd5c0ea91110205740018e189014
4
+ data.tar.gz: 6ac499c5a8539f8cea140afab08c86a57db14b19
5
5
  SHA512:
6
- metadata.gz: 63fba17551d25084b246c4f59b17b16efa537e005b47686adaa3f4f53aea7fabd00c1ff4d8c3a00a0d33524b79883330fe7df0eaa86e3fcb0f8b92f0ffb6f507
7
- data.tar.gz: 6c97b8a6524d1be26847c8c634b14c9db0df4096117ac1e61d6ea24a1e13042268e1fed5170bf10bbb7e414a14fb46487393f8dc60112bfed6f29f03e3054c36
6
+ metadata.gz: a334824e690b218cf2f93268eef0adcbaf4b6242574b48ead7b3e890105faeb3d2549de29f696b681436a72080e76d4968514951632e5ed0f2ff8c1ddc61bfae
7
+ data.tar.gz: fe92bdc9e3ddeeb9133d21223413877137bfb8d45496b69a028557a902bd415ec7aedef4fe95ab1bab13dac42764e7db1923d36172e9b7773e8d311dd0f1a3cc
data/Gemfile.lock CHANGED
@@ -1,15 +1,21 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cuesmash (0.0.1)
4
+ cuesmash (0.1.1)
5
5
  CFPropertyList
6
6
  thor
7
+ xcpretty
7
8
 
8
9
  GEM
9
10
  remote: https://rubygems.org/
10
11
  specs:
11
12
  CFPropertyList (2.2.8)
13
+ byebug (3.2.0)
14
+ columnize (~> 0.8)
15
+ debugger-linecache (~> 1.2)
12
16
  coderay (1.0.9)
17
+ columnize (0.8.9)
18
+ debugger-linecache (1.2.0)
13
19
  diff-lcs (1.2.5)
14
20
  ffi (1.9.0)
15
21
  formatador (0.2.4)
@@ -48,12 +54,14 @@ GEM
48
54
  rspec-mocks (2.14.4)
49
55
  slop (3.4.4)
50
56
  thor (0.18.1)
57
+ xcpretty (0.1.6)
51
58
 
52
59
  PLATFORMS
53
60
  ruby
54
61
 
55
62
  DEPENDENCIES
56
63
  bundler (~> 1.3)
64
+ byebug
57
65
  cuesmash!
58
66
  guard-rspec
59
67
  pry
data/cuesmash.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "cuesmash"
7
- spec.version = "0.1.1"
7
+ spec.version = "0.1.2"
8
8
  spec.authors = ["Alex Fish", "Jarod McBride"]
9
9
  spec.email = ["fish@ustwo.co.uk", "jarod@ustwo.com"]
10
10
  spec.description = "A gift for Juan"
@@ -28,6 +28,7 @@ Gem::Specification.new do |spec|
28
28
 
29
29
  spec.add_runtime_dependency "CFPropertyList"
30
30
  spec.add_runtime_dependency "thor"
31
+ spec.add_runtime_dependency "xcpretty"
31
32
 
32
33
  spec.executables << "cuesmash"
33
34
  end
@@ -21,7 +21,7 @@ module Cuesmash
21
21
  # @param *args [Array] An Array of arguments to play with
22
22
  #
23
23
  # @return [type] [description]
24
- def execute(device:, os:, server:, tags:, scheme:, debug: false, format: nil, output: nil)
24
+ def execute(device:, os:, server:, tags:, scheme:, debug: false, format: nil, output: nil, travis: nil)
25
25
 
26
26
  if debug
27
27
  Logger.level = ::Logger::DEBUG
@@ -31,7 +31,7 @@ module Cuesmash
31
31
  end
32
32
 
33
33
  # Create new IosApp object
34
- app = IosApp.new(file_name: scheme)
34
+ app = IosApp.new(file_name: scheme, travis_build: travis)
35
35
  app_server = AppiumServer.new
36
36
 
37
37
  # Compile the project
@@ -46,12 +46,14 @@ module Cuesmash
46
46
  run_tests(os, tags, format, output)
47
47
  # Stop the Appium server
48
48
  # app_server.stop_server
49
- end
49
+ end # compile
50
50
 
51
- # clean up temp dir
52
- Logger.info "Cleaning up tmp dir"
53
- FileUtils.remove_entry app.tmp_dir
54
- end
51
+ unless travis
52
+ # clean up temp dir
53
+ Logger.info "Cleaning up tmp dir\n"
54
+ FileUtils.remove_entry app.tmp_dir
55
+ end
56
+ end # execute
55
57
 
56
58
  #
57
59
  # Kick off a compile
@@ -36,8 +36,8 @@ module Cuesmash
36
36
  [out, err].each do |stream|
37
37
  Thread.new do
38
38
  until (line = stream.gets).nil? do
39
- print "."
40
- output << line
39
+ Logger.info line
40
+ # output << line
41
41
  end
42
42
  end
43
43
  end
@@ -77,8 +77,10 @@ module Cuesmash
77
77
  #
78
78
  # @return [String] The full xcode build command with args
79
79
  def command
80
- xcode_command = "xcodebuild #{workspace} -scheme #{@scheme} -sdk iphonesimulator CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -derivedDataPath #{@tmp_dir}"
81
- Logger.info "xcode_command == #{xcode_command}"
80
+ # xcode_command = "xcodebuild #{workspace} -scheme #{@scheme} -sdk iphonesimulator CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -derivedDataPath #{@tmp_dir}"
81
+ xcode_command = "set -o pipefail && xcodebuild #{workspace} -scheme #{@scheme} -derivedDataPath #{@tmp_dir} -configuration Release OBJROOT=#{@tmp_dir} SYMROOT=#{@tmp_dir} -sdk iphonesimulator build | bundle exec xcpretty -c"
82
+
83
+ Logger.debug "xcode_command == #{xcode_command}"
82
84
  xcode_command
83
85
  end
84
86
 
@@ -28,10 +28,18 @@ module Cuesmash
28
28
  # @param file_name [String] The usually is the scheme of the xcode project
29
29
  #
30
30
  # @return [App] A app instance
31
- def initialize(file_name:)
31
+ def initialize(file_name:, travis_build: false)
32
32
  @app_name = "#{file_name}" << ".app"
33
33
  @tmp_dir = Dir.mktmpdir(file_name)
34
- @app_dir = "#{@tmp_dir}" << "/Build/Products/Debug-iphonesimulator/"
34
+
35
+ # if we are running this on travis then we want to build inside the project
36
+ # dir (it's a VM so it gets cleaned up each run). Otherwise let's create
37
+ # our own tmp dir for each build.
38
+ if travis_build
39
+ @app_dir = "./build/Release-iphonesimulator/"
40
+ else
41
+ @app_dir = "#{@tmp_dir}" << "/Release-iphonesimulator/"
42
+ end
35
43
  @app_path = "#{@app_dir}" << "#{@app_name}"
36
44
  end
37
45
  end
@@ -26,6 +26,7 @@ module Cuesmash
26
26
  method_option :scheme, type: :string, aliases: "-s", desc: "the Xcode scheme to build"
27
27
  method_option :tags, type: :array, aliases: "-t", desc: "the tags to pass to cucumber, for multiple tags pass one per tag"
28
28
  method_option :debug, type: :boolean, default: false, aliases: "-d", desc: "turn on debug output."
29
+ method_option :travis_ci, type: :boolean, default: false, aliases: "-c", desc: "turn on settings for building on Travis CI"
29
30
  # method_option :server, type: :string, aliases: "-r", desc: ""
30
31
  def test
31
32
 
@@ -40,16 +41,9 @@ module Cuesmash
40
41
  config['devices'].each do |device, oses|
41
42
  oses.each do |os|
42
43
  say "\n============================\ntesting iOS #{os} on #{device}", :green
43
- Cuesmash::Command.execute(device: device, os: os, server: options[:server], tags: options[:tags], scheme: options[:scheme], debug: options[:debug])
44
+ Cuesmash::Command.execute(device: device, os: os, server: options[:server], tags: options[:tags], scheme: options[:scheme], travis: options[:travis_ci], debug: options[:debug])
44
45
  end
45
46
  end # device each
46
47
  end # test
47
-
48
- desc "demo FILE", "an example task"
49
- method_option :delete, aliases: "-d", desc: "Delete the file after parsing it"
50
- def demo
51
- puts "options == #{options}"
52
- end
53
-
54
48
  end # Start class
55
49
  end # module Cuesmash
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cuesmash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Fish
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-09-25 00:00:00.000000000 Z
12
+ date: 2014-09-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -123,6 +123,20 @@ dependencies:
123
123
  - - ">="
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: xcpretty
128
+ requirement: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ type: :runtime
134
+ prerelease: false
135
+ version_requirements: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - ">="
138
+ - !ruby/object:Gem::Version
139
+ version: '0'
126
140
  description: A gift for Juan
127
141
  email:
128
142
  - fish@ustwo.co.uk
@@ -132,7 +146,6 @@ executables:
132
146
  extensions: []
133
147
  extra_rdoc_files: []
134
148
  files:
135
- - ".cuesmash.yml"
136
149
  - ".gitignore"
137
150
  - ".travis.yml"
138
151
  - Gemfile
data/.cuesmash.yml DELETED
@@ -1,12 +0,0 @@
1
- devices:
2
- iPhone 5s:
3
- [7.1, 8.0]
4
-
5
- iPhone 5:
6
- [7.1, 8.0]
7
-
8
- iPhone 6:
9
- [8.0]
10
-
11
- iPhone 6 Plus:
12
- [8.0]