xcake 0.6.10 → 0.6.11

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7c1a2d045af199b1bebd5d440f182c8b740dba1b
4
- data.tar.gz: e640ef5e9a0b208cb58c089db83dd76f50e8ef6f
3
+ metadata.gz: 19ac7ea3c7fb86b05306b60abda662b9588702db
4
+ data.tar.gz: 1b1325aaa8b44c9d92ade0c41b278cdcd30df48f
5
5
  SHA512:
6
- metadata.gz: bfc816b350549d4b5fb8ffd9ce0a59259a32e033f44a14b69f88e9fc7621f6a4286d80da0a215455fbedceec39352129ef85ef3dc32e020a37c2c83c127bf02b
7
- data.tar.gz: c139fd841aafc15963dc9f57422dcb2a36d657c7d4f2ba4c13b3935b30bda4d17a06d44b736b5ad2a22c75e45c45fd96fe99f370f2d0f766cf3ec084562849ee
6
+ metadata.gz: d7ff9602e680fe413c9b35361cddda11c41d2953ddade67911a13d3a27bdd5b9f223a12fe189899dfc67aedccbc0a793b3c2caac5440ef9c447fdac24ceb48c7
7
+ data.tar.gz: fceb353bfe8891232b7b98407e24300dabbba7367d859ae9d36ff4fad5c31b3bcc5a0c72406d6042ed50a52feb987765576fece432fd589b85d740a0164823a8
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ v0.6.11
2
+ =======
3
+ - Fixes issues with system frameworks when inherited configurations.
4
+
1
5
  v0.6.10
2
6
  =======
3
7
  - Fixes race-condition where configurations weren't setup correctly.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- xcake (0.6.10)
4
+ xcake (0.6.11)
5
5
  claide (~> 0.9.1)
6
6
  hooks (~> 0.4.1)
7
7
  molinillo
@@ -15,97 +15,111 @@ module Xcake
15
15
 
16
16
  private
17
17
 
18
- attr_accessor :all_configurations
18
+ attr_accessor :configurations
19
19
 
20
20
  public
21
21
 
22
- attr_accessor :debug_configurations
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
- if debug_configurations.empty?
31
- configurations << debug_configuration("Debug")
32
- else
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
- if release_configurations.empty?
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
- # @return [Array<Configuration>] list of debug configurations
36
+ # @param [Array<Configuration>] new list of configurations to set
46
37
  #
47
- def debug_configurations
48
- @debug_configurations ||= []
38
+ def all_configurations=(configurations)
39
+ @configurations = configurations
49
40
  end
50
41
 
51
- # @return [Array<Configuration>] list of release configurations
42
+ # @return [Array<Configuration>] list of configurations of a type
52
43
  #
53
- def release_configurations
54
- @release_configurations ||= []
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
- build_configuration(:debug, name, &block)
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
- build_configuration(:release, name, &block)
71
+ configuration(name, :release, &block)
73
72
  end
74
73
 
75
- private
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
- def build_configuration(method, name, &block)
78
- case method
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 = configuration_name.first
85
+ build_configuration = configurations.first
89
86
  else
90
- build_configuration = configuration_name.detect do |c|
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
- if name.nil?
97
- name = method.to_s[0].upcase + method.to_s[1..-1]
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
- configuration_name << build_configuration
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
@@ -14,10 +14,14 @@ module Xcake
14
14
 
15
15
  include Visitable
16
16
 
17
- # @return [String>] the name of the configuration
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
- self.build_phases = []
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
@@ -1,3 +1,3 @@
1
1
  module Xcake
2
- VERSION = "0.6.10".freeze
2
+ VERSION = "0.6.11".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.10
4
+ version: 0.6.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Campbell