xcoder 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/xcode/configuration.rb +42 -3
- data/lib/xcode/project.rb +0 -34
- data/lib/xcode/version.rb +1 -1
- metadata +6 -6
data/lib/xcode/configuration.rb
CHANGED
@@ -24,9 +24,28 @@ module Xcode
|
|
24
24
|
|
25
25
|
def build
|
26
26
|
cmd = []
|
27
|
+
cmd << "xcodebuild"
|
28
|
+
cmd << "-sdk #{@target.project.sdk}" unless @target.project.sdk.nil?
|
29
|
+
cmd << "-project \"#{@target.project.path}\""
|
27
30
|
cmd << "-target \"#{@target.name}\""
|
28
31
|
cmd << "-configuration \"#{name}\""
|
29
|
-
|
32
|
+
execute(cmd)
|
33
|
+
end
|
34
|
+
|
35
|
+
|
36
|
+
def sign(identity)
|
37
|
+
cmd = []
|
38
|
+
cmd << "codesign"
|
39
|
+
cmd << "--force"
|
40
|
+
cmd << "--sign \"#{identity}\""
|
41
|
+
cmd << "--resource-rules=\"#{app_path}/ResourceRules.plist\""
|
42
|
+
cmd << "--entitlements \"#{entitlements_path}\""
|
43
|
+
cmd << "\"#{ipa_path}\""
|
44
|
+
execute(cmd)
|
45
|
+
end
|
46
|
+
|
47
|
+
def entitlements_path
|
48
|
+
"#{File.dirname(@target.project.path)}/build/#{@target.productName}.build/#{name}-#{@target.project.sdk}/#{@target.productName}.build/#{@target.productName}.xcent"
|
30
49
|
end
|
31
50
|
|
32
51
|
def app_path
|
@@ -38,7 +57,10 @@ module Xcode
|
|
38
57
|
end
|
39
58
|
|
40
59
|
def package(options={})
|
41
|
-
cmd = []
|
60
|
+
cmd = []
|
61
|
+
cmd << "xcrun"
|
62
|
+
cmd << "-sdk #{@target.project.sdk.nil? ? "iphoneos" : @target.project.sdk}"
|
63
|
+
cmd << "PackageApplication"
|
42
64
|
cmd << "-v \"#{app_path}\""
|
43
65
|
cmd << "-o \"#{ipa_path}\""
|
44
66
|
|
@@ -50,7 +72,24 @@ module Xcode
|
|
50
72
|
cmd << "--embed \"#{options[:profile]}\""
|
51
73
|
end
|
52
74
|
|
53
|
-
|
75
|
+
execute(cmd)
|
76
|
+
end
|
77
|
+
|
78
|
+
private
|
79
|
+
|
80
|
+
def execute(bits, show_output=true)
|
81
|
+
out = []
|
82
|
+
cmd = bits.join(' ')
|
83
|
+
puts "EXECUTE: #{cmd}"
|
84
|
+
IO.popen (cmd) do |f|
|
85
|
+
f.each do |line|
|
86
|
+
puts line if show_output
|
87
|
+
out << line
|
88
|
+
end
|
89
|
+
end
|
90
|
+
#puts "RETURN: #{out.inspect}"
|
91
|
+
out
|
54
92
|
end
|
93
|
+
|
55
94
|
end
|
56
95
|
end
|
data/lib/xcode/project.rb
CHANGED
@@ -13,27 +13,6 @@ module Xcode
|
|
13
13
|
parse_pbxproj
|
14
14
|
# parse_configurations
|
15
15
|
end
|
16
|
-
|
17
|
-
def execute_package_application(options=nil)
|
18
|
-
cmd = []
|
19
|
-
cmd << "xcrun"
|
20
|
-
cmd << "-sdk #{@sdk.nil? ? "iphoneos" : @sdk}"
|
21
|
-
cmd << "PackageApplication"
|
22
|
-
cmd << options unless options.nil?
|
23
|
-
|
24
|
-
execute(cmd.join(' '), true)
|
25
|
-
end
|
26
|
-
|
27
|
-
def execute_xcodebuild(cmd_line=nil, show_output=true)
|
28
|
-
cmd = []
|
29
|
-
cmd << "xcodebuild"
|
30
|
-
cmd << "-sdk #{@sdk}" unless @sdk.nil?
|
31
|
-
cmd << "-project \"#{@path}\""
|
32
|
-
cmd << cmd_line unless cmd_line.nil?
|
33
|
-
yield cmd if block_given?
|
34
|
-
|
35
|
-
execute(cmd.join(' '), show_output)
|
36
|
-
end
|
37
16
|
|
38
17
|
def target(name)
|
39
18
|
target = @targets[name.to_s.to_sym]
|
@@ -62,19 +41,6 @@ module Xcode
|
|
62
41
|
@targets[target.name.to_sym] = target
|
63
42
|
end
|
64
43
|
end
|
65
|
-
|
66
|
-
def execute(cmd, show_output=false)
|
67
|
-
out = []
|
68
|
-
puts "EXECUTE: #{cmd}"
|
69
|
-
IO.popen (cmd) do |f|
|
70
|
-
f.each do |line|
|
71
|
-
puts line if show_output
|
72
|
-
out << line
|
73
|
-
end
|
74
|
-
end
|
75
|
-
#puts "RETURN: #{out.inspect}"
|
76
|
-
out
|
77
|
-
end
|
78
44
|
|
79
45
|
end
|
80
46
|
end
|
data/lib/xcode/version.rb
CHANGED
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.3
|
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-08-
|
12
|
+
date: 2011-08-19 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
16
|
-
requirement: &
|
16
|
+
requirement: &70121335190760 !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: *70121335190760
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: plist
|
27
|
-
requirement: &
|
27
|
+
requirement: &70121335190340 !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: *70121335190340
|
36
36
|
description: Provides a ruby based object-model for parsing project structures and
|
37
37
|
invoking builds
|
38
38
|
email:
|