ceedling 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. data/Rakefile +55 -6
  2. data/examples/temp_sensor/project.yml +2 -2
  3. data/lib/ceedling/version.rb +3 -3
  4. data/lib/ceedling/version.rb.erb +1 -1
  5. data/new_project_template/project.yml +1 -1
  6. data/new_project_template/vendor/ceedling/{vendor/c_exception/docs → docs}/CExceptionSummary.pdf +0 -0
  7. data/new_project_template/vendor/ceedling/vendor/cmock/docs/CMock Summary.pdf b/data/new_project_template/vendor/ceedling/docs/CMock → Summary.pdf +0 -0
  8. data/new_project_template/vendor/ceedling/vendor/c_exception/vendor/unity/docs/Unity Summary.pdf b/data/new_project_template/vendor/ceedling/docs/Unity → Summary.pdf +0 -0
  9. data/new_project_template/vendor/ceedling/lib/configurator.rb +65 -16
  10. data/new_project_template/vendor/ceedling/lib/configurator_builder.rb +1 -8
  11. data/new_project_template/vendor/ceedling/lib/configurator_plugins.rb +8 -1
  12. data/new_project_template/vendor/ceedling/lib/configurator_setup.rb +30 -34
  13. data/new_project_template/vendor/ceedling/lib/configurator_validator.rb +32 -5
  14. data/new_project_template/vendor/ceedling/lib/constants.rb +17 -4
  15. data/new_project_template/vendor/ceedling/lib/defaults.rb +120 -106
  16. data/new_project_template/vendor/ceedling/lib/file_path_utils.rb +1 -1
  17. data/new_project_template/vendor/ceedling/lib/generator.rb +14 -6
  18. data/new_project_template/vendor/ceedling/lib/objects.yml +5 -0
  19. data/new_project_template/vendor/ceedling/lib/plugin.rb +2 -1
  20. data/new_project_template/vendor/ceedling/lib/plugin_manager.rb +6 -1
  21. data/new_project_template/vendor/ceedling/lib/preprocessinator_file_handler.rb +2 -2
  22. data/new_project_template/vendor/ceedling/lib/preprocessinator_includes_handler.rb +2 -2
  23. data/new_project_template/vendor/ceedling/lib/rules_cmock.rake +1 -1
  24. data/new_project_template/vendor/ceedling/lib/rules_preprocess.rake +2 -2
  25. data/new_project_template/vendor/ceedling/lib/rules_release.rake +4 -4
  26. data/new_project_template/vendor/ceedling/lib/rules_release_aux_dependencies.rake +1 -1
  27. data/new_project_template/vendor/ceedling/lib/rules_tests.rake +5 -5
  28. data/new_project_template/vendor/ceedling/lib/rules_tests_aux_dependencies.rake +1 -1
  29. data/new_project_template/vendor/ceedling/lib/setupinator.rb +10 -3
  30. data/new_project_template/vendor/ceedling/lib/system_utils.rb +32 -0
  31. data/new_project_template/vendor/ceedling/lib/system_wrapper.rb +13 -5
  32. data/new_project_template/vendor/ceedling/lib/tasks_base.rake +2 -2
  33. data/new_project_template/vendor/ceedling/lib/tasks_release.rake +1 -1
  34. data/new_project_template/vendor/ceedling/lib/tasks_tests.rake +1 -1
  35. data/new_project_template/vendor/ceedling/lib/tool_executor.rb +38 -10
  36. data/new_project_template/vendor/ceedling/lib/tool_executor_helper.rb +68 -10
  37. data/new_project_template/vendor/ceedling/plugins/bullseye/bullseye.rake +142 -0
  38. data/new_project_template/vendor/ceedling/plugins/bullseye/bullseye.rb +145 -0
  39. data/new_project_template/vendor/ceedling/plugins/bullseye/defaults.yml +49 -0
  40. data/new_project_template/vendor/ceedling/plugins/bullseye/template.erb +15 -0
  41. data/new_project_template/vendor/ceedling/plugins/gcov/defaults.yml +34 -0
  42. data/new_project_template/vendor/ceedling/plugins/gcov/gcov.rake +136 -0
  43. data/new_project_template/vendor/ceedling/plugins/gcov/gcov.rb +115 -0
  44. data/new_project_template/vendor/ceedling/plugins/gcov/template.erb +15 -0
  45. data/new_project_template/vendor/ceedling/plugins/stdout_ide_tests_report/stdout_ide_tests_report.rb +1 -1
  46. data/new_project_template/vendor/ceedling/plugins/stdout_pretty_tests_report/stdout_pretty_tests_report.rb +3 -63
  47. data/new_project_template/vendor/ceedling/plugins/stdout_pretty_tests_report/template.erb +59 -0
  48. data/new_project_template/vendor/ceedling/plugins/warnings_report/warnings_report.rb +71 -0
  49. data/new_project_template/vendor/ceedling/release/build.info +1 -1
  50. data/new_project_template/vendor/ceedling/vendor/c_exception/release/version.info +1 -1
  51. data/new_project_template/vendor/ceedling/vendor/unity/src/unity.c +30 -21
  52. metadata +18 -27
  53. data/new_project_template/vendor/ceedling/docs/Ceedling Packet.odt +0 -0
  54. data/new_project_template/vendor/ceedling/docs/CeedlingLogo.png +0 -0
  55. data/new_project_template/vendor/ceedling/rakefile.rb +0 -59
  56. data/new_project_template/vendor/ceedling/rakefile_helper.rb +0 -23
  57. data/new_project_template/vendor/ceedling/vendor/c_exception/docs/CExceptionSummary.odt +0 -0
  58. data/new_project_template/vendor/ceedling/vendor/c_exception/docs/license.txt +0 -30
  59. data/new_project_template/vendor/ceedling/vendor/c_exception/docs/readme.txt +0 -236
  60. data/new_project_template/vendor/ceedling/vendor/c_exception/vendor/unity/docs/Unity Summary.txt +0 -217
  61. data/new_project_template/vendor/ceedling/vendor/cmock/docs/CMock Summary.odt +0 -0
  62. data/new_project_template/vendor/ceedling/vendor/cmock/docs/license.txt +0 -31
  63. data/new_project_template/vendor/ceedling/vendor/deep_merge/MIT-LICENSE +0 -20
  64. data/new_project_template/vendor/ceedling/vendor/deep_merge/README +0 -94
  65. data/new_project_template/vendor/ceedling/vendor/deep_merge/Rakefile +0 -28
  66. data/new_project_template/vendor/ceedling/vendor/deep_merge/test/test_deep_merge.rb +0 -553
  67. data/new_project_template/vendor/ceedling/vendor/diy/History.txt +0 -28
  68. data/new_project_template/vendor/ceedling/vendor/diy/README.rdoc +0 -233
  69. data/new_project_template/vendor/ceedling/vendor/unity/docs/Unity Summary.odt +0 -0
  70. data/new_project_template/vendor/ceedling/vendor/unity/docs/Unity Summary.pdf +0 -0
  71. data/new_project_template/vendor/ceedling/vendor/unity/docs/Unity Summary.txt +0 -217
  72. data/new_project_template/vendor/ceedling/vendor/unity/docs/license.txt +0 -31
