xcake 0.6.2 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7d1395ab449d68f8c6752ab847f68c2e792c4a5f
4
- data.tar.gz: 4ddc2a92892c9b3055afe502e32a74dea9a0b091
3
+ metadata.gz: 4da03a7ad01471d0dc369726d08bdbb3b2dc57e1
4
+ data.tar.gz: 5175f24936447b166128f6668cef3536fb13d03d
5
5
  SHA512:
6
- metadata.gz: 0f78ec259d2c68355f7683dc155b8c62ec49dfd89fc25c15f4c8a92e361fe628ad53acdbe5e9be99cd6b2facbc4b477fdef32fd9237ec4e2efbcf581006c6cf6
7
- data.tar.gz: 392069628c7ebe6816cfdf4a8c67e13e584329a40392b35860782f9b8e7dbb3e324518a4cb4f9f6dec12da0677b32aa9f20ac9ebbf99302067112acafd5248e3
6
+ metadata.gz: 73e2ea35e70c958c7a8c019f7af31e80397f2893ae06aaf19bfdb412315db5cf11c03ce3854312c0f734ce40a5fc2a3413965e9659c2176fa71338ea3d3491ca
7
+ data.tar.gz: a5f97dc9a8fd031a602e1ddfb133cacf7c4656332ae4db80ece655e8c7cf02409f2d47aa7c16e510a76df50b280a5f4a4965fa8d21c6fab2d9b43c70f6483551
@@ -1,6 +1,13 @@
1
+ v0.6.3
2
+ ======
3
+ - Adds support for adding system and static libraries (Thanks to @nodepad).
4
+ - Adds support for folder references (Thanks to @nodepad).
5
+ - Adds support for XCConfig Files (Thanks to @colinta).
6
+ - Documentation updated to explain how to set up a unit test target (Thanks to @maximkhatskevich).
7
+
1
8
  v0.6.2
2
9
  ======
3
- - Fixes bug where certain file installers fail to register correctly and could cause issues with adding certain files to the xcode project.
10
+ - Fixes bug where certain file installers fail to register and could cause issues with adding certain files to the Xcode project.
4
11
 
5
12
  v0.6.1
6
13
  ======
@@ -8,22 +15,22 @@ v0.6.1
8
15
 
9
16
  v0.6.0
10
17
  ======
11
- - Correctly infers build phases for the apple watch.
18
+ - Infers build phases for the apple watch.
12
19
  - Fixes bug where configurations lacked a name when using shorthand syntax. (Thanks to @colinta).
13
20
  - Adds support for custom script build phases (Thanks to @colinta).
14
21
 
15
22
  v0.5.3
16
23
  ======
17
- - Updates `xcake bake` to more generic `xcake make` (Thanks to @roger-tan).
24
+ - Updates `xcake bake` to the more generic `xcake make` (Thanks to @roger-tan).
18
25
 
19
26
  v0.5.2
20
27
  ======
21
28
  - Updates `xcake init` for new project syntax.
22
- - Adds shorthand build configuration syntax for projects which only contain one debug or release configuration (Thanks to @colinta).
29
+ - Adds shorthand build configuration syntax for projects which contain one debug or release configuration (Thanks to @colinta).
23
30
 
24
31
  v0.5.1
25
32
  ======
26
- - Tweaks DSL so it is easier to access the project properties via the `project` method.
33
+ - Tweaks DSL so it's easier to access the project properties via the `project` method.
27
34
 
28
35
  v0.5.0
29
36
  ======
@@ -55,7 +62,7 @@ v0.4.4
55
62
 
56
63
  v0.4.3
57
64
  ======
58
- - Correctly containing `.xcdatamodeld` files to a project, rather than the
65
+ - Correctly adds containing `.xcdatamodeld` files to a project, rather than the
59
66
  internal `.xcdatamodel`.
60
67
 
61
68
  v0.4.2
@@ -86,7 +93,7 @@ v0.2.0
86
93
  - Now adds `--version` flag to command line, to allow you to find out Xcake's
87
94
  version.
