phoenx 0.2.3 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f57ae4761329ab96177d22d98390f03ccf0bb6ac
4
- data.tar.gz: ee04aa336a76774a7fec2fc0bf3884e4b124e097
3
+ metadata.gz: 77be760e6ace31cc917984b3878086334c43b606
4
+ data.tar.gz: 36913b36166d02da9736e2c7b3a2a58c8c7b7a73
5
5
  SHA512:
6
- metadata.gz: fa60e2bae2751112d89bd87e7a47b12282d8e32acff93aadca0facd833cac9268ddf593c31e7609ae85a7ec1cff3be0aba1111d8792e001e178602fb98db4365
7
- data.tar.gz: c26339416e8b0717f315d2c77c07249367de3ace2757cd8587f93961e9c1558bf1b8591d303081d386d9e47f3da3a5048ed295dad5165676d824b74959916f8e
6
+ metadata.gz: 1f234bc43090dae81275b4c830d85d09bdfed54a01ffaa5ae48c5ba02865a4169013aa884a98c1c9aae7c8148dce0fd702f7d6d788e1278e0dd89061357a8790
7
+ data.tar.gz: 970ae5cab4bab7f4ee73bcaa4a33c092bbec6a86bf58eae808806d643ee17fec596da9be19038ab06f30fcb02d5c8e5c39d28bb34b76a6cfdb94b6f3ea8517bd
@@ -40,7 +40,7 @@ module Phoenx
40
40
 
41
41
  end
42
42
 
43
- puts "\r\nGenerating workspace ".green + workspace.name.bold + ".xcworkspace".bold
43
+ puts "\r\nWorkspace ".green + workspace.name.bold
44
44
 
45
45
  generator = Phoenx::GenerateWorkspace.new workspace
46
46
  generator.generate
@@ -1,5 +1,5 @@
1
1
  module Phoenx
2
2
 
3
- VERSION = "0.2.3".freeze unless defined? Phoenx::VERSION
3
+ VERSION = "0.2.4".freeze unless defined? Phoenx::VERSION
4
4
 
5
5
  end
@@ -15,6 +15,7 @@ module Phoenx
15
15
 
16
16
  @project_spec.pre_install_scripts.each do |pre_script|
17
17
 
18
+ abort "Missing pre install script ".red + pre_script.bold unless File.exists?(pre_script)
18
19
  puts `./#{pre_script}`
19
20
 
20
21
  end
@@ -33,6 +34,7 @@ module Phoenx
33
34
 
34
35
  @project_spec.post_install_scripts.each do |post_script|
35
36
 
37
+ abort "Missing post install script ".red + post_script.bold unless File.exists?(post_script)
36
38
  puts `./#{post_script}`
37
39
 
38
40
  end
@@ -90,10 +92,12 @@ module Phoenx
90
92
  end
91
93
 
92
94
  configuration = @project.build_configuration_list[config]
93
-
94
- unless configuration == nil
95
- configuration.base_configuration_reference = file
95
+
96
+ unless configuration
97
+ abort "Config file assigned to invalid configuration '#{config}'' ".red + file_name.bold
96
98
  end
99
+
100
+ configuration.base_configuration_reference = file
97
101
 
98
102
  end
99
103
 
@@ -98,6 +98,10 @@ module Phoenx
98
98
  # Add Resource files
99
99
  resources = Phoenx.merge_files_array(@target_spec.resources)
100
100
 
101
+ unless !@target_spec.resources || @target_spec.resources.empty? || !resources.empty?
102
+ puts "No resources found".yellow
103
+ end
104
+
101
105
  Phoenx.add_groups_for_files(@project, resources)
102
106
 
103
107
  resources.each do |source|
@@ -162,6 +166,10 @@ module Phoenx
162
166
  # Add Source files
163
167
  sources = Phoenx.merge_files_array(@target_spec.sources)
164
168
 
169
+ unless !@target_spec.sources || @target_spec.sources.empty? || !sources.empty?
170
+ puts "No sources found".yellow
171
+ end
172
+
165
173
  Phoenx.add_groups_for_files(@project, sources)
166
174
 
167
175
  sources.each do |source|
@@ -184,6 +192,10 @@ module Phoenx
184
192
 
185
193
  headers = Phoenx.merge_files_array(header_files)
186
194
 
195
+ unless !header_files || header_files.empty? || !headers.empty?
196
+ puts "No #{attributes["ATTRIBUTES"].first} headers found".yellow
197
+ end
198
+
187
199
  Phoenx.add_groups_for_files(@project, headers)
188
200
 
189
201
  headers.each do |header|
@@ -228,10 +240,12 @@ module Phoenx
228
240
  file = Phoenx.get_or_add_file(@project,file_name)
229
241
 
230
242
  configuration = self.target.build_configuration_list[config]
231
-
232
- unless configuration == nil
233
- configuration.base_configuration_reference = file
243
+
244
+ unless configuration
245
+ abort "Config file assigned to invalid configuration '#{config}' ".red + file_name.bold
234
246
  end
247
+
248
+ configuration.base_configuration_reference = file
235
249
 
236
250
  end
237
251
 
@@ -298,6 +312,8 @@ module Phoenx
298
312
  proj = @project
299
313
  else
300
314
 
315
+ abort "Missing dependency ".red + dp.path.bold unless File.exists?(dp.path)
316
+
301
317
  file_ref = frameworks_group.find_file_by_path(dp.path)
302
318
 
303
319
  unless file_ref != nil
@@ -311,6 +327,9 @@ module Phoenx
311
327
  end
312
328
 
313
329
  target = Phoenx.target_for_name(proj,dp.target_name)
330
+
331
+ abort "Missing target for dependency '#{dp.path}' ".red + dp.target_name.bold unless target
332
+
314
333
  self.target.add_dependency(target)