data/Rakefile CHANGED
@@ -1,18 +1,67 @@
1
- require 'bundler'
1
+ require "bundler"
2
2
  Bundler::GemHelper.install_tasks
3
3
  require "./lib/ceedling"
4
+ require "fileutils"
5
+ require "erb"
4
6
 
5
- desc "update ceedling versions in gem; assumes ceedling up-to-date"
6
- task :update_versions do
7
+ desc "update all the tools from sourceforge and update version info"
8
+ task :update_tools do
9
+
10
+ puts "\nRetrieving ceedling content from SourceForge..."
11
+ rm_rf "temp"
12
+ mkdir "temp"
13
+ cd "temp" do
14
+ svn_checkout_command = 'svn co http://ceedling.svn.sourceforge.net/svnroot/ceedling/trunk .'
15
+ puts svn_checkout_command
16
+ `#{svn_checkout_command}`
17
+ rm_rf Dir["./**/.svn/"], :verbose => false # remove svn artifacts
18
+ end
19
+
20
+ # define mapping for pruning content from sourceforge
21
+ mapping = [
22
+ {:src => 'lib/', :dest => ''},
23
+ {:src => 'plugins/', :dest => ''},
24
+ {:src => 'release/', :dest => ''},
25
+ {:src => 'vendor/c_exception/lib/', :dest => 'vendor/c_exception/'},
26
+ {:src => 'vendor/c_exception/release/', :dest => 'vendor/c_exception/'},
27
+ {:src => 'vendor/cmock/config/', :dest => 'vendor/cmock/'},
28
+ {:src => 'vendor/cmock/lib/', :dest => 'vendor/cmock/'},
29
+ {:src => 'vendor/cmock/release/', :dest => 'vendor/cmock/'},
30
+ {:src => 'vendor/cmock/src/', :dest => 'vendor/cmock/'},
31
+ {:src => 'vendor/constructor/lib/', :dest => 'vendor/constructor/'},
32
+ {:src => 'vendor/deep_merge/lib/', :dest => 'vendor/deep_merge/'},
33
+ {:src => 'vendor/diy/lib', :dest => 'vendor/diy/'},
34
+ {:src => 'vendor/unity/release/', :dest => 'vendor/unity/'},
35
+ {:src => 'vendor/unity/src/', :dest => 'vendor/unity/'},
36
+ {:src => 'vendor/c_exception/docs/CExceptionSummary.pdf', :dest => 'docs/', :is_file => true},
37
+ {:src => 'vendor/cmock/docs/CMock Summary.pdf', :dest => 'docs/', :is_file => true},
38
+ {:src => 'docs/Ceedling Packet.pdf', :dest => 'docs/', :is_file => true},
39
+ {:src => 'vendor/unity/docs/Unity Summary.pdf', :dest => 'docs/', :is_file => true},
40
+ ]
41
+
42
+ puts "\nUpdating tools with the latest goods..."
43
+ rm_rf "new_project_template/vendor/**"
44
+ mapping.each do |path|
45
+ dest = "new_project_template/vendor/ceedling/#{path[:dest]}"
46
+ dir = dest.sub(/\w+$/, '')
47
+ if !File.exist?(dir)
48
+ mkdir_p dest
49
+ end
50
+ puts "temp/#{path[:src]} -> #{dest}"
51
+ FileUtils.cp_r "temp/#{path[:src]}", "#{dest}"
52
+ end
53
+ rm_rf "temp"
54
+
55
+ puts "\nUpdating version info..."
7
56
  versions = {}
