xcake 0.6.10 → 0.6.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/xcake/configurable.rb +55 -41
- data/lib/xcake/configuration.rb +5 -1
- data/lib/xcake/project.rb +1 -12
- data/lib/xcake/target.rb +13 -2
- data/lib/xcake/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19ac7ea3c7fb86b05306b60abda662b9588702db
|
4
|
+
data.tar.gz: 1b1325aaa8b44c9d92ade0c41b278cdcd30df48f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7ff9602e680fe413c9b35361cddda11c41d2953ddade67911a13d3a27bdd5b9f223a12fe189899dfc67aedccbc0a793b3c2caac5440ef9c447fdac24ceb48c7
|
7
|
+
data.tar.gz: fceb353bfe8891232b7b98407e24300dabbba7367d859ae9d36ff4fad5c31b3bcc5a0c72406d6042ed50a52feb987765576fece432fd589b85d740a0164823a8
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/xcake/configurable.rb
CHANGED
@@ -15,97 +15,111 @@ module Xcake
|
|
15
15
|
|
16
16
|
private
|
17
17
|
|
18
|
-
attr_accessor :
|
18
|
+
attr_accessor :configurations
|
19
19
|
|
20
20
|
public
|
21
21
|
|
22
|
-
|
23
|
-
attr_accessor :release_configurations
|
24
|
-
|
25
|
-
# @return [Array<Configuration>] list of configurations
|
22
|
+
# @return [Array<Configuration>] list of all configurations
|
26
23
|
#
|
27
24
|
def all_configurations
|
28
|
-
configurations
|
25
|
+
if @configurations.nil?
|
26
|
+
@configurations = []
|
29
27
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
configurations.concat(debug_configurations)
|
28
|
+
parent_configurable.all_configurations.each do |c|
|
29
|
+
configuration(c.name, c.type)
|
30
|
+
end if parent_configurable
|
34
31
|
end
|
35
32
|
|
36
|
-
|
37
|
-
configurations << release_configuration("Release")
|
38
|
-
else
|
39
|
-
configurations.concat(release_configurations)
|
40
|
-
end
|
41
|
-
|
42
|
-
configurations
|
33
|
+
@configurations
|
43
34
|
end
|
44
35
|
|
45
|
-
# @
|
36
|
+
# @param [Array<Configuration>] new list of configurations to set
|
46
37
|
#
|
47
|
-
def
|
48
|
-
@
|
38
|
+
def all_configurations=(configurations)
|
39
|
+
@configurations = configurations
|
49
40
|
end
|
50
41
|
|
51
|
-
# @return [Array<Configuration>] list of
|
42
|
+
# @return [Array<Configuration>] list of configurations of a type
|
52
43
|
#
|
53
|
-
def
|
54
|
-
|
44
|
+
def configurations_of_type(type)
|
45
|
+
all_configurations.select do |c|
|
46
|
+
c.type == type
|
47
|
+
end
|
55
48
|
end
|
56
49
|
|
57
50
|
# This either finds a release configuration
|
58
51
|
# with the same name or creates one.
|
59
52
|
#
|
53
|
+
# @deprecated Please use `configuration <name>, :debug` this
|
54
|
+
# woll be removed in 0.7.0
|
55
|
+
#
|
60
56
|
# @return [Configuration] the new or existing debug configuration
|
61
57
|
#
|
62
58
|
def debug_configuration(name = nil, &block)
|
63
|
-
|
59
|
+
configuration(name, :debug, &block)
|
64
60
|
end
|
65
61
|
|
66
62
|
# This either finds a release configuration
|
67
63
|
# with the same name or creates one.
|
68
64
|
#
|
65
|
+
# @deprecated Please use `configuration <name>, :release` this
|
66
|
+
# woll be removed in 0.7.0
|
67
|
+
#
|
69
68
|
# @return [Configuration] the new or existing release configuration
|
70
69
|
#
|
71
70
|
def release_configuration(name = nil, &block)
|
72
|
-
|
71
|
+
configuration(name, :release, &block)
|
73
72
|
end
|
74
73
|
|
75
|
-
|
74
|
+
# This either finds a configuration
|
75
|
+
# with the same name and type or creates one.
|
76
|
+
#
|
77
|
+
# @return [Configuration] the new or existing configuration
|
78
|
+
#
|
79
|
+
def configuration(name, type, &block)
|
76
80
|
|
77
|
-
|
78
|
-
|
79
|
-
when :debug
|
80
|
-
configuration_name = debug_configurations
|
81
|
-
default_settings = default_debug_settings
|
82
|
-
when :release
|
83
|
-
configuration_name = release_configurations
|
84
|
-
default_settings = default_release_settings
|
85
|
-
end
|
81
|
+
default_settings = default_settings_for_type(type)
|
82
|
+
configurations = configurations_of_type(type)
|
86
83
|
|
87
84
|
if name.nil?
|
88
|
-
build_configuration =
|
85
|
+
build_configuration = configurations.first
|
89
86
|
else
|
90
|
-
build_configuration =
|
87
|
+
build_configuration = configurations.detect do |c|
|
91
88
|
c.name == name.to_s
|
92
89
|
end
|
93
90
|
end
|
94
91
|
|
95
92
|
if build_configuration.nil?
|
96
|
-
|
97
|
-
|
98
|
-
end
|
93
|
+
|
94
|
+
name = type.to_s.capitalize if name.nil?
|
99
95
|
|
100
96
|
build_configuration = Configuration.new(name) do |b|
|
97
|
+
|
98
|
+
b.type = type
|
101
99
|
b.settings.merge!(default_settings)
|
100
|
+
|
102
101
|
block.call(b) if block_given?
|
103
102
|
end
|
104
103
|
|
105
|
-
|
104
|
+
all_configurations << build_configuration
|
106
105
|
end
|
107
106
|
|
108
107
|
build_configuration
|
109
108
|
end
|
109
|
+
|
110
|
+
private
|
111
|
+
|
112
|
+
def parent_configurable
|
113
|
+
nil
|
114
|
+
end
|
115
|
+
|
116
|
+
def default_settings_for_type(type)
|
117
|
+
case type
|
118
|
+
when :debug
|
119
|
+
default_debug_settings
|
120
|
+
when :release
|
121
|
+
default_release_settings
|
122
|
+
end
|
123
|
+
end
|
110
124
|
end
|
111
125
|
end
|
data/lib/xcake/configuration.rb
CHANGED
@@ -14,10 +14,14 @@ module Xcake
|
|
14
14
|
|
15
15
|
include Visitable
|
16
16
|
|
17
|
-
# @return [String
|
17
|
+
# @return [String] the name of the configuration
|
18
18
|
#
|
19
19
|
attr_accessor :name
|
20
20
|
|
21
|
+
# @return [Symbol] the type of the configuration, either :debug or :release
|
22
|
+
#
|
23
|
+
attr_accessor :type
|
24
|
+
|
21
25
|
# the settings for the configuration
|
22
26
|
# this is what is used for the build settings
|
23
27
|
# for the build configuration.
|
data/lib/xcake/project.rb
CHANGED
@@ -66,18 +66,7 @@ module Xcake
|
|
66
66
|
# the newly created target
|
67
67
|
#
|
68
68
|
def target(&block)
|
69
|
-
target = Target.new
|
70
|
-
|
71
|
-
# Make sure the target inherits the configurations from the project.
|
72
|
-
debug_configurations.each do |c|
|
73
|
-
target.debug_configuration c.name
|
74
|
-
end
|
75
|
-
|
76
|
-
release_configurations.each do |c|
|
77
|
-
target.release_configuration c.name
|
78
|
-
end
|
79
|
-
|
80
|
-
block.call(target) if block_given?
|
69
|
+
target = Target.new(project, &block)
|
81
70
|
|
82
71
|
self.targets << target
|
83
72
|
target
|
data/lib/xcake/target.rb
CHANGED
@@ -7,6 +7,10 @@ module Xcake
|
|
7
7
|
include Configurable
|
8
8
|
include Visitable
|
9
9
|
|
10
|
+
# @return [Project] the project for the target.
|
11
|
+
#
|
12
|
+
attr_accessor :project
|
13
|
+
|
10
14
|
# @return [String] the name of the target.
|
11
15
|
#
|
12
16
|
attr_accessor :name
|
@@ -171,8 +175,11 @@ module Xcake
|
|
171
175
|
# t.name "test"
|
172
176
|
# end
|
173
177
|
#
|
174
|
-
def initialize(&block)
|
175
|
-
|
178
|
+
def initialize(project, &block)
|
179
|
+
|
180
|
+
@project = project
|
181
|
+
@build_phases = []
|
182
|
+
|
176
183
|
block.call(self) if block_given?
|
177
184
|
end
|
178
185
|
|
@@ -221,6 +228,10 @@ module Xcake
|
|
221
228
|
|
222
229
|
#Configurable
|
223
230
|
|
231
|
+
def parent_configurable
|
232
|
+
@project
|
233
|
+
end
|
234
|
+
|
224
235
|
def default_settings
|
225
236
|
{
|
226
237
|
"INFOPLIST_FILE" => "#{name}/Supporting Files/Info.plist"
|
data/lib/xcake/version.rb
CHANGED