xcoder 0.1.15 → 0.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. data/.gitignore +6 -0
  2. data/.rbenv-version +1 -0
  3. data/.rvmrc +1 -1
  4. data/Gemfile +10 -2
  5. data/README.md +110 -9
  6. data/Rakefile +2 -2
  7. data/bin/xcoder +74 -0
  8. data/lib/xcode/builder.rb +1 -2
  9. data/lib/xcode/builder/base_builder.rb +231 -102
  10. data/lib/xcode/builder/build_parser.rb +146 -0
  11. data/lib/xcode/builder/project_target_config_builder.rb +2 -2
  12. data/lib/xcode/builder/scheme_builder.rb +29 -12
  13. data/lib/xcode/buildspec.rb +286 -0
  14. data/lib/xcode/configuration_list.rb +24 -24
  15. data/lib/xcode/deploy/ftp.rb +56 -0
  16. data/lib/xcode/deploy/kickfolio.rb +18 -0
  17. data/lib/xcode/deploy/s3.rb +38 -0
  18. data/lib/xcode/deploy/ssh.rb +43 -0
  19. data/lib/xcode/deploy/templates/index.rhtml +22 -0
  20. data/lib/xcode/deploy/templates/manifest.rhtml +31 -0
  21. data/lib/xcode/deploy/testflight.rb +32 -27
  22. data/lib/xcode/deploy/web_assets.rb +39 -0
  23. data/lib/xcode/info_plist.rb +16 -0
  24. data/lib/xcode/keychain.rb +33 -10
  25. data/lib/xcode/platform.rb +65 -0
  26. data/lib/xcode/project.rb +7 -3
  27. data/lib/xcode/provisioning_profile.rb +38 -2
  28. data/lib/xcode/scheme.rb +44 -17
  29. data/lib/xcode/shell/command.rb +79 -5
  30. data/lib/xcode/terminal_output.rb +116 -0
  31. data/lib/xcode/test/formatters/junit_formatter.rb +7 -2
  32. data/lib/xcode/test/formatters/stdout_formatter.rb +34 -25
  33. data/lib/xcode/test/parsers/kif_parser.rb +87 -0
  34. data/lib/xcode/test/parsers/ocunit_parser.rb +3 -3
  35. data/lib/xcode/version.rb +1 -1
  36. data/lib/xcode/workspace.rb +13 -5
  37. data/lib/xcoder.rb +33 -31
  38. data/spec/TestProject/TestProject.xcodeproj/project.pbxproj +1627 -1015
  39. data/spec/TestWorkspace.xcworkspace/contents.xcworkspacedata +7 -0
  40. data/spec/builder_spec.rb +87 -71
  41. data/spec/deploy_spec.rb +63 -0
  42. data/spec/ocunit_parser_spec.rb +1 -1
  43. data/xcoder.gemspec +3 -1
  44. metadata +95 -19
  45. data/lib/xcode/buildfile.rb +0 -101
  46. data/lib/xcode/shell.rb +0 -26
  47. data/spec/deploy_testflight_spec.rb +0 -27