8
- # There's an extra line of junk at the beginning, but who cares.
9
57
  full_version_info = nil
10
58
  Dir.chdir(Ceedling::NEW_PROJECT_DIR) { full_version_info = `rake version` }
59
+ puts full_version_info
11
60
  full_version_info.each_line do |line|
12
61
  line = line.split("::")
13
62
  versions[line.first.strip.upcase] = line.last.strip
14
63
  end
15
- require "erb"
16
64
  result = ERB.new(File.read("lib/ceedling/version.rb.erb")).result(binding)
17
65
  File.open("lib/ceedling/version.rb", "wb+") { |f| f.puts result }
18
- end
66
+
67
+ end
@@ -62,8 +62,8 @@
62
62
  - UnityHelper.h
63
63
 
64
64
  :plugins:
65
- :base_path: vendor/ceedling/plugins
66
- :auxiliary_load_path: vendor/ceedling/plugins/support
65
+ :load_paths:
66
+ - vendor/ceedling/plugins
67
67
  :enabled:
68
68
  - stdout_pretty_tests_report
69
69
  - module_generator
@@ -2,12 +2,12 @@
2
2
  module Ceedling
3
3
  module Version
4
4
  # @private
5
- GEM = "0.0.3"
5
+ GEM = "0.0.4"
6
6
 
