xcoder 0.0.6 → 0.0.7
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/.rvmrc +4 -0
- data/lib/xcode/configuration.rb +6 -4
- data/lib/xcode/shell.rb +20 -0
- data/lib/xcode/version.rb +1 -1
- data/lib/xcoder.rb +25 -0
- metadata +8 -6
data/.rvmrc
ADDED
data/lib/xcode/configuration.rb
CHANGED
@@ -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
|
data/lib/xcode/shell.rb
ADDED
@@ -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
|
data/lib/xcode/version.rb
CHANGED
data/lib/xcoder.rb
CHANGED
@@ -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.
|
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-
|
12
|
+
date: 2011-10-27 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
16
|
-
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: *
|
24
|
+
version_requirements: *70290395384320
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: plist
|
27
|
-
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: *
|
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
|