xcoder 0.0.12 → 0.0.14

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.
data/bin/xcoder-build ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'xcoder'
4
+
5
+ dir = ARGV[0]||'.'
6
+
7
+ bc = Xcode::Buildfile.load("#{dir}/Buildfile")
8
+ bc.build
data/lib/xcode/builder.rb CHANGED
@@ -58,7 +58,7 @@ module Xcode
58
58
 
59
59
  cmd << "TEST_AFTER_BUILD=YES"
60
60
  cmd << "TEST_HOST=''"
61
- cmd << "-sdk iphonesimulator5.0"
61
+ cmd << "-sdk iphonesimulator5.0" # FIXME: hardcoded version, should be smarter
62
62
  end
63
63
 
64
64
  Xcode::Shell.execute(cmd)
@@ -0,0 +1,94 @@
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
+ puts "[#{label}] CLEAN"
58
+ @before[:clean].each do |b|
59
+ b.call(builder)
60
+ end
61
+ builder.clean
62
+ @after[:clean].each do |b|
63
+ b.call(builder)
64
+ end
65
+
66
+ puts "[#{label}] BUILD"
67
+ @before[:build].each do |b|
68
+ b.call(builder)
69
+ end
70
+ builder.build
71
+ @after[:build].each do |b|
72
+ b.call(builder)
73
+ end
74
+
75
+ puts "[#{label}] PACKAGE"
76
+ @before[:package].each do |b|
77
+ b.call(builder)
78
+ end
79
+ builder.package
80
+ @after[:package].each do |b|
81
+ b.call(builder)
82
+ end
83
+
84
+
85
+ if @values.has_key? :testflight_api_token and @values.has_key? :testflight_team_token
86
+ puts "[#{label}] Uploading to testflight"
87
+ `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_list]}'`
88
+ end
89
+
90
+ builder
91
+ end
92
+
93
+ end
94
+ end
@@ -40,6 +40,7 @@ module Xcode
40
40
  puts @json.inspect
41
41
  info = Xcode::InfoPlist.new(self, info_plist_location)
42
42
  yield info if block_given?
43
+ info.save
43
44
  info
44
45
  end
45
46
 
@@ -2,6 +2,9 @@ module Xcode
2
2
  class ProvisioningProfile
3
3
  attr_reader :path, :name, :uuid, :identifiers
4
4
  def initialize(path)
5
+
6
+ raise "Provisioning profile '#{path}' does not exist" unless File.exists? path
7
+
5
8
  @path = path
6
9
  @identifiers = []
7
10
 
data/lib/xcode/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Xcode
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.14"
3
3
  end
data/lib/xcoder.rb CHANGED
@@ -7,6 +7,7 @@ require "xcode/shell"
7
7
  require 'plist'
8
8
  require 'xcode/keychain'
9
9
  require 'xcode/workspace'
10
+ require 'xcode/buildfile'
10
11
 
11
12
  module Xcode
12
13
  @@projects = nil
@@ -0,0 +1,20 @@
1
+ project :TestProject
2
+ target :TestProject
3
+ config :Release
4
+ version "#{ENV['BUILD_NUMBER']}"
5
+ #profile ''
6
+ #identity ''
7
+
8
+ #testflight_api_token ''
9
+ #testflight_team_token ''
10
+ #testflight_notes `git log -n 1`
11
+ #testflight_list 'Internal'
12
+
13
+ before :clean do |builder|
14
+ `rm -Rf Local.vendorbackup*`
15
+ end
16
+
17
+ before :build do |builder|
18
+ #`vendor install`
19
+ `rm -Rf Local.vendorbackup*`
20
+ end
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
2
+ <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
3
  <plist version="1.0">
4
4
  <dict>
5
5
  <key>CFBundleDevelopmentRegion</key>
@@ -23,7 +23,7 @@
23
23
  <key>CFBundleSignature</key>
24
24
  <string>????</string>
25
25
  <key>CFBundleVersion</key>
26
- <string>1.0</string>
26
+ <string></string>
27
27
  <key>LSRequiresIPhoneOS</key>
28
28
  <true/>
29
29
  <key>UIRequiredDeviceCapabilities</key>
data/xcoder.gemspec CHANGED
@@ -21,5 +21,4 @@ Gem::Specification.new do |s|
21
21
  s.add_runtime_dependency "json"
22
22
  s.add_runtime_dependency "plist"
23
23
  s.add_runtime_dependency "nokogiri"
24
-
25
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcoder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.14
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-06 00:00:00.000000000Z
12
+ date: 2012-01-31 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
16
- requirement: &70200469164180 !ruby/object:Gem::Requirement
16
+ requirement: &70352404323860 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70200469164180
24
+ version_requirements: *70352404323860
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: plist
27
- requirement: &70200469163760 !ruby/object:Gem::Requirement
27
+ requirement: &70352404323440 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70200469163760
35
+ version_requirements: *70352404323440
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: nokogiri
38
- requirement: &70200469163340 !ruby/object:Gem::Requirement
38
+ requirement: &70352404323020 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,12 +43,13 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70200469163340
46
+ version_requirements: *70352404323020
47
47
  description: Provides a ruby based object-model for parsing project structures and
48
48
  invoking builds
49
49
  email:
50
50
  - ray@wirestorm.net
51
- executables: []
51
+ executables:
52
+ - xcoder-build
52
53
  extensions: []
53
54
  extra_rdoc_files: []
54
55
  files:
@@ -57,7 +58,9 @@ files:
57
58
  - Gemfile
58
59
  - README.md
59
60
  - Rakefile
61
+ - bin/xcoder-build
60
62
  - lib/xcode/builder.rb
63
+ - lib/xcode/buildfile.rb
61
64
  - lib/xcode/configuration.rb
62
65
  - lib/xcode/info_plist.rb
63
66
  - lib/xcode/keychain.rb
@@ -69,6 +72,7 @@ files:
69
72
  - lib/xcode/version.rb
70
73
  - lib/xcode/workspace.rb
71
74
  - lib/xcoder.rb
75
+ - spec/TestProject/Buildfile
72
76
  - spec/TestProject/TestProject.xcodeproj/project.pbxproj
73
77
  - spec/TestProject/TestProject.xcodeproj/xcuserdata/ray.xcuserdatad/xcschemes/TestProject.xcscheme
74
78
  - spec/TestProject/TestProject.xcodeproj/xcuserdata/ray.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -117,6 +121,7 @@ signing_key:
117
121
  specification_version: 3
118
122
  summary: Ruby wrapper around xcodebuild, xcrun, agvtool and pbxproj files
119
123
  test_files:
124
+ - spec/TestProject/Buildfile
120
125
  - spec/TestProject/TestProject.xcodeproj/project.pbxproj
121
126
  - spec/TestProject/TestProject.xcodeproj/xcuserdata/ray.xcuserdatad/xcschemes/TestProject.xcscheme
122
127
  - spec/TestProject/TestProject.xcodeproj/xcuserdata/ray.xcuserdatad/xcschemes/xcschememanagement.plist