7
7
  # @private
8
- CEEDLING = "0.9.157"
8
+ CEEDLING = "0.9.172"
9
9
  # @private
10
- CEXCEPTION = "1.2.0.16"
10
+ CEXCEPTION = "1.2.16"
11
11
  # @private
12
12
  CMOCK = "2.0.209"
13
13
  # @private
@@ -2,7 +2,7 @@
2
2
  module Ceedling
3
3
  module Version
4
4
  # @private
5
- GEM = "0.0.1"
5
+ GEM = "0.0.4"
6
6
 
7
7
  # @private
8
8
  CEEDLING = "<%= versions["CEEDLING"] %>"
@@ -59,7 +59,7 @@
59
59
 
60
60
  :plugins:
61
61
  :load_paths:
62
- - "#{File.join(PROJECT_CEEDLING_ROOT, 'plugins')}"
62
+ - vendor/ceedling/plugins
63
63
  :enabled:
64
64
  - stdout_pretty_tests_report
65
65
  ...
@@ -7,7 +7,7 @@ require 'deep_merge'
7
7
 
8
8
  class Configurator
9
9
 
10
- attr_reader :project_config_hash, :environment, :script_plugins, :rake_plugins
10
+ attr_reader :project_config_hash, :script_plugins, :rake_plugins
11
11
  attr_accessor :project_logging, :project_debug, :project_verbosity, :sanity_checks
12
12
 
13
13
  constructor(:configurator_setup, :configurator_builder, :configurator_plugins, :cmock_builder, :yaml_wrapper, :system_wrapper) do
@@ -17,14 +17,10 @@ class Configurator
17
17
  @sanity_checks = TestResultsSanityChecks::NORMAL
18
18
  end
19
19
 
20
-
21
20
  def setup
22
21
  # special copy of cmock config to provide to cmock for construction
23
22
  @cmock_config_hash = {}
24
23
 
25
- # capture our source config for later merge operations
26
- @source_config_hash = {}
27
-
28
24
  # note: project_config_hash is an instance variable so constants and accessors created
29
25
  # in eval() statements in build() have something of proper scope and persistence to reference
30
26
  @project_config_hash = {}
@@ -33,7 +29,7 @@ class Configurator
33
29
  @script_plugins = []
34
30
  @rake_plugins = []
35
31
  end
36
-
32
+
37
33
 
38
34
  def replace_flattened_config(config)
39
35
  @project_config_hash.merge!(config)
@@ -69,13 +65,13 @@ class Configurator
69
65
 
70
66
 
71
67
  def populate_defaults(config)
72
- new_config = DEFAULT_CEEDLING_CONFIG.clone
68
+ new_config = DEFAULT_CEEDLING_CONFIG.deep_clone
73
69
  new_config.deep_merge!(config)
74
70
  config.replace(new_config)
75
71
 
76
72
  @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_TEST )
77
73
  @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_TEST_PREPROCESSORS ) if (config[:project][:use_test_preprocessor])
78
- @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_TEST_DEPENDENCIES ) if (config[:project][:use_auxiliary_dependencies])
74
+ @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_TEST_DEPENDENCIES ) if (config[:project][:use_auxiliary_dependencies])
79
75
 
80
76
  @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_RELEASE ) if (config[:project][:release_build])
81
77
  @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_RELEASE_ASSEMBLER ) if (config[:project][:release_build] and config[:release_build][:use_assembly])
@@ -131,18 +127,39 @@ class Configurator
131
127
 
132
128
 
133
129
  # grab tool names from yaml and insert into tool structures so available for error messages