315
334
 
316
335
  end
@@ -327,8 +346,18 @@ module Phoenx
327
346
  scheme.add_build_target(self.target, true)
328
347
  scheme.add_test_target(@test_target)
329
348
 
330
- scheme.archive_action.build_configuration = self.target.build_configuration_list[s.archive_configuration]
331
- scheme.launch_action.build_configuration = self.target.build_configuration_list[s.launch_configuration]
349
+ archive_configuration = self.target.build_configuration_list[s.archive_configuration]
350
+ unless archive_configuration
351
+ abort "Invalid archive configuration assigned for scheme '#{s.name}' ".red + s.archive_configuration.bold
352
+ end
353
+
354
+ launch_configuration = self.target.build_configuration_list[s.launch_configuration]
355
+ unless launch_configuration
356
+ abort "Invalid launch configuration assigned for scheme '#{s.name}' ".red + s.launch_configuration.bold
357
+ end
358
+
359
+ scheme.archive_action.build_configuration = archive_configuration
360
+ scheme.launch_action.build_configuration = launch_configuration
332
361
 
333
362
  scheme.save_as(@project_spec.project_file_name, s.name, false)
334
363
 
@@ -351,6 +380,9 @@ module Phoenx
351
380
 
352
381
  def build
353
382
 
383
+
384
+ puts ">> Target ".green + @target_spec.name.bold unless @project_spec.targets.length == 1
385
+
354
386
  self.add_sources
355
387
  self.add_public_headers
356
388
  self.add_private_headers
@@ -37,14 +37,17 @@ module Phoenx
37
37
  path = '.'
38
38
 
39
39
  end
40
-
41
- previous = Dir.pwd
40
+
41
+ abort "Missing project folder ".red + path.bold unless Dir.exists?(path)
42
42
 
43
43
  Dir.chdir(path) do
44
44
 
45
- specs = Dir[name + '.' + PROJECT_EXTENSION]
45
+ file_name = name + '.' + PROJECT_EXTENSION
46
+ specs = Dir[file_name]
46
47
 
47
- puts "Processing ".green + specs.first.bold
48
+ puts "> Project ".green + name.bold
49
+
50
+ abort "Missing project specification ".red + (path + file_name).bold unless specs.first
48
51
 
49
52
  file = File.read(specs.first)
50
53
  spec = eval(file)
@@ -52,9 +55,6 @@ module Phoenx
52
55
  generator = Phoenx::GenerateProject.new spec
53
56
  generator.build
54
57
  end
55
-
56
- # Monkey patch due to bug in Xcode 8 that prevents chdir to switch back to previous dir
57
- Dir.cp_chdir previous
58
58
 
59
59
  end
60
60
 
@@ -12,8 +12,9 @@ module Phoenx
12
12
 
13
13
  files.each do |path|
14
14
 
15
+ abort "Missing file ".red + path.bold unless File.exists?(path)
16
+
15
17
  groups = File.dirname(path).split("/")
16
- groups.delete("..")
17
18
  concate = ""
18
19
 
19
20
  groups.each do |g|
@@ -48,18 +49,12 @@ module Phoenx
48
49
 
49
50
  end
50
51
 
51
- def Phoenx.get_absolute_path(path)
52
-
53
- groups = File.dirname(path).split("/")
54
- groups.delete("..")
55
- return groups.join("/")
56
-
57
- end
58
-
59
52
  def Phoenx.get_or_add_file(project,file)
60
53
 
54
+ abort "Missing file ".red + path.bold unless File.exists?(file)
55
+
61
56
  filename = File.basename(file)
62
- dir = Phoenx.get_absolute_path(file)
57
+ dir = File.dirname(file)
63
58
 
64
59
  group = project.main_group.find_subpath(dir, false)
65
60
  file_ref = group.find_file_by_path(filename)
@@ -105,6 +100,8 @@ module Phoenx
105
100
  end
106
101
 
107
102
  end
103
+
104
+ return nil
108
105
 
109
106
  end
110
107
 
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phoenx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Meder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-14 00:00:00.000000000 Z
11
+ date: 2017-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xcodeproj
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: 1.3.2
19
+ version: 1.4.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: 1.3.2
26
+ version: 1.4.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: colored
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.2'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.11'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.11'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: '3.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.0'
69
69
  description: An Xcode Project and Workspace Generator
@@ -74,8 +74,6 @@ executables:
74
74
  extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
- - bin/phoenx
78
- - lib/phoenx.rb
79
77
  - lib/phoenx/cli/cli_factory.rb
80
78
  - lib/phoenx/cli/command.rb
81
79
  - lib/phoenx/cli/option.rb
@@ -96,6 +94,8 @@ files:
96
94
  - lib/phoenx/validators/configuration_validator.rb
97
95
  - lib/phoenx/validators/project_validator.rb
98
96
  - lib/phoenx/validators/workspace_validator.rb
97
+ - lib/phoenx.rb
98
+ - bin/phoenx
99
99
  homepage: https://www.github.com/jensmeder/Phoenx
100
100
  licenses:
101
101
  - MIT
@@ -106,17 +106,17 @@ require_paths:
106
106
  - lib
107
107
  required_ruby_version: !ruby/object:Gem::Requirement
108
108
  requirements:
109
- - - ">="
109
+ - - '>='
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  requirements:
114
- - - ">="
114
+ - - '>='
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
117
  requirements: []
118
118
  rubyforge_project:
119
- rubygems_version: 2.5.0
119
+ rubygems_version: 2.0.14.1
120
120
  signing_key:
121
121
  specification_version: 4
122
122
  summary: Phoenx generates Xcode projects (*.xcodeproj) and workspaces (*.xcworkspace)