xcake 0.8.13 → 0.9.4
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 +5 -5
- data/lib/xcake.rb +1 -2
- data/lib/xcake/command/make.rb +1 -3
- data/lib/xcake/constants.rb +10 -10
- data/lib/xcake/context.rb +0 -2
- data/lib/xcake/context/xcodeproj_context.rb +5 -8
- data/lib/xcake/core_ext/class.rb +14 -0
- data/lib/xcake/dependency_provider.rb +3 -3
- data/lib/xcake/dsl/build_phase/copy_files_build_phase.rb +1 -3
- data/lib/xcake/dsl/build_phase/shell_script_build_phase.rb +10 -0
- data/lib/xcake/dsl/build_rule.rb +2 -2
- data/lib/xcake/dsl/configurable.rb +10 -8
- data/lib/xcake/dsl/configuration/sugar.rb +1 -1
- data/lib/xcake/dsl/project.rb +1 -1
- data/lib/xcake/dsl/project/hooks.rb +4 -0
- data/lib/xcake/dsl/project/sugar.rb +17 -15
- data/lib/xcake/dsl/scheme.rb +2 -3
- data/lib/xcake/dsl/target.rb +13 -5
- data/lib/xcake/generator.rb +1 -0
- data/lib/xcake/generator/default_project_structure_generator.rb +5 -6
- data/lib/xcake/generator/project_generator.rb +3 -2
- data/lib/xcake/generator/scheme_generator.rb +31 -33
- data/lib/xcake/generator/target_file_reference_generator.rb +11 -10
- data/lib/xcake/generator/target_framework_generator.rb +6 -6
- data/lib/xcake/generator/target_library_generator.rb +5 -6
- data/lib/xcake/path_classifier.rb +23 -19
- data/lib/xcake/ui.rb +1 -1
- data/lib/xcake/version.rb +1 -1
- data/lib/xcake/xcode/project.rb +3 -2
- data/lib/xcake/xcode/scheme_list.rb +0 -2
- data/lib/xcake/xcodeproj_ext/PBXGroup.rb +12 -10
- data/lib/xcake/xcodeproj_ext/PBXNativeTarget.rb +2 -2
- metadata +135 -91
- data/.gitattributes +0 -1
- data/.gitignore +0 -39
- data/.rspec +0 -2
- data/.travis.yml +0 -16
- data/.yardopts +0 -7
- data/CHANGELOG.md +0 -329
- data/CODE_OF_CONDUCT.md +0 -13
- data/Gemfile +0 -4
- data/LICENSE.txt +0 -21
- data/README.md +0 -110
- data/Rakefile +0 -6
- data/bin/console +0 -10
- data/bin/setup +0 -7
- data/fastlane-plugin-xcake/Gemfile +0 -3
- data/fastlane-plugin-xcake/LICENSE +0 -21
- data/fastlane-plugin-xcake/README.md +0 -31
- data/fastlane-plugin-xcake/Rakefile +0 -6
- data/fastlane-plugin-xcake/fastlane-plugin-xcake.gemspec +0 -25
- data/fastlane-plugin-xcake/lib/fastlane/plugin/xcake.rb +0 -16
- data/fastlane-plugin-xcake/lib/fastlane/plugin/xcake/actions/xcake_action.rb +0 -34
- data/fastlane-plugin-xcake/lib/fastlane/plugin/xcake/version.rb +0 -5
- data/fastlane-plugin-xcake/spec/spec_helper.rb +0 -8
- data/hound.yml +0 -2
- data/lib/xcake/core_ext/array.rb +0 -5
- data/lib/xcake/core_ext/object.rb +0 -7
- data/rubocop.yml +0 -173
- data/rubocop_general.yml +0 -113
- data/xcake.gemspec +0 -40
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 798f479f92ab560e1c5cca364dad5368a8ccb082ba53a534133822d6fe68c3fe
|
4
|
+
data.tar.gz: 5a5d2e73f2856bab26dfb2a1acb5fa77054a1b3b48d47073a847f400a121354e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 629a256181ebfcc5a51735f1d273430aaae9c0b6b17795c7742914e9852f23bdbe12ab360b38d6110e02666c5ad34d2c99346c519367690c17b409ebeb08c5b4
|
7
|
+
data.tar.gz: 14bc5caa9620adc2aa740d00ac9723c614b6015b7ef41cebe79dc8ece7c781310830ddb407b55b3c4194c71637daf620522c3e605140275aab125cc7c7030c9a
|
data/lib/xcake.rb
CHANGED
data/lib/xcake/command/make.rb
CHANGED
@@ -7,9 +7,7 @@ module Xcake
|
|
7
7
|
def run
|
8
8
|
file_path = "#{Dir.pwd}/Cakefile"
|
9
9
|
|
10
|
-
unless File.exist?(file_path)
|
11
|
-
raise Xcake::Informative, "Couldn't find Cakefile"
|
12
|
-
end
|
10
|
+
raise Xcake::Informative, "Couldn't find Cakefile" unless File.exist?(file_path)
|
13
11
|
|
14
12
|
EventHooks.run_hook :before_cakefile_read
|
15
13
|
file_contents = File.read(file_path)
|
data/lib/xcake/constants.rb
CHANGED
@@ -11,10 +11,10 @@ module Xcake
|
|
11
11
|
]
|
12
12
|
}.freeze,
|
13
13
|
[:ios, :ui_test_bundle] => {
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
'LD_RUNPATH_SEARCH_PATHS' => [
|
15
|
+
'$(inherited)',
|
16
|
+
'@executable_path/Frameworks',
|
17
|
+
'@loader_path/Frameworks'
|
18
18
|
]
|
19
19
|
}.freeze,
|
20
20
|
[:osx, :unit_test_bundle] => {
|
@@ -25,10 +25,10 @@ module Xcake
|
|
25
25
|
]
|
26
26
|
}.freeze,
|
27
27
|
[:osx, :ui_test_bundle] => {
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
'LD_RUNPATH_SEARCH_PATHS' => [
|
29
|
+
'$(inherited)',
|
30
|
+
'@executable_path/../Frameworks',
|
31
|
+
'@loader_path/../Frameworks'
|
32
32
|
]
|
33
33
|
}.freeze
|
34
34
|
).freeze
|
@@ -60,8 +60,8 @@ module Xcake
|
|
60
60
|
#
|
61
61
|
# @return [Hash] The common build settings
|
62
62
|
#
|
63
|
-
def self.common_build_settings(type, platform = nil, deployment_target = nil, target_product_type = nil, language = :objc)
|
64
|
-
target_product_type = (PRODUCT_TYPE_UTI.find { |_, v| v == target_product_type } || [target_product_type || :application])[0]
|
63
|
+
def self.common_build_settings(type, platform = nil, deployment_target = nil, target_product_type = nil, language = :objc) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/LineLength
|
64
|
+
target_product_type = (PRODUCT_TYPE_UTI.find { |_, v| v == target_product_type } || [target_product_type || :application])[0] # rubocop:disable Metrics/LineLength
|
65
65
|
common_settings = COMMON_BUILD_SETTINGS
|
66
66
|
|
67
67
|
# Use intersecting settings for all key sets as base
|
data/lib/xcake/context.rb
CHANGED
@@ -7,7 +7,7 @@ module Xcake
|
|
7
7
|
|
8
8
|
attr_accessor :project
|
9
9
|
|
10
|
-
def create_object_for(dsl_object)
|
10
|
+
def create_object_for(dsl_object) # rubocop:disable Metrics/CyclomaticComplexity
|
11
11
|
case dsl_object
|
12
12
|
when BuildPhase
|
13
13
|
create_object_for_build_phase(dsl_object)
|
@@ -28,17 +28,14 @@ module Xcake
|
|
28
28
|
@project.new(build_phase.build_phase_type)
|
29
29
|
end
|
30
30
|
|
31
|
-
def create_object_for_build_rule(
|
31
|
+
def create_object_for_build_rule(_build_rule)
|
32
32
|
@project.new(Xcodeproj::Project::Object::PBXBuildRule)
|
33
33
|
end
|
34
34
|
|
35
35
|
def create_object_for_project(project)
|
36
|
-
|
37
36
|
project_path = "./#{project.name}.xcodeproj"
|
38
|
-
|
39
|
-
if File.exist?(project_path)
|
40
|
-
FileUtils.remove_dir(project_path)
|
41
|
-
end
|
37
|
+
|
38
|
+
FileUtils.remove_dir(project_path) if File.exist?(project_path)
|
42
39
|
|
43
40
|
@project = Xcode::Project.new(project_path, true)
|
44
41
|
@project.setup_for_xcake
|
@@ -53,7 +50,7 @@ module Xcake
|
|
53
50
|
@project.new_configuration(configuration)
|
54
51
|
end
|
55
52
|
|
56
|
-
def create_object_for_scheme(
|
53
|
+
def create_object_for_scheme(_scheme)
|
57
54
|
Xcode::Scheme.new
|
58
55
|
end
|
59
56
|
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Xcake
|
2
|
+
module CoreExtensions
|
3
|
+
# @example Including in a class
|
4
|
+
# Class.send(:include, Xcake::CoreExtensions::ClassDescendants) # done with send because of old ruby versions
|
5
|
+
#
|
6
|
+
module ClassDescendants
|
7
|
+
# Returns all descendants of a class
|
8
|
+
#
|
9
|
+
def descendants
|
10
|
+
ObjectSpace.each_object(singleton_class).select { |klass| klass < self }
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -7,9 +7,9 @@ module Xcake
|
|
7
7
|
def initialize(dependency_class)
|
8
8
|
plugins = dependency_class.load_plugins
|
9
9
|
|
10
|
-
@dependency_graph = plugins.
|
11
|
-
[p
|
12
|
-
end
|
10
|
+
@dependency_graph = plugins.each_with_object({}) do |p, hash|
|
11
|
+
hash[p] = p.dependencies
|
12
|
+
end
|
13
13
|
end
|
14
14
|
|
15
15
|
def tsort_each_node(&block)
|
@@ -29,9 +29,7 @@ module Xcake
|
|
29
29
|
@files.each do |file|
|
30
30
|
file_reference = context.file_reference_for_path(file)
|
31
31
|
build_file = native_build_phase.add_file_reference(file_reference)
|
32
|
-
if code_sign
|
33
|
-
build_file.settings = { 'ATTRIBUTES' => ['CodeSignOnCopy'] }
|
34
|
-
end
|
32
|
+
build_file.settings = { 'ATTRIBUTES' => ['CodeSignOnCopy'] } if code_sign
|
35
33
|
end
|
36
34
|
end
|
37
35
|
|
@@ -8,6 +8,12 @@ module Xcake
|
|
8
8
|
# String coataining the contents of the script to run
|
9
9
|
attr_accessor :script
|
10
10
|
|
11
|
+
# input/output paths
|
12
|
+
attr_accessor :input_paths
|
13
|
+
attr_accessor :output_paths
|
14
|
+
attr_accessor :input_file_list_paths
|
15
|
+
attr_accessor :output_file_list_paths
|
16
|
+
|
11
17
|
def build_phase_type
|
12
18
|
Xcodeproj::Project::Object::PBXShellScriptBuildPhase
|
13
19
|
end
|
@@ -15,6 +21,10 @@ module Xcake
|
|
15
21
|
def configure_native_build_phase(native_build_phase, _context)
|
16
22
|
native_build_phase.name = name
|
17
23
|
native_build_phase.shell_script = script.strip_heredoc
|
24
|
+
native_build_phase.input_paths = input_paths || []
|
25
|
+
native_build_phase.output_paths = output_paths || []
|
26
|
+
native_build_phase.input_file_list_paths = input_file_list_paths || []
|
27
|
+
native_build_phase.output_file_list_paths = output_file_list_paths || []
|
18
28
|
end
|
19
29
|
|
20
30
|
def to_s
|
data/lib/xcake/dsl/build_rule.rb
CHANGED
@@ -55,10 +55,10 @@ module Xcake
|
|
55
55
|
#
|
56
56
|
def configure_native_build_rule(native_build_rule, _context)
|
57
57
|
native_build_rule.name = name
|
58
|
-
native_build_rule.compiler_spec =
|
58
|
+
native_build_rule.compiler_spec = 'com.apple.compilers.proxy.script'
|
59
59
|
native_build_rule.file_type = file_type
|
60
60
|
native_build_rule.script = script.strip_heredoc
|
61
|
-
if output_files_compiler_flags.empty?
|
61
|
+
if output_files_compiler_flags.empty?
|
62
62
|
output_files.each do |file|
|
63
63
|
native_build_rule.add_output_file(file)
|
64
64
|
end
|
@@ -39,9 +39,11 @@ module Xcake
|
|
39
39
|
private
|
40
40
|
|
41
41
|
def copy_parent_configurations
|
42
|
+
return unless parent_configurable
|
43
|
+
|
42
44
|
parent_configurable.all_configurations.each do |c|
|
43
45
|
configuration(c.name, c.type)
|
44
|
-
end
|
46
|
+
end
|
45
47
|
end
|
46
48
|
|
47
49
|
public
|
@@ -93,13 +95,13 @@ module Xcake
|
|
93
95
|
default_settings = default_settings_for_type(type)
|
94
96
|
configurations = configurations_of_type(type)
|
95
97
|
|
96
|
-
if name.nil?
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
98
|
+
build_configuration = if name.nil?
|
99
|
+
configurations.first
|
100
|
+
else
|
101
|
+
configurations.detect do |c|
|
102
|
+
c.name == name.to_s
|
103
|
+
end
|
104
|
+
end
|
103
105
|
|
104
106
|
if build_configuration.nil?
|
105
107
|
|
data/lib/xcake/dsl/project.rb
CHANGED
@@ -60,6 +60,10 @@ module Xcake
|
|
60
60
|
t.type = :ui_test_bundle
|
61
61
|
configure_test_target_for_host_target(t, host_target)
|
62
62
|
|
63
|
+
t.all_configurations.each do |c|
|
64
|
+
c.settings['TEST_TARGET_NAME'] = host_target.name
|
65
|
+
end
|
66
|
+
|
63
67
|
yield(t) if block_given?
|
64
68
|
end
|
65
69
|
end
|
@@ -89,26 +93,24 @@ module Xcake
|
|
89
93
|
private
|
90
94
|
|
91
95
|
def configure_test_target_for_host_target(test_target, host_target)
|
92
|
-
|
93
96
|
test_target.target_dependencies << host_target
|
94
97
|
test_target.platform = host_target.platform
|
95
98
|
test_target.deployment_target = host_target.deployment_target
|
96
99
|
test_target.language = host_target.language
|
97
100
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
end
|
101
|
+
return unless host_target.type == :application
|
102
|
+
|
103
|
+
test_target.all_configurations.each do |c|
|
104
|
+
# Do nothing as they break UITests
|
105
|
+
# For more details https://github.com/jcampbell05/xcake/issues/115
|
106
|
+
next if test_target.type == :ui_test_bundle
|
107
|
+
|
108
|
+
c.settings['BUNDLE_LOADER'] = '$(TEST_HOST)'
|
109
|
+
c.settings['TEST_HOST'] = if host_target.platform == :osx
|
110
|
+
"$(BUILT_PRODUCTS_DIR)/#{host_target.name}.app/Contents/MacOS/#{host_target.name}"
|
111
|
+
else
|
112
|
+
"$(BUILT_PRODUCTS_DIR)/#{host_target.name}.app/#{host_target.name}"
|
113
|
+
end
|
112
114
|
end
|
113
115
|
end
|
114
116
|
|
data/lib/xcake/dsl/scheme.rb
CHANGED
@@ -7,13 +7,13 @@ module Xcake
|
|
7
7
|
include Visitable
|
8
8
|
|
9
9
|
# The name for the scheme
|
10
|
-
#
|
10
|
+
#
|
11
11
|
attr_accessor :name
|
12
12
|
|
13
13
|
# The configuration to use when testing
|
14
14
|
#
|
15
15
|
# Defaults to "Debug"
|
16
|
-
#
|
16
|
+
#
|
17
17
|
attr_accessor :test_configuration
|
18
18
|
|
19
19
|
# The configuration to use when launching
|
@@ -41,7 +41,6 @@ module Xcake
|
|
41
41
|
attr_accessor :archive_configuration
|
42
42
|
|
43
43
|
def initialize(name)
|
44
|
-
|
45
44
|
@name = name
|
46
45
|
@test_configuration = 'Debug'
|
47
46
|
@launch_configuration = 'Debug'
|
data/lib/xcake/dsl/target.rb
CHANGED
@@ -136,7 +136,7 @@ module Xcake
|
|
136
136
|
#
|
137
137
|
# spec.include_files = "Classes/**/*.{h,m}"
|
138
138
|
#
|
139
|
-
|
139
|
+
attr_writer :include_files
|
140
140
|
|
141
141
|
# @return [Array or String] files to exclude for the target.
|
142
142
|
# Supports regular expressions
|
@@ -158,7 +158,7 @@ module Xcake
|
|
158
158
|
#
|
159
159
|
# spec.system_frameworks = ["Foundation"]
|
160
160
|
#
|
161
|
-
|
161
|
+
attr_writer :system_frameworks
|
162
162
|
|
163
163
|
# @return [Array<String>] system libraries to include for the target
|
164
164
|
#
|
@@ -182,16 +182,19 @@ module Xcake
|
|
182
182
|
#
|
183
183
|
attr_accessor :schemes
|
184
184
|
|
185
|
+
# @param [Project] project
|
186
|
+
# the project the target belongs to.
|
187
|
+
#
|
185
188
|
# @param [Proc] block
|
186
189
|
# an optional block that configures the target through the DSL.
|
187
190
|
#
|
188
191
|
# @example Creating a Target.
|
189
192
|
#
|
190
|
-
# Target.new do |t|
|
193
|
+
# Target.new(project) do |t|
|
191
194
|
# t.name "test"
|
192
195
|
# end
|
193
196
|
#
|
194
|
-
def initialize
|
197
|
+
def initialize(project)
|
195
198
|
@pinned_build_phases = []
|
196
199
|
@build_phases = []
|
197
200
|
@build_rules = []
|
@@ -200,6 +203,7 @@ module Xcake
|
|
200
203
|
@system_libraries = []
|
201
204
|
@target_dependencies = []
|
202
205
|
@schemes = []
|
206
|
+
@project = project
|
203
207
|
|
204
208
|
yield(self) if block_given?
|
205
209
|
end
|
@@ -209,7 +213,7 @@ module Xcake
|
|
209
213
|
# Creates a new scheme for the target
|
210
214
|
#
|
211
215
|
# @param [String] name
|
212
|
-
# the name of the new scheme
|
216
|
+
# the name of the new scheme
|
213
217
|
#
|
214
218
|
# @return [Scheme] the scheme
|
215
219
|
# the newly created scheme
|
@@ -232,6 +236,10 @@ module Xcake
|
|
232
236
|
@system_frameworks ||= default_system_frameworks_for(platform)
|
233
237
|
end
|
234
238
|
|
239
|
+
def info_plist_paths
|
240
|
+
all_configurations.map { |config| config.settings['INFOPLIST_FILE'] }.uniq
|
241
|
+
end
|
242
|
+
|
235
243
|
# @!group Conversion
|
236
244
|
|
237
245
|
def to_s
|
data/lib/xcake/generator.rb
CHANGED
@@ -8,7 +8,6 @@ module Xcake
|
|
8
8
|
# and targets have all of the same configurations.
|
9
9
|
#
|
10
10
|
class DefaultProjectStructureGenerator < Generator
|
11
|
-
|
12
11
|
def self.dependencies
|
13
12
|
[ProjectMetadataGenerator, TargetGenerator]
|
14
13
|
end
|
@@ -40,11 +39,11 @@ module Xcake
|
|
40
39
|
|
41
40
|
target.all_configurations.each do |c|
|
42
41
|
target.scheme "#{target.name}-#{c.name}" do |s|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
42
|
+
s.test_configuration = c.name
|
43
|
+
s.launch_configuration = c.name
|
44
|
+
s.profile_configuration = c.name
|
45
|
+
s.analyze_configuration = c.name
|
46
|
+
s.archive_configuration = c.name
|
48
47
|
end
|
49
48
|
end
|
50
49
|
end
|
@@ -1,13 +1,14 @@
|
|
1
1
|
module Xcake
|
2
2
|
class ProjectGenerator < Generator
|
3
3
|
def self.dependencies
|
4
|
-
Generator.descendants.
|
5
|
-
g
|
4
|
+
Generator.descendants.reject do |g|
|
5
|
+
g == self
|
6
6
|
end
|
7
7
|
end
|
8
8
|
|
9
9
|
def leave_project(project)
|
10
10
|
native_project = @context.native_object_for(project)
|
11
|
+
project.run_hook :before_save, native_project
|
11
12
|
native_project.save
|
12
13
|
project.run_hook :after_save
|
13
14
|
|