134
- def populate_tool_names_and_stderr_redirect(config)
130
+ # set up default values
131
+ def tools_setup(config)
135
132
  config[:tools].each_key do |name|
136
133
  tool = config[:tools][name]
137
-
134
+
138
135
  # populate name if not given
139
136
  tool[:name] = name.to_s if (tool[:name].nil?)
140
137
 
141
138
  # populate stderr redirect option
142
139
  tool[:stderr_redirect] = StdErrRedirect::NONE if (tool[:stderr_redirect].nil?)
140
+
141
+ # populate background execution option
142
+ tool[:background_exec] = BackgroundExec::NONE if (tool[:background_exec].nil?)
143
+
144
+ # populate optional option to control verification of executable in search paths
145
+ tool[:optional] = false if (tool[:optional].nil?)
143
146
  end
144
147
  end
145
148
 
149
+ def tools_supplement_arguments(config)
150
+ config[:tools].each_key do |name|
151
+ tool = @project_config_hash[('tools_' + name.to_s).to_sym]
152
+
153
+ # smoosh in extra arguments if specified at top-level of config (useful for plugins & default gcc tools)
154
+ # arguments are squirted in at beginning of list
155
+ top_level_tool = ('tool_' + name.to_s).to_sym
156
+ if (not config[top_level_tool].nil?)
157
+ # adding and flattening is not a good idea: might over-flatten if there's array nesting in tool args
158
+ # use _with_index to preserve order
159
+ config[top_level_tool][:arguments].each_with_index { |arg, index| tool[:arguments].insert( index, arg ) }
160
+ end
161
+ end
162
+ end
146
163
 
147
164
  def find_and_merge_plugins(config)
148
165
  # plugins must be loaded before generic path evaluation & magic that happen later: perform path magic here as discrete step
@@ -151,7 +168,7 @@ class Configurator
151
168
  FilePathUtils::standardize(path)
152
169
  end
153
170
 
154
- @configurator_plugins.add_load_paths(config)
171
+ paths_hash = @configurator_plugins.add_load_paths(config)
155
172
 
156
173
  @rake_plugins = @configurator_plugins.find_rake_plugins(config)
157
174
  @script_plugins = @configurator_plugins.find_script_plugins(config)
@@ -168,6 +185,8 @@ class Configurator
168
185
 
169
186
  # special plugin setting for results printing
170
187
  config[:plugins][:display_raw_test_results] = true if (config[:plugins][:display_raw_test_results].nil?)
188
+
189
+ paths_hash.each_pair { |name, path| config[:plugins][name] = path }
171
190
  end
172
191
 
173
192
 
@@ -179,7 +198,7 @@ class Configurator
179
198
  value_string.replace(@system_wrapper.module_eval(value_string))
180
199
  end
181
200
  @system_wrapper.env_set(key.to_s.upcase, value_string)
182
- end
201
+ end
183
202
  end
184
203
 
185
204
 
@@ -234,14 +253,44 @@ class Configurator
234
253
  end
235
254
 
236
255
 
237
- def build(config)
238
- built_config = @configurator_setup.build_project_config(config)
256
+ # create constants and accessors (attached to this object) from given hash
257
+ def build(config, *keys)
258
+ # create flattened & expanded configuration hash
259
+ built_config = @configurator_setup.build_project_config( config, @configurator_builder.flattenify( config ) )
239
260
 
240
- @source_config_hash = config.clone
241
- @project_config_hash = built_config.clone
261
+ @project_config_hash = built_config.clone
242
262
  store_config()
243
263
 
244
264
  @configurator_setup.build_constants_and_accessors(built_config, binding())