@@ -1,101 +0,0 @@
1
- module Xcode
2
- class Buildfile
3
-
4
- def initialize
5
- @values = {}
6
- @before = {:clean => [], :build => [], :package => []}
7
- @after = {:clean => [], :build => [], :package => []}
8
- end
9
-
10
- def method_missing(method, *args)
11
- @values[method.to_sym] = args[0]
12
- end
13
-
14
- def before(event, &block)
15
- @before[event]<< block
16
- end
17
-
18
- def after(event, &block)
19
- @after[event]<< block
20
- end
21
-
22
- def getBinding
23
- binding()
24
- end
25
-
26
- def self.load(file)
27
- file = File.expand_path file
28
- raise "Unable to find the buildfile #{file}" if !File.exists? file
29
-
30
-
31
- puts "Loading Buildfile: #{file}"
32
- bc = Xcode::Buildfile.new
33
- eval(File.read(file), bc.getBinding, file)
34
- bc
35
- end
36
-
37
- def build
38
- label = "#{@values[:target]}"
39
- puts "[#{label}] Loading project #{@values[:project]}, target #{@values[:target]}, config #{@values[:config]}"
40
- config = Xcode.project(@values[:project]).target(@values[:target]).config(@values[:config])
41
- config.info_plist do |info|
42
- puts "[#{label}] Update info plist version to #{@values[:version]}"
43
- info.version = @values[:version]
44
- end
45
- builder = config.builder
46
-
47
- # unless @values[:identity].nil?
48
- # builder.identity = @values[:identity]
49
- # puts "[#{label}] Set build identity to #{@values[:identity]}"
50
- # end
51
-
52
- unless @values[:profile].nil?
53
- builder.profile = @values[:profile]
54
- puts "[#{label}] Set build profile to #{@values[:profile]}"
55
- end
56
-
57
- Keychain.temp do |kc|
58
- kc.import @values[:certificate], @values[:password]
59
-
60
- builder.identity = @values[:identity] || kc.identities.first
61
- builder.keychain = kc
62
-
63
- puts "[#{label}] CLEAN"
64
- @before[:clean].each do |b|
65
- b.call(builder)
66
- end
67
- builder.clean
68
- @after[:clean].each do |b|
69
- b.call(builder)
70
- end
71
-
72
- puts "[#{label}] BUILD"
73
- @before[:build].each do |b|
74
- b.call(builder)
75
- end
76
- builder.build
77
- @after[:build].each do |b|
78
- b.call(builder)
79
- end
80
-
81
- puts "[#{label}] PACKAGE"
82
- @before[:package].each do |b|
83
- b.call(builder)
84
- end
85
- builder.package
86
- @after[:package].each do |b|
87
- b.call(builder)
88
- end
89
- end
90
-
91
-
92
- if @values.has_key? :testflight_api_token and @values.has_key? :testflight_team_token
93
- puts "[#{label}] Uploading to testflight"
94
- `curl -X POST http://testflightapp.com/api/builds.json -F file=@"#{builder.ipa_path}" -F dsym=@"#{builder.dsym_zip_path}" -F api_token='#{@values[:testflight_api_token]}' -F team_token='#{@values[:testflight_team_token]}' -F notify=True -F notes=\"#{@values[:testflight_notes]}\" -F distribution_lists='#{@values[:testflight_lists].join(',')}'`
95
- end
96
-
97
- builder
98
- end
99
-
100
- end
101
- end
@@ -1,26 +0,0 @@
1
- require 'xcode/shell/command.rb'
2
-
3
- module Xcode
4
- module Shell
5
-
6
- class ExecutionError < StandardError; end
7
-
8
- def self.execute(cmd, show_output=true)
9
- out = []
10
- cmd = cmd.to_s
11
-
12
- puts "EXECUTE: #{cmd}"
13
- IO.popen (cmd) do |f|
14
- f.each do |line|
15
- puts line if show_output
16
- yield(line) if block_given?
17
- out << line
18
- end
19
- end
20
- #Process.wait
21
- raise ExecutionError.new("Error (#{$?.exitstatus}) executing '#{cmd}'\n\n #{out.join(" ")}") if $?.exitstatus>0
22
- #puts "RETURN: #{out.inspect}"
23
- out
24
- end
25
- end
26
- end
@@ -1,27 +0,0 @@
1
- require_relative 'spec_helper'
2
-
3
- describe Xcode::Deploy::Testflight do
4
-
5
- let(:testflight) { Xcode::Deploy::Testflight.new 'api token', 'team token' }
6
-
7
- it "should be configured with api and team token" do
8
- testflight.api_token.should == 'api token'
9
- testflight.team_token.should == 'team token'
10
- end
11
-
12
- it "should call curl with correct bulld paths" do
13
- Xcode::Shell.should_receive(:execute) do |arg|
14
- arg.is_a? Xcode::Shell::Command
15
- arg.cmd.should == 'curl'
16
- arg.args.should include('-F file=@"ipa path"')
17
- arg.args.should include('-F dsym=@"dsym path"')
18
- arg.args.should include("-F api_token='api token'")
19
- arg.args.should include("-F team_token='team token'")
20
-
21
- ['{"response":"ok"}']
22
- end
23
- response = testflight.upload('ipa path', 'dsym path')
24
- response['response'].should == 'ok'
25
- end
26
-
27
- end