88
95
  - Brings naming of default build configurations closer to Xcode's, so that it
89
- works with existing build scripts.
96
+ works with existing build scripts.
90
97
  - Adds support for Watch OS 2 Applications.
91
98
 
92
99
  v0.1.9
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- xcake (0.6.2)
4
+ xcake (0.6.4)
5
5
  claide (~> 0.9.1)
6
6
  hooks (~> 0.4.1)
7
7
  molinillo
@@ -11,7 +11,7 @@ PATH
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- activesupport (4.2.5.1)
14
+ activesupport (4.2.6)
15
15
  i18n (~> 0.7)
16
16
  json (~> 1.7, >= 1.7.7)
17
17
  minitest (~> 5.1)
@@ -20,7 +20,7 @@ GEM
20
20
  claide (0.9.1)
21
21
  coderay (1.1.1)
22
22
  colored (1.2)
23
- coveralls (0.8.11)
23
+ coveralls (0.8.13)
24
24
  json (~> 1.8)
25
25
  simplecov (~> 0.11.0)
26
26
  term-ansicolor (~> 1.3)
@@ -35,7 +35,7 @@ GEM
35
35
  json (1.8.3)
36
36
  method_source (0.8.2)
37
37
  minitest (5.8.4)
38
- molinillo (0.4.3)
38
+ molinillo (0.4.4)
39
39
  necromancer (0.3.0)
40
40
  pastel (0.5.3)
41
41
  equatable (~> 0.5.0)
@@ -49,7 +49,7 @@ GEM
49
49
  rspec-core (~> 3.4.0)
50
50
  rspec-expectations (~> 3.4.0)
51
51
  rspec-mocks (~> 3.4.0)
52
- rspec-core (3.4.3)
52
+ rspec-core (3.4.4)
53
53
  rspec-support (~> 3.4.0)
54
54
  rspec-expectations (3.4.0)
55
55
  diff-lcs (>= 1.2.0, < 2.0)
@@ -98,7 +98,26 @@ We can also specify a testing targets for other targets as well:
98
98
 
99
99
  ```ruby
100
100
  application_for :mac, 8.0 do |target|
101
- unit_tests_for target
101
+ unit_tests_for target
102
+ end
103
+ ```
104
+
105
+ The above code will create a complementary unit tests target for the `target`. The unit tests target name will be default `<target.name>Tests`, so if your `target.name` is "MyFirstApp" then your unit tests target will be named "MyFirstAppTests", and Xcake will include any files that are placed under folder with the same name/path (if it exists).
106
+
107
+ If you want to manually control configuration of unit tests targets (and/or have multiple ones), then you should do like this:
108
+
109
+ ```ruby
110
+ application_for :mac, 8.0 do |target|
111
+
112
+ unit_tests_for target do |test_target|
113
+
114
+ test_target.name = "MyAwesomeTests"
115
+ test_target.include_files = ["Tests/**/*.*"]
116
+
117
+ # configure any other target-related properties
118
+ # as you would do with normal target
119
+
120
+ end
102
121
  end
103
122
  ```
104
123
 
@@ -175,8 +194,8 @@ to the project to match the file system.
175
194
  for file patterns
176
195
 
177
196
  ```ruby
178
- target.include_files = "DifferentAppFolder/*.*"
179
- target.include_files << "OtherFolder/*.*"
197
+ target.include_files = ["FolderOne/*.*"] # array
198
+ target.include_files << "FolderTwo/**/*.*" # add an item to array
180
199
  ```
181
200
 
182
201
  #### Exclude Files
@@ -188,8 +207,8 @@ will be excluded from the project
188
207
  for file patterns
189
208
 
190
209
  ```ruby
191
- target.exclude_files = "FolderToIgnore/*.*"
192
- target.exclude_files << "OtherFolderToIgnore/*.*"
210
+ target.exclude_files = ["FolderToIgnore/*.*"] # array
211
+ target.exclude_files << "OtherFolderToIgnore/*.*" # add an item to array
193
212
  ```
194
213
 
195
214
  ## Configurations