265
+
266
+ # top-level keys disappear when we flatten, so create global constants & accessors to any specified keys
267
+ keys.each do |key|
268
+ hash = { key => config[key] }
269
+ @configurator_setup.build_constants_and_accessors(hash, binding())
270
+ end
271
+ end
272
+
273
+
274
+ # add to constants and accessors as post build step
275
+ def build_supplement(config_base, config_more)
276
+ # merge in our post-build additions to base configuration hash
277
+ config_base.deep_merge!( config_more )
278
+
279
+ # flatten our addition hash
280
+ config_more_flattened = @configurator_builder.flattenify( config_more )
281
+
282
+ # merge our flattened hash with built hash from previous build
283
+ @project_config_hash.deep_merge!( config_more_flattened )
284
+ store_config()
285
+
286
+ # create more constants and accessors
287
+ @configurator_setup.build_constants_and_accessors(config_more_flattened, binding())
288
+
289
+ # recreate constants & update accessors with new merged, base values
290
+ config_more.keys.each do |key|
291
+ hash = { key => config_base[key] }
292
+ @configurator_setup.build_constants_and_accessors(hash, binding())
293
+ end
245
294
  end
246
295
 
247
296
 
@@ -64,7 +64,7 @@ class ConfiguratorBuilder
64
64
  def populate_defaults(config, defaults)
65
65
  defaults.keys.sort.each do |section|
66
66
  defaults[section].keys.sort.each do |entry|
67
- config[section][entry] = defaults[section][entry] if (config[section].nil? or config[section][entry].nil?)
67
+ config[section][entry] = defaults[section][entry].deep_clone if (config[section].nil? or config[section][entry].nil?)
68
68
  end
69
69
  end
70
70
  end
@@ -192,13 +192,6 @@ class ConfiguratorBuilder
192
192
  end
193
193
 
194
194
 
195
- def collect_environment_variables(in_hash)
196
- return {
197
- :collection_environment => in_hash[:environment]
198
- }
199
- end
200
-
201
-
202
195
  def collect_project_options(in_hash)
203
196
  options = []
204
197
 
@@ -11,14 +11,21 @@ class ConfiguratorPlugins
11
11
 
12
12
 
13
13
  def add_load_paths(config)
14
+ plugin_paths = {}
15
+
14
16
  config[:plugins][:load_paths].each do |root|
15
17
  @system_wrapper.add_load_path( root ) if ( not @file_wrapper.directory_listing( File.join( root, '*.rb' ) ).empty? )
16
18
 
17
19
  config[:plugins][:enabled].each do |plugin|
18
20
  path = File.join( root, plugin )
19
- @system_wrapper.add_load_path( path ) if ( not @file_wrapper.directory_listing( File.join( path, '*.rb' ) ).empty? )
21
+ if ( not @file_wrapper.directory_listing( File.join( path, '*.rb' ) ).empty? )
22
+ plugin_paths[(plugin + '_path').to_sym] = path
23
+ @system_wrapper.add_load_path( path )
24
+ end
20
25
  end
21
26
  end
27
+
28
+ return plugin_paths
22
29
  end
23
30
 
24
31
 
@@ -14,40 +14,36 @@ class ConfiguratorSetup
14
14
  constructor :configurator_builder, :configurator_validator
15
15
 
16
16
 
17
- def build_project_config(config)
18
- # convert config object to flattened hash
19
- new_config = @configurator_builder.flattenify(config)
20
-
21
- # flesh out config
22
- @configurator_builder.clean(new_config)
17
+ def build_project_config(config, flattened_config)
18
+ ### flesh out config
19
+ @configurator_builder.clean(flattened_config)
23
20
 
