xcoder 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/.rvmrc ADDED
@@ -0,0 +1,4 @@
1
+ rvm use 1.9.2@xcoder
2
+ rvm_install_on_use_flag=1
3
+ rvm_project_rvmrc=1
4
+ rvm_gemset_create_on_use_flag=1
@@ -1,3 +1,5 @@
1
+ require 'xcode/shell'
2
+
1
3
  module Xcode
2
4
  class Configuration
3
5
  attr_reader :target
@@ -48,7 +50,7 @@ module Xcode
48
50
  cmd << "-project \"#{@target.project.path}\""
49
51
  cmd << "-target \"#{@target.name}\""
50
52
  cmd << "-configuration \"#{name}\""
51
- execute(cmd)
53
+ Xcode::Shell.execute(cmd)
52
54
  end
53
55
 
54
56
  def clean
@@ -59,7 +61,7 @@ module Xcode
59
61
  cmd << "-target \"#{@target.name}\""
60
62
  cmd << "-configuration \"#{name}\""
61
63
  cmd << "clean"
62
- execute(cmd)
64
+ Xcode::Shell.execute(cmd)
63
65
  end
64
66
 
65
67
  def sign(identity)
@@ -70,7 +72,7 @@ module Xcode
70
72
  cmd << "--resource-rules=\"#{app_path}/ResourceRules.plist\""
71
73
  cmd << "--entitlements \"#{entitlements_path}\""
72
74
  cmd << "\"#{ipa_path}\""
73
- execute(cmd)
75
+ Xcode::Shell.execute(cmd)
74
76
  end
75
77
 
76
78
  def entitlements_path
@@ -101,7 +103,7 @@ module Xcode
101
103
  cmd << "--embed \"#{options[:profile]}\""
102
104
  end
103
105
 
104
- execute(cmd)
106
+ Xcode::Shell.execute(cmd)
105
107
  end
106
108
 
107
109
  private
@@ -0,0 +1,20 @@
1
+ module Xcode
2
+ module Shell
3
+ def self.execute(bits, show_output=true)
4
+ out = []
5
+ cmd = bits.is_a?(Array) ? bits.join(' ') : bits
6
+
7
+ puts "EXECUTE: #{cmd}"
8
+ IO.popen (cmd) do |f|
9
+ f.each do |line|
10
+ puts line if show_output
11
+ out << line
12
+ end
13
+ end
14
+ #Process.wait
15
+ raise "Error (#{$?.exitstatus}) executing '#{cmd}'\n\n #{out.join(" ")}" if $?.exitstatus>0
16
+ #puts "RETURN: #{out.inspect}"
17
+ out
18
+ end
19
+ end
20
+ end
@@ -1,3 +1,3 @@
1
1
  module Xcode
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -3,6 +3,8 @@ require 'fileutils'
3
3
  require "xcode/version"
4
4
  require "xcode/project"
5
5
  require "xcode/info_plist"
6
+ require "xcode/shell"
7
+ require 'plist'
6
8
 
7
9
  module Xcode
8
10
  @@projects = nil
@@ -16,6 +18,29 @@ module Xcode
16
18
  # raise "Unable to find project named #{name}"
17
19
  # end
18
20
 
21
+ def self.import_certificate(cert, password, keychain="~/Library/Keychains/login.keychain")
22
+ cmd = []
23
+ cmd << "security"
24
+ cmd << "import '#{cert}'"
25
+ cmd << "-k #{keychain}"
26
+ cmd << "-P #{password}"
27
+ cmd << "-T /usr/bin/codesign"
28
+ Xcode::Shell.execute(cmd)
29
+ end
30
+
31
+ def self.import_provisioning_profile(profile)
32
+ uuid = nil
33
+ File.open(profile, "rb") do |f|
34
+ input = f.read
35
+ input=~/<key>UUID<\/key>.*<string>(.*)<\/string>/im
36
+ uuid = $1.strip
37
+ end
38
+
39
+ puts "Importing profile #{profile} with UUID #{uuid}"
40
+
41
+ Xcode::Shell.execute("cp #{profile} ~/Library/MobileDevice/Provisioning\\ Profiles/#{uuid}.mobileprovision")
42
+ end
43
+
19
44
  def self.find_projects(dir='.')
20
45
  parse_projects(dir)
21
46
  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.6
4
+ version: 0.0.7
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-10-06 00:00:00.000000000Z
12
+ date: 2011-10-27 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
16
- requirement: &70345538601000 !ruby/object:Gem::Requirement
16
+ requirement: &70290395384320 !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: *70345538601000
24
+ version_requirements: *70290395384320
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: plist
27
- requirement: &70345538600580 !ruby/object:Gem::Requirement
27
+ requirement: &70290395383900 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70345538600580
35
+ version_requirements: *70290395383900
36
36
  description: Provides a ruby based object-model for parsing project structures and
37
37
  invoking builds
38
38
  email:
@@ -42,12 +42,14 @@ extensions: []
42
42
  extra_rdoc_files: []
43
43
  files:
44
44
  - .gitignore
45
+ - .rvmrc
45
46
  - Gemfile
46
47
  - README.md
47
48
  - Rakefile
48
49
  - lib/xcode/configuration.rb
49
50
  - lib/xcode/info_plist.rb
50
51
  - lib/xcode/project.rb
52
+ - lib/xcode/shell.rb
51
53
  - lib/xcode/target.rb
52
54
  - lib/xcode/version.rb
53
55
  - lib/xcoder.rb