setupinator.rb 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. class Setupinator
  2. attr_reader :config_hash
  3. attr_writer :ceedling
  4. def setup
  5. @ceedling = {}
  6. @config_hash = {}
  7. end
  8. def load_project_files
  9. @ceedling[:project_file_loader].find_project_files
  10. return @ceedling[:project_file_loader].load_project_config
  11. end
  12. def do_setup(config_hash)
  13. @config_hash = config_hash
  14. # load up all the constants and accessors our rake files, objects, & external scripts will need;
  15. # note: configurator modifies the cmock section of the hash with a couple defaults to tie
  16. # project together - the modified hash is used to build cmock object
  17. @ceedling[:configurator].populate_defaults( config_hash )
  18. @ceedling[:configurator].populate_cmock_defaults( config_hash )
  19. @ceedling[:configurator].find_and_merge_plugins( config_hash )
  20. @ceedling[:configurator].tools_setup( config_hash )
  21. @ceedling[:configurator].eval_environment_variables( config_hash )
  22. @ceedling[:configurator].eval_paths( config_hash )
  23. @ceedling[:configurator].standardize_paths( config_hash )
  24. @ceedling[:configurator].validate( config_hash )
  25. @ceedling[:configurator].build( config_hash, :environment )
  26. @ceedling[:configurator].insert_rake_plugins( @ceedling[:configurator].rake_plugins )
  27. @ceedling[:configurator].tools_supplement_arguments( config_hash )
  28. # merge in any environment variables plugins specify, after the main build
  29. @ceedling[:plugin_manager].load_plugin_scripts( @ceedling[:configurator].script_plugins, @ceedling ) do |env|
  30. @ceedling[:configurator].eval_environment_variables( env )
  31. @ceedling[:configurator].build_supplement( config_hash, env )
  32. end
  33. @ceedling[:plugin_reportinator].set_system_objects( @ceedling )
  34. @ceedling[:file_finder].prepare_search_sources
  35. @ceedling[:loginator].setup_log_filepath
  36. @ceedling[:project_config_manager].config_hash = config_hash
  37. end
  38. def reset_defaults(config_hash)
  39. @ceedling[:configurator].reset_defaults( config_hash )
  40. end
  41. end