24
- # add to hash values we build up from configuration & file system contents
25
- new_config.merge!(@configurator_builder.set_build_paths(new_config))
26
- new_config.merge!(@configurator_builder.set_force_build_filepaths(new_config))
27
- new_config.merge!(@configurator_builder.set_rakefile_components(new_config))
28
- new_config.merge!(@configurator_builder.set_library_build_info_filepaths(new_config))
29
- new_config.merge!(@configurator_builder.set_release_target(new_config))
30
- new_config.merge!(@configurator_builder.collect_project_options(new_config))
31
- new_config.merge!(@configurator_builder.collect_environment_variables(config))
21
+ ### add to hash values we build up from configuration & file system contents
22
+ flattened_config.merge!(@configurator_builder.set_build_paths(flattened_config))
23
+ flattened_config.merge!(@configurator_builder.set_force_build_filepaths(flattened_config))
24
+ flattened_config.merge!(@configurator_builder.set_rakefile_components(flattened_config))
25
+ flattened_config.merge!(@configurator_builder.set_library_build_info_filepaths(flattened_config))
26
+ flattened_config.merge!(@configurator_builder.set_release_target(flattened_config))
27
+ flattened_config.merge!(@configurator_builder.collect_project_options(flattened_config))
32
28
 
33
- # iterate through all entries in paths section and expand any & all globs to actual paths
34
- new_config.merge!(@configurator_builder.expand_all_path_globs(new_config))
29
+ ### iterate through all entries in paths section and expand any & all globs to actual paths
30
+ flattened_config.merge!(@configurator_builder.expand_all_path_globs(flattened_config))
35
31
 
36
- new_config.merge!(@configurator_builder.collect_source_and_include_paths(new_config))
37
- new_config.merge!(@configurator_builder.collect_source_include_vendor_paths(new_config))
38
- new_config.merge!(@configurator_builder.collect_test_support_source_include_paths(new_config))
39
- new_config.merge!(@configurator_builder.collect_test_support_source_include_vendor_paths(new_config))
40
- new_config.merge!(@configurator_builder.collect_tests(new_config))
41
- new_config.merge!(@configurator_builder.collect_assembly(new_config))
42
- new_config.merge!(@configurator_builder.collect_source(new_config))
43
- new_config.merge!(@configurator_builder.collect_headers(new_config))
44
- new_config.merge!(@configurator_builder.collect_all_existing_compilation_input(new_config))
45
- new_config.merge!(@configurator_builder.collect_test_and_vendor_defines(new_config))
46
- new_config.merge!(@configurator_builder.collect_release_and_vendor_defines(new_config))
47
- new_config.merge!(@configurator_builder.collect_release_artifact_extra_link_objects(new_config))
48
- new_config.merge!(@configurator_builder.collect_test_fixture_extra_link_objects(new_config))
49
-
50
- return new_config
32
+ flattened_config.merge!(@configurator_builder.collect_source_and_include_paths(flattened_config))
33
+ flattened_config.merge!(@configurator_builder.collect_source_include_vendor_paths(flattened_config))
34
+ flattened_config.merge!(@configurator_builder.collect_test_support_source_include_paths(flattened_config))
35
+ flattened_config.merge!(@configurator_builder.collect_test_support_source_include_vendor_paths(flattened_config))
36
+ flattened_config.merge!(@configurator_builder.collect_tests(flattened_config))
37
+ flattened_config.merge!(@configurator_builder.collect_assembly(flattened_config))
38
+ flattened_config.merge!(@configurator_builder.collect_source(flattened_config))
39
+ flattened_config.merge!(@configurator_builder.collect_headers(flattened_config))
40
+ flattened_config.merge!(@configurator_builder.collect_all_existing_compilation_input(flattened_config))
41
+ flattened_config.merge!(@configurator_builder.collect_test_and_vendor_defines(flattened_config))
42
+ flattened_config.merge!(@configurator_builder.collect_release_and_vendor_defines(flattened_config))
43
+ flattened_config.merge!(@configurator_builder.collect_release_artifact_extra_link_objects(flattened_config))
44
+ flattened_config.merge!(@configurator_builder.collect_test_fixture_extra_link_objects(flattened_config))
45
+
46
+ return flattened_config
51
47
  end
52
48
 
53
49
 
@@ -79,8 +75,8 @@ class ConfiguratorSetup
79
75
  def validate_paths(config)
80
76
  validation = []
81
77
 