@@ -41,6 +41,7 @@ require "xcake/generator/target_generator"
41
41
  require "xcake/generator/target_dependency_generator"
42
42
  require "xcake/generator/target_framework_generator"
43
43
  require "xcake/generator/target_build_phase_generator"
44
+ require "xcake/generator/target_library_generator"
44
45
 
45
46
  # TODO: Merge these into one target build phase generator
46
47
  require "xcake/generator/target_file_reference_generator"
@@ -52,6 +53,7 @@ require "xcake/file_reference_installer/compile_xcdatamodeld_file_reference_inst
52
53
  require "xcake/file_reference_installer/copy_resources_file_reference_installer"
53
54
  require "xcake/file_reference_installer/copy_xcassets_file_reference_installer"
54
55
  require "xcake/file_reference_installer/header_file_reference_installer"
56
+ require "xcake/file_reference_installer/link_library_file_reference_installer"
55
57
 
56
58
  module Xcake
57
59
 
@@ -26,6 +26,13 @@ module Xcake
26
26
  #
27
27
  attr_accessor :settings
28
28
 
29
+ # @return [String] the name of the xcconfig file to use for
30
+ # the build configuration.
31
+ #
32
+ # This is resolved to a PBXFileReference.
33
+ #
34
+ attr_accessor :configuration_file
35
+
29
36
  # @param [String] name
30
37
  # the name of the configuration.
31
38
  # This is used for the build configuration name.
@@ -3,6 +3,7 @@ require 'xcodeproj'
3
3
  #TODO: Figure out a more robust Dependency system
4
4
  # - Needs to handle subclass of subclass.....
5
5
  # - Needs to have better mixin hiearchy
6
+ # - Implement a pre-dependency (Something that this needs to happen in front of)
6
7
 
7
8
  module Xcake
8
9
  module Dependency
@@ -2,6 +2,7 @@ module Xcake
2
2
  # This build phase generator detects
3
3
  # files and adds them to the copy resources phase.
4
4
  #
5
+ # Note: This installer is always the last to be executed.
5
6
  class CopyResourcesFileReferenceInstaller < FileReferenceInstaller
6
7
 
7
8
  def self.dependencies
@@ -11,7 +12,11 @@ module Xcake
11
12
  end
12
13
 
13
14
  def self.can_install_node(node)
14
- !File.directory?(node.path)
15
+ extension = File.extname(node.path)
16
+ (!File.directory?(node.path) ||
17
+ (File.directory?(node.path) &&
18
+ ![".xcassets", ".xcdatamodeld", ".lproj"].include?(extension) &&
19
+ node.children.count == 0))
15
20
  end
16
21
 
17
22
  def add_file_reference_to_target(file_reference, target)
@@ -0,0 +1,15 @@
1
+ module Xcake
2
+ # This build phase generator detects library
3
+ # files and adds them to the frameworks build phase.
4
+ #
5
+ class LinkLibraryFileReferenceInstaller < FileReferenceInstaller
6
+ def self.can_install_node(node)
7
+ !File.directory?(node.path) &&
8
+ %w(.a .dylib .so).include?(File.extname(node.path))
9
+ end
10
+
11
+ def add_file_reference_to_target(file_reference, target)
12
+ target.frameworks_build_phases.add_file_reference(file_reference)
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,17 @@
1
+ module Xcake
2
+ # This build phase generator detects xcconfigs
3
+ # files, adds them to the project and tries to connect them
4
+ # to a configuration.
5
+ #
6
+ # TODO: In future we will implement a 2 phase file installer system.
7
+ class XCConfigFileReferenceInstaller < FileReferenceInstaller
8
+ def self.can_install_node(node)
9
+ !File.directory?(node.path) &&
10
+ %w(.xcconfig).include?(File.extname(node.path))
11
+ end
12
+
13
+ def add_file_reference_to_target(file_reference, target)
14
+ #target.frameworks_build_phases.add_file_reference(file_reference)
15
+ end
16
+ end
17
+ end
@@ -1,7 +1,7 @@
1
1
  require 'xcodeproj'
2
2
 
