xcake 0.6.20 → 0.6.21
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 +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +3 -1
- data/bin/xcake +2 -0
- data/lib/xcake/command/init.rb +1 -1
- data/lib/xcake/command/make.rb +1 -1
- data/lib/xcake/context/xcodeproj_context.rb +1 -6
- data/lib/xcake/event_hooks.rb +90 -0
- data/lib/xcake/generator/configuration_generator.rb +7 -4
- data/lib/xcake/generator/project_generator.rb +2 -1
- data/lib/xcake/generator/project_metadata_generator.rb +1 -1
- data/lib/xcake/generator/project_structure_generator.rb +2 -3
- data/lib/xcake/generator/scheme_generator.rb +1 -1
- data/lib/xcake/generator/target_build_phase_generator.rb +4 -4
- data/lib/xcake/generator/target_custom_build_phase_generator.rb +1 -1
- data/lib/xcake/generator/target_file_reference_generator.rb +2 -1
- data/lib/xcake/generator/target_framework_generator.rb +6 -4
- data/lib/xcake/generator/target_generator.rb +1 -1
- data/lib/xcake/generator/target_library_generator.rb +6 -4
- data/lib/xcake/informative.rb +1 -5
- data/lib/xcake/project/hooks.rb +0 -1
- data/lib/xcake/ui.rb +85 -0
- data/lib/xcake/version.rb +1 -1
- data/lib/xcake/xcode/project.rb +0 -2
- data/lib/xcake/xcode/scheme_list.rb +2 -3
- data/lib/xcake.rb +1 -0
- data/xcake.gemspec +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8dbc4303d0d40a50b5fb64dde657f5118705013c
|
4
|
+
data.tar.gz: 999ec99117f340038bb5ace7aecaa7d1747492ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54d2a101fde7dc2cbc54e2ee01ddad4b814cb5e7b28296890e7494f9e46599026cfa7c6948e564851d4bace8fb3799737e9cf7538e06e4b774f1f2d215f9f13e
|
7
|
+
data.tar.gz: 5ef0d8678dfd585751dc08eef341a853673c1a419707f2acce616033563c19888f8bd0cf31cb7318cd035e42169acf6dea31007d5f368499c9dc1e273a14732d
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -3,7 +3,7 @@ PATH
|
|
3
3
|
specs:
|
4
4
|
xcake (0.6.20)
|
5
5
|
claide (>= 0.9.1, < 2.0)
|
6
|
-
|
6
|
+
cork
|
7
7
|
hooks (~> 0.4.1)
|
8
8
|
xcodeproj (>= 0.20, < 2.0.0)
|
9
9
|
|
@@ -20,6 +20,8 @@ GEM
|
|
20
20
|
claide (1.0.0)
|
21
21
|
coderay (1.1.1)
|
22
22
|
colored (1.2)
|
23
|
+
cork (0.1.0)
|
24
|
+
colored (~> 1.2)
|
23
25
|
coveralls (0.8.13)
|
24
26
|
json (~> 1.8)
|
25
27
|
simplecov (~> 0.11.0)
|
data/bin/xcake
CHANGED
data/lib/xcake/command/init.rb
CHANGED
data/lib/xcake/command/make.rb
CHANGED
@@ -17,13 +17,11 @@ module Xcake
|
|
17
17
|
when Node
|
18
18
|
create_object_for_node(dsl_object)
|
19
19
|
else
|
20
|
-
|
20
|
+
nil
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
24
|
def create_object_for_project(project)
|
25
|
-
puts 'Creating Project...'
|
26
|
-
|
27
25
|
# TODO: Make setup of project testable
|
28
26
|
@project = Xcode::Project.new("./#{project.name}.xcodeproj", true)
|
29
27
|
@project.setup_for_xcake
|
@@ -31,17 +29,14 @@ module Xcake
|
|
31
29
|
end
|
32
30
|
|
33
31
|
def create_object_for_target(target)
|
34
|
-
puts 'Creating Target...'
|
35
32
|
@project.new_target(target)
|
36
33
|
end
|
37
34
|
|
38
35
|
def create_object_for_configuration(configuration)
|
39
|
-
puts 'Creating Configuration...'
|
40
36
|
@project.new_configuration(configuration)
|
41
37
|
end
|
42
38
|
|
43
39
|
def create_object_for_node(node)
|
44
|
-
puts 'Creating Group...'
|
45
40
|
@project.new_group(node)
|
46
41
|
end
|
47
42
|
|
@@ -0,0 +1,90 @@
|
|
1
|
+
require 'hooks'
|
2
|
+
|
3
|
+
module Xcake
|
4
|
+
class EventHooks
|
5
|
+
include Hooks
|
6
|
+
|
7
|
+
# Defines hook which is ran after a Cakefile is initilized.
|
8
|
+
#
|
9
|
+
define_hooks :after_cakefile_init
|
10
|
+
|
11
|
+
# Defines hook which is ran before we start reading the cakefile
|
12
|
+
#
|
13
|
+
define_hooks :before_cakefile_read
|
14
|
+
|
15
|
+
# Defines hook which is ran before we start creating the Xcode Project
|
16
|
+
#
|
17
|
+
define_hooks :before_creating_xcode_project
|
18
|
+
|
19
|
+
# Defines hook which is ran before we start creating a Target
|
20
|
+
#
|
21
|
+
define_hooks :before_creating_target
|
22
|
+
|
23
|
+
# Defines hook which is ran before we start resolving
|
24
|
+
# issues with the Project structure
|
25
|
+
#
|
26
|
+
define_hooks :before_resolving_project_structure
|
27
|
+
|
28
|
+
# Defines hook which is ran before we start resolving
|
29
|
+
# issues with the Target structure
|
30
|
+
#
|
31
|
+
define_hooks :before_resolving_target_structure
|
32
|
+
|
33
|
+
# Defines hook which is ran before we start creating build configurations
|
34
|
+
# for a particular Xcode Project Object
|
35
|
+
#
|
36
|
+
define_hooks :before_creating_build_configurations
|
37
|
+
|
38
|
+
# Defines hook which is ran before we start creating a
|
39
|
+
# build configurations for a particular Xcode Project Object
|
40
|
+
#
|
41
|
+
define_hooks :before_creating_build_configuration
|
42
|
+
|
43
|
+
# Defines hook which is ran before we attach a XCConfig to a
|
44
|
+
# build configuration for a particular Xcode Project Object
|
45
|
+
#
|
46
|
+
define_hooks :before_attaching_xcconfig
|
47
|
+
|
48
|
+
# Defines hook which is ran before we add a system library
|
49
|
+
# to a target
|
50
|
+
#
|
51
|
+
define_hooks :before_adding_system_library
|
52
|
+
|
53
|
+
# Defines hook which is ran before we add a system framework
|
54
|
+
# to a target
|
55
|
+
#
|
56
|
+
define_hooks :before_adding_system_framework
|
57
|
+
|
58
|
+
# Defines hook which is ran before we add build phases
|
59
|
+
# to a target
|
60
|
+
#
|
61
|
+
define_hooks :before_adding_build_phases
|
62
|
+
|
63
|
+
# Defines hook which is ran before we create the user schemes
|
64
|
+
#
|
65
|
+
define_hooks :before_adding_user_schemes
|
66
|
+
|
67
|
+
# Defines hook which is ran before we add a file to the project
|
68
|
+
#
|
69
|
+
define_hooks :before_adding_file
|
70
|
+
|
71
|
+
# Defines hook which is ran before we add a custom build phase to
|
72
|
+
# a target
|
73
|
+
#
|
74
|
+
define_hooks :before_adding_custom_build_phase
|
75
|
+
|
76
|
+
# Defines hook which is ran before we add a embed watch app build phase to
|
77
|
+
# a target
|
78
|
+
#
|
79
|
+
define_hooks :before_adding_embed_watch_app_phase
|
80
|
+
|
81
|
+
# Defines hook which is ran before we add a embed watch extension build
|
82
|
+
# phase to a target
|
83
|
+
#
|
84
|
+
define_hooks :before_adding_embed_watch_extension_phase
|
85
|
+
|
86
|
+
# Defines hook which is ran after we save the generated project file
|
87
|
+
#
|
88
|
+
define_hooks :after_project_save
|
89
|
+
end
|
90
|
+
end
|
@@ -18,17 +18,20 @@ module Xcake
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def create_build_configurations_for(configuration_object)
|
21
|
-
|
21
|
+
EventHooks.run_hook :before_creating_build_configurations, configuration_object
|
22
22
|
|
23
23
|
configuration_object.all_configurations.each do |configuration|
|
24
|
-
|
24
|
+
EventHooks.run_hook :before_creating_build_configuration, configuration, configuration_object
|
25
25
|
|
26
26
|
build_configuration = @context.native_object_for(configuration)
|
27
27
|
build_configuration.name = configuration.name
|
28
28
|
build_configuration.build_settings = configuration.settings
|
29
29
|
|
30
|
-
|
31
|
-
|
30
|
+
unless configuration.configuration_file.nil?
|
31
|
+
EventHooks.run_hook :before_attaching_xcconfig, configuration
|
32
|
+
configuration_file = configuration.configuration_file
|
33
|
+
file_reference = @context.file_reference_for_path(configuration_file)
|
34
|
+
end
|
32
35
|
|
33
36
|
build_configuration.base_configuration_reference = file_reference
|
34
37
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Xcake
|
2
2
|
class ProjectMetadataGenerator < Generator
|
3
3
|
def visit_project(project)
|
4
|
-
|
4
|
+
EventHooks.run_hook :before_creating_xcode_project
|
5
5
|
|
6
6
|
native_project = @context.native_object_for(project)
|
7
7
|
native_project.class_prefix = project.class_prefix if project.class_prefix
|
@@ -10,8 +10,7 @@ module Xcake
|
|
10
10
|
attr_accessor :project
|
11
11
|
|
12
12
|
def visit_project(project)
|
13
|
-
|
14
|
-
|
13
|
+
EventHooks.run_hook :before_resolving_project_structure, project
|
15
14
|
@project = project
|
16
15
|
end
|
17
16
|
|
@@ -19,7 +18,7 @@ module Xcake
|
|
19
18
|
end
|
20
19
|
|
21
20
|
def visit_target(target)
|
22
|
-
|
21
|
+
EventHooks.run_hook :before_resolving_target_structure, target
|
23
22
|
|
24
23
|
@project.all_configurations.each do |c|
|
25
24
|
target.configuration(c.name, c.type)
|
@@ -8,7 +8,7 @@ module Xcake
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def visit_target(target)
|
11
|
-
|
11
|
+
EventHooks.run_hook :before_adding_build_phases, target
|
12
12
|
|
13
13
|
native_target = @context.native_object_for(target)
|
14
14
|
|
@@ -25,7 +25,7 @@ module Xcake
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def create_embed_watchapp_phase(native_target, native_watchapp_target)
|
28
|
-
|
28
|
+
EventHooks.run_hook :before_adding_embed_watch_app_phase
|
29
29
|
|
30
30
|
phase = native_target.new_copy_files_build_phase('Embed Watch Content')
|
31
31
|
phase.dst_path = '$(CONTENTS_FOLDER_PATH)/Watch'
|
@@ -35,9 +35,9 @@ module Xcake
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def create_embed_watchapp_extension_phase(native_target, native_watchapp_extension_target)
|
38
|
-
|
39
|
-
product_reference = native_watchapp_extension_target.product_reference
|
38
|
+
EventHooks.run_hook :before_adding_embed_watch_extension_phase
|
40
39
|
|
40
|
+
product_reference = native_watchapp_extension_target.product_reference
|
41
41
|
phase = native_target.new_copy_files_build_phase('Embed App Extensions')
|
42
42
|
phase.symbol_dst_subfolder_spec = :plug_ins
|
43
43
|
phase.add_file_reference(product_reference, true)
|
@@ -8,7 +8,7 @@ module Xcake
|
|
8
8
|
# TODO: Refactor this system.
|
9
9
|
native_target = @context.native_object_for(target)
|
10
10
|
target.build_phases.each do |phase|
|
11
|
-
|
11
|
+
EventHooks.run_hook :before_adding_custom_build_phase, phase, target
|
12
12
|
phase.generate_native_build_phase(native_target)
|
13
13
|
end
|
14
14
|
end
|
@@ -5,12 +5,14 @@ module Xcake
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def visit_target(target)
|
8
|
-
|
8
|
+
unless target.system_frameworks.nil?
|
9
|
+
EventHooks.run_hook :before_adding_system_framework, target
|
9
10
|
|
10
|
-
|
11
|
+
native_target = @context.native_object_for(target)
|
11
12
|
|
12
|
-
|
13
|
-
|
13
|
+
system_frameworks = target.system_frameworks
|
14
|
+
native_target.add_system_frameworks(system_frameworks)
|
15
|
+
end
|
14
16
|
end
|
15
17
|
end
|
16
18
|
end
|
@@ -5,12 +5,14 @@ module Xcake
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def visit_target(target)
|
8
|
-
|
8
|
+
unless target.system_libraries.nil?
|
9
|
+
EventHooks.run_hook :before_adding_system_library, target
|
9
10
|
|
10
|
-
|
11
|
+
native_target = @context.native_object_for(target)
|
11
12
|
|
12
|
-
|
13
|
-
|
13
|
+
system_libraries = target.system_libraries
|
14
|
+
native_target.add_system_libraries(system_libraries)
|
15
|
+
end
|
14
16
|
end
|
15
17
|
end
|
16
18
|
end
|
data/lib/xcake/informative.rb
CHANGED
data/lib/xcake/project/hooks.rb
CHANGED
data/lib/xcake/ui.rb
CHANGED
@@ -1,4 +1,89 @@
|
|
1
|
+
require 'cork'
|
2
|
+
|
3
|
+
# TODO: i18n this.
|
4
|
+
# TODO: Different modes depending on --verbose, and CI
|
5
|
+
# TODO: Split output and UI code into seperate concerns.
|
1
6
|
module Xcake
|
2
7
|
class UI
|
8
|
+
def self.register_ui_hooks
|
9
|
+
|
10
|
+
board = Cork::Board.new()
|
11
|
+
|
12
|
+
EventHooks.after_cakefile_init do
|
13
|
+
board.notice 'Open Cakefile to edit and run xcake make to get your xcode project'
|
14
|
+
end
|
15
|
+
|
16
|
+
EventHooks.before_cakefile_read do
|
17
|
+
board.puts_indented '- Reading Cakefile'
|
18
|
+
end
|
19
|
+
|
20
|
+
EventHooks.before_creating_xcode_project do
|
21
|
+
board.puts_indented '- Creating Project'
|
22
|
+
end
|
23
|
+
|
24
|
+
EventHooks.before_creating_target do |target|
|
25
|
+
board.puts_indented "- Creating #{target}"
|
26
|
+
end
|
27
|
+
|
28
|
+
EventHooks.before_resolving_project_structure do
|
29
|
+
board.puts_indented "- Resolving Project"
|
30
|
+
end
|
31
|
+
|
32
|
+
EventHooks.before_resolving_target_structure do |target|
|
33
|
+
board.puts_indented "- Resolving #{target}"
|
34
|
+
end
|
35
|
+
|
36
|
+
EventHooks.before_creating_build_configurations do |configurable|
|
37
|
+
board.puts_indented "- Creating build configurations for #{configurable}"
|
38
|
+
end
|
39
|
+
|
40
|
+
EventHooks.before_creating_build_configuration do |configuration, configurable|
|
41
|
+
board.puts_indented "- Creating build configuration #{configuration.name} for #{configurable}"
|
42
|
+
end
|
43
|
+
|
44
|
+
EventHooks.before_attaching_xcconfig do |configuration|
|
45
|
+
board.puts_indented "- Attaching XCConfig #{configuration.configuration_file} to build configuration #{configuration.name}"
|
46
|
+
end
|
47
|
+
|
48
|
+
EventHooks.before_adding_system_library do |target|
|
49
|
+
board.puts_indented "- Integrating System Libraries #{target.system_libraries} for #{target}"
|
50
|
+
end
|
51
|
+
|
52
|
+
EventHooks.before_adding_system_library do |target|
|
53
|
+
board.puts_indented "- Integrating System Libraries #{target.system_libraries} for #{target}"
|
54
|
+
end
|
55
|
+
|
56
|
+
EventHooks.before_adding_system_framework do |target|
|
57
|
+
board.puts_indented "- Integrating System Frameworks #{target.system_frameworks} for #{target}"
|
58
|
+
end
|
59
|
+
|
60
|
+
EventHooks.before_adding_build_phases do |target|
|
61
|
+
board.puts_indented "- Creating build phases for #{target}"
|
62
|
+
end
|
63
|
+
|
64
|
+
EventHooks.before_adding_user_schemes do
|
65
|
+
board.puts_indented '- Creating User Schemes'
|
66
|
+
end
|
67
|
+
|
68
|
+
EventHooks.before_adding_file do |node|
|
69
|
+
board.puts "- Adding #{node.path}"
|
70
|
+
end
|
71
|
+
|
72
|
+
EventHooks.before_adding_custom_build_phase do |phase, target|
|
73
|
+
board.puts "- Adding custom phase \"#{phase.name}\" for #{target}"
|
74
|
+
end
|
75
|
+
|
76
|
+
EventHooks.before_adding_embed_watch_app_phase do
|
77
|
+
board.puts '- Generating embed watch app phase...'
|
78
|
+
end
|
79
|
+
|
80
|
+
EventHooks.before_adding_embed_watch_extension_phase do
|
81
|
+
board.puts '- Generating embed watch extension phase...'
|
82
|
+
end
|
83
|
+
|
84
|
+
EventHooks.after_project_save do
|
85
|
+
board.notice 'Done!'
|
86
|
+
end
|
87
|
+
end
|
3
88
|
end
|
4
89
|
end
|
data/lib/xcake/version.rb
CHANGED
data/lib/xcake/xcode/project.rb
CHANGED
@@ -89,6 +89,8 @@ module Xcake
|
|
89
89
|
# @param [String] writing_path
|
90
90
|
# path to write to.
|
91
91
|
#
|
92
|
+
# TODO: Move to a Generator
|
93
|
+
#
|
92
94
|
def save(writing_path)
|
93
95
|
schemes_dir = Scheme.user_data_dir(writing_path)
|
94
96
|
|
@@ -96,7 +98,6 @@ module Xcake
|
|
96
98
|
FileUtils.mkdir_p(schemes_dir)
|
97
99
|
|
98
100
|
schemes.each do |s|
|
99
|
-
puts "Saving Scheme #{s.name}..."
|
100
101
|
s.save_as(@project.path, s.name, true)
|
101
102
|
|
102
103
|
@xcschememanagement['SchemeUserState']["#{s.name}.xcscheme_^#shared#^_"] = {
|
@@ -104,8 +105,6 @@ module Xcake
|
|
104
105
|
}
|
105
106
|
end
|
106
107
|
|
107
|
-
puts 'Saving Scheme List...'
|
108
|
-
|
109
108
|
xcschememanagement_path = schemes_dir + 'xcschememanagement.plist'
|
110
109
|
write_plist(xcschememanagement_path)
|
111
110
|
end
|
data/lib/xcake.rb
CHANGED
data/xcake.gemspec
CHANGED
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.
|
4
|
+
version: 0.6.21
|
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-07-
|
11
|
+
date: 2016-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -163,7 +163,7 @@ dependencies:
|
|
163
163
|
- !ruby/object:Gem::Version
|
164
164
|
version: '0.20'
|
165
165
|
- !ruby/object:Gem::Dependency
|
166
|
-
name:
|
166
|
+
name: cork
|
167
167
|
requirement: !ruby/object:Gem::Requirement
|
168
168
|
requirements:
|
169
169
|
- - ">="
|
@@ -230,6 +230,7 @@ files:
|
|
230
230
|
- lib/xcake/core_ext/string.rb
|
231
231
|
- lib/xcake/dependency.rb
|
232
232
|
- lib/xcake/dependency_provider.rb
|
233
|
+
- lib/xcake/event_hooks.rb
|
233
234
|
- lib/xcake/file_reference_installer.rb
|
234
235
|
- lib/xcake/file_reference_installer/compile_source_file_reference_installer.rb
|
235
236
|
- lib/xcake/file_reference_installer/compile_xcdatamodeld_file_reference_installer.rb
|