82
- validation << @configurator_validator.validate_filepath(config, {:search_system_path => false}, :project, :build_root)
83
- validation << @configurator_validator.validate_filepath(config, {:search_system_path => false}, :cmock, :unity_helper) if config[:cmock][:unity_helper]
78
+ validation << @configurator_validator.validate_filepath(config, :project, :build_root)
79
+ validation << @configurator_validator.validate_filepath(config, :cmock, :unity_helper) if config[:cmock][:unity_helper]
84
80
 
85
81
  config[:project][:options_paths].each do |path|
86
82
  validation << @configurator_validator.validate_filepath_simple( path, :project, :options_paths )
@@ -103,7 +99,7 @@ class ConfiguratorSetup
103
99
 
104
100
  config[:tools].keys.sort.each do |key|
105
101
  validation << @configurator_validator.exists?(config, :tools, key, :executable)
106
- validation << @configurator_validator.validate_filepath(config, {:search_system_path => true}, :tools, key, :executable)
102
+ validation << @configurator_validator.validate_executable_filepath(config, :tools, key, :executable) if (not config[:tools][key][:optional])
107
103
  validation << @configurator_validator.validate_tool_stderr_redirect(config, :tools, key)
108
104
  end
109
105
 
@@ -1,3 +1,5 @@
1
+ require 'rubygems'
2
+ require 'rake' # for ext()
1
3
  require 'constants'
2
4
  require 'tool_executor' # for argument replacement pattern
3
5
  require 'file_path_utils' # for glob handling class methods
@@ -63,12 +65,32 @@ class ConfiguratorValidator
63
65
 
64
66
  return true
65
67
  end
66
-
67
68
 
68
69
  # walk into config hash. verify specified file exists.
69
- def validate_filepath(config, options, *keys)
70
- hash = retrieve_value(config, keys)
71
- filepath = hash[:value]
70
+ def validate_filepath(config, *keys)
71
+ hash = retrieve_value(config, keys)
72
+ filepath = hash[:value]
73
+
74
+ # return early if we couldn't walk into hash and find a value
75
+ return false if (filepath.nil?)
76
+
77
+ # skip everything if we've got an argument replacement pattern
78
+ return true if (filepath =~ TOOL_EXECUTOR_ARGUMENT_REPLACEMENT_PATTERN)
79
+
80
+ if (not @file_wrapper.exist?(filepath))
81
+ # no verbosity checking since this is lowest level anyhow & verbosity checking depends on configurator
82
+ @stream_wrapper.stderr_puts("ERROR: Config filepath #{format_key_sequence(keys, hash[:depth])}['#{filepath}'] does not exist on disk.")
83
+ return false
84
+ end
85
+
86
+ return true
87
+ end
88
+
89
+ # walk into config hash. verify specified file exists.
90
+ def validate_executable_filepath(config, *keys)
91
+ exe_extension = config[:extension][:executable]
92
+ hash = retrieve_value(config, keys)
93
+ filepath = hash[:value]
72
94
 
73
95
  # return early if we couldn't walk into hash and find a value
74
96
  return false if (filepath.nil?)
@@ -77,7 +99,7 @@ class ConfiguratorValidator
77
99
  return true if (filepath =~ TOOL_EXECUTOR_ARGUMENT_REPLACEMENT_PATTERN)
78
100
 
79
101
  # if there's no path included, verify file exists somewhere in system search paths
80
- if (not filepath.include?('/') and options[:search_system_path])
102
+ if (not filepath.include?('/'))
81
103
  exists = false
82
104
 
83
105
  @system_wrapper.search_paths.each do |path|
@@ -85,6 +107,11 @@ class ConfiguratorValidator
85
107
  exists = true
86
108
  break
87
109
  end
110
+
111
+ if (@file_wrapper.exist?( (File.join(path, filepath)).ext( exe_extension ) ))
112
+ exists = true
113
+ break
114
+ end
88
115
  end
89
116
 
90
117
  if (not exists)