3
3
  module Xcake
4
- # This generator processes the configuraions
4
+ # This generator processes the configurations
5
5
  # and creates xcode build configurations.
6
6
  #
7
7
  class ConfigurationGenerator < Generator
@@ -30,7 +30,18 @@ module Xcake
30
30
 
31
31
  native_configuration_object = @context.native_object_for(configuration_object)
32
32
  native_configuration_object.build_configurations << build_configuration
33
+
34
+ xcconfig = install_xcconfig(configuration)
35
+ native_configuration_object.base_configuration_reference = xcconfig
33
36
  end
34
37
  end
38
+
39
+ def install_xcconfig(configuration)
40
+ # TODO: Remove need to construct a Node Object to do this.
41
+ node = Node.new
42
+ node.path = configuration.configuration_file
43
+ native_group = @context.native_object_for(node)
44
+ native_group.new_reference(node.path)
45
+ end
35
46
  end
36
47
  end
@@ -6,6 +6,7 @@ module Xcake
6
6
  end
7
7
 
8
8
  def visit_target(target)
9
+ # TODO: Refactor this system.
9
10
  native_target = @context.native_object_for(target)
10
11
  target.build_phases.each do |phase|
11
12
  puts "Adding custom phase \"#{phase.name}\" for #{target}"
@@ -0,0 +1,16 @@
1
+ module Xcake
2
+ class TargetLibraryGenerator < Generator
3
+ def self.dependencies
4
+ [TargetGenerator, ConfigurationGenerator]
5
+ end
6
+
7
+ def visit_target(target)
8
+ puts "Integrating System Libraries for #{target}..."
9
+
10
+ native_target = @context.native_object_for(target)
11
+ if target.system_libraries
12
+ native_target.add_system_libraries(target.system_libraries)
13
+ end
14
+ end
15
+ end
16
+ end
@@ -150,6 +150,14 @@ module Xcake
150
150
  #
151
151
  attr_accessor :system_frameworks
152
152
 
153
+ # @return [Array<String>] system libraries to include for the target
154
+ #
155
+ # @example
156
+ #
157
+ # spec.system_libraries = ["z", "sqlite3"]
158
+ #
159
+ attr_accessor :system_libraries
160
+
153
161
  # @return [Array<Target>] targets to use as dependencies
154
162
  #
155
163
  attr_accessor :target_dependencies
@@ -180,6 +188,10 @@ module Xcake
180
188
  @system_frameworks ||= default_system_frameworks_for self.platform
181
189
  end
182
190
 
191
+ def system_libraries
192
+ @system_libraries ||= []
193
+ end
194
+
183
195
  def target_dependencies
184
196
  @target_dependencies ||= []
185
197
  end
@@ -1,3 +1,3 @@
1
1
  module Xcake
2
- VERSION = "0.6.2".freeze
2
+ VERSION = "0.6.4".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Campbell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-22 00:00:00.000000000 Z
11
+ date: 2016-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -214,6 +214,8 @@ files:
214
214
  - lib/xcake/file_reference_installer/copy_resources_file_reference_installer.rb
215
215
  - lib/xcake/file_reference_installer/copy_xcassets_file_reference_installer.rb
216
216
  - lib/xcake/file_reference_installer/header_file_reference_installer.rb
217
+ - lib/xcake/file_reference_installer/link_library_file_reference_installer.rb
218
+ - lib/xcake/file_reference_installer/xcconfig_file_reference_installer.rb
217
219
  - lib/xcake/generator.rb
218
220
  - lib/xcake/generator/configuration_generator.rb
219
221
  - lib/xcake/generator/project_generator.rb
@@ -226,6 +228,7 @@ files:
226
228
  - lib/xcake/generator/target_file_reference_generator.rb
227
229
  - lib/xcake/generator/target_framework_generator.rb
228
230
  - lib/xcake/generator/target_generator.rb
231
+ - lib/xcake/generator/target_library_generator.rb
229
232
  - lib/xcake/informative.rb
230
233
  - lib/xcake/node.rb
231
234
  - lib/xcake/plugin.rb