origen 0.0.1 → 0.0.2

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.
Files changed (336) hide show
  1. checksums.yaml +4 -4
  2. data/bin/ctags +0 -0
  3. data/bin/origen +165 -1
  4. data/bin/rgen +2 -0
  5. data/config/application.rb +141 -0
  6. data/config/commands.rb +72 -0
  7. data/config/development.rb +7 -0
  8. data/config/environment.rb +0 -0
  9. data/config/rgen.policy +7 -0
  10. data/config/rubocop/easy.yml +620 -0
  11. data/config/rubocop/easy_disabled.yml +271 -0
  12. data/config/rubocop/easy_enabled.yml +731 -0
  13. data/config/rubocop/strict.yml +620 -0
  14. data/config/rubocop/strict_disabled.yml +247 -0
  15. data/config/rubocop/strict_enabled.yml +755 -0
  16. data/config/users.rb +20 -0
  17. data/config/version.rb +1 -1
  18. data/helpers/url.rb +68 -0
  19. data/lib/c99/doc_interface.rb +56 -0
  20. data/lib/c99/j750_interface.rb +85 -0
  21. data/lib/c99/nvm.rb +89 -0
  22. data/lib/c99/target/mock2.rb +1 -0
  23. data/lib/c99/target/subdir/mock3.rb +1 -0
  24. data/lib/option_parser/optparse.rb +12 -0
  25. data/lib/origen/acronyms.rb +60 -0
  26. data/lib/origen/application/command_dispatcher.rb +12 -0
  27. data/lib/origen/application/configuration.rb +206 -0
  28. data/lib/origen/application/configuration_manager.rb +78 -0
  29. data/lib/origen/application/deployer.rb +367 -0
  30. data/lib/origen/application/environment.rb +186 -0
  31. data/lib/origen/application/lsf.rb +145 -0
  32. data/lib/origen/application/lsf_manager.rb +657 -0
  33. data/lib/origen/application/plugins_manager.rb +280 -0
  34. data/lib/origen/application/release.rb +359 -0
  35. data/lib/origen/application/runner.rb +246 -0
  36. data/lib/origen/application/statistics.rb +191 -0
  37. data/lib/origen/application/target.rb +374 -0
  38. data/lib/origen/application/version_tracker.rb +59 -0
  39. data/lib/origen/application/workspace_manager.rb +151 -0
  40. data/lib/origen/application.rb +746 -0
  41. data/lib/origen/bugs/bug.rb +36 -0
  42. data/lib/origen/bugs.rb +45 -0
  43. data/lib/origen/callbacks.rb +35 -0
  44. data/lib/origen/chip_mode.rb +118 -0
  45. data/lib/origen/chip_package.rb +461 -0
  46. data/lib/origen/client.rb +87 -0
  47. data/lib/origen/code_generators/actions.rb +258 -0
  48. data/lib/origen/code_generators/base.rb +57 -0
  49. data/lib/origen/code_generators/bundler.rb +17 -0
  50. data/lib/origen/code_generators/gem_setup.rb +49 -0
  51. data/lib/origen/code_generators/rake.rb +13 -0
  52. data/lib/origen/code_generators/rspec.rb +12 -0
  53. data/lib/origen/code_generators/semver.rb +39 -0
  54. data/lib/origen/code_generators/timever.rb +37 -0
  55. data/lib/origen/code_generators.rb +111 -0
  56. data/lib/origen/commands/add.rb +12 -0
  57. data/lib/origen/commands/compile.rb +62 -0
  58. data/lib/origen/commands/ctags.rb +9 -0
  59. data/lib/origen/commands/dispatch.rb +22 -0
  60. data/lib/origen/commands/environment.rb +11 -0
  61. data/lib/origen/commands/fetch.rb +63 -0
  62. data/lib/origen/commands/generate.rb +130 -0
  63. data/lib/origen/commands/interactive.rb +73 -0
  64. data/lib/origen/commands/lint.rb +82 -0
  65. data/lib/origen/commands/lsf.rb +93 -0
  66. data/lib/origen/commands/merge.rb +55 -0
  67. data/lib/origen/commands/modifications.rb +12 -0
  68. data/lib/origen/commands/new.rb +113 -0
  69. data/lib/origen/commands/plugin.rb +105 -0
  70. data/lib/origen/commands/program.rb +70 -0
  71. data/lib/origen/commands/rc.rb +442 -0
  72. data/lib/origen/commands/save.rb +56 -0
  73. data/lib/origen/commands/target.rb +27 -0
  74. data/lib/origen/commands/time.rb +127 -0
  75. data/lib/origen/commands/version.rb +17 -0
  76. data/lib/origen/commands/web.rb +221 -0
  77. data/lib/origen/commands.rb +272 -0
  78. data/lib/origen/commands_global.rb +76 -0
  79. data/lib/origen/controller.rb +94 -0
  80. data/lib/origen/core_ext/array.rb +23 -0
  81. data/lib/origen/core_ext/bignum.rb +36 -0
  82. data/lib/origen/core_ext/enumerable.rb +76 -0
  83. data/lib/origen/core_ext/fixnum.rb +46 -0
  84. data/lib/origen/core_ext/hash.rb +52 -0
  85. data/lib/origen/core_ext/module.rb +14 -0
  86. data/lib/origen/core_ext/numeric.rb +126 -0
  87. data/lib/origen/core_ext/object.rb +13 -0
  88. data/lib/origen/core_ext/range.rb +7 -0
  89. data/lib/origen/core_ext/string.rb +124 -0
  90. data/lib/origen/core_ext.rb +10 -0
  91. data/lib/origen/database/key_value_store.rb +111 -0
  92. data/lib/origen/database/key_value_stores.rb +108 -0
  93. data/lib/origen/database.rb +6 -0
  94. data/lib/origen/encodings.rb +102 -0
  95. data/lib/origen/features/feature.rb +22 -0
  96. data/lib/origen/features.rb +104 -0
  97. data/lib/origen/file_handler.rb +429 -0
  98. data/lib/origen/generator/comparator.rb +56 -0
  99. data/lib/origen/generator/compiler.rb +277 -0
  100. data/lib/origen/generator/flow.rb +49 -0
  101. data/lib/origen/generator/job.rb +131 -0
  102. data/lib/origen/generator/pattern.rb +356 -0
  103. data/lib/origen/generator/pattern_finder.rb +155 -0
  104. data/lib/origen/generator/pattern_iterator.rb +55 -0
  105. data/lib/origen/generator/renderer.rb +113 -0
  106. data/lib/origen/generator/resources.rb +40 -0
  107. data/lib/origen/generator/stage.rb +89 -0
  108. data/lib/origen/generator.rb +85 -0
  109. data/lib/origen/global_methods.rb +205 -0
  110. data/lib/origen/import_manager.rb +596 -0
  111. data/lib/origen/location/base.rb +116 -0
  112. data/lib/origen/location/map.rb +83 -0
  113. data/lib/origen/location.rb +6 -0
  114. data/lib/origen/log.rb +217 -0
  115. data/lib/origen/logger_methods.rb +56 -0
  116. data/lib/origen/mode.rb +61 -0
  117. data/lib/origen/model.rb +267 -0
  118. data/lib/origen/model_initializer.rb +45 -0
  119. data/lib/origen/nvm/block_array.rb +72 -0
  120. data/lib/origen/nvm.rb +6 -0
  121. data/lib/origen/parameters/live.rb +22 -0
  122. data/lib/origen/parameters/missing.rb +28 -0
  123. data/lib/origen/parameters/set.rb +144 -0
  124. data/lib/origen/parameters.rb +107 -0
  125. data/lib/origen/pdm.rb +218 -0
  126. data/lib/origen/pins/function_proxy.rb +36 -0
  127. data/lib/origen/pins/ground_pin.rb +6 -0
  128. data/lib/origen/pins/pin.rb +860 -0
  129. data/lib/origen/pins/pin_bank.rb +349 -0
  130. data/lib/origen/pins/pin_clock.rb +124 -0
  131. data/lib/origen/pins/pin_collection.rb +492 -0
  132. data/lib/origen/pins/pin_common.rb +206 -0
  133. data/lib/origen/pins/port.rb +268 -0
  134. data/lib/origen/pins/power_pin.rb +30 -0
  135. data/lib/origen/pins.rb +696 -0
  136. data/lib/origen/registers/bit.rb +562 -0
  137. data/lib/origen/registers/bit_collection.rb +787 -0
  138. data/lib/origen/registers/container.rb +288 -0
  139. data/lib/origen/registers/domain.rb +16 -0
  140. data/lib/origen/registers/reg.rb +1406 -0
  141. data/lib/origen/registers/reg_collection.rb +24 -0
  142. data/lib/origen/registers.rb +652 -0
  143. data/lib/origen/regression_manager.rb +251 -0
  144. data/lib/origen/remote_manager.rb +340 -0
  145. data/lib/origen/revision_control/base.rb +257 -0
  146. data/lib/origen/revision_control/design_sync.rb +276 -0
  147. data/lib/origen/revision_control/git.rb +243 -0
  148. data/lib/origen/revision_control/subversion.rb +6 -0
  149. data/lib/origen/revision_control.rb +44 -0
  150. data/lib/origen/ruby_version_check.rb +131 -0
  151. data/lib/origen/site_config.rb +61 -0
  152. data/lib/origen/specs/checkers.rb +103 -0
  153. data/lib/origen/specs/creation_info.rb +17 -0
  154. data/lib/origen/specs/doc_resource.rb +91 -0
  155. data/lib/origen/specs/exhibit.rb +17 -0
  156. data/lib/origen/specs/mode_select.rb +16 -0
  157. data/lib/origen/specs/note.rb +17 -0
  158. data/lib/origen/specs/override.rb +21 -0
  159. data/lib/origen/specs/power_supply.rb +13 -0
  160. data/lib/origen/specs/spec.rb +226 -0
  161. data/lib/origen/specs/version_history.rb +14 -0
  162. data/lib/origen/specs.rb +552 -0
  163. data/lib/origen/sub_blocks.rb +298 -0
  164. data/lib/origen/tester/api.rb +277 -0
  165. data/lib/origen/tester/bdm/bdm.rb +25 -0
  166. data/lib/origen/tester/command_based_tester.rb +46 -0
  167. data/lib/origen/tester/doc/doc.rb +226 -0
  168. data/lib/origen/tester/doc/generator/flow.rb +71 -0
  169. data/lib/origen/tester/doc/generator/flow_line.rb +203 -0
  170. data/lib/origen/tester/doc/generator/test.rb +68 -0
  171. data/lib/origen/tester/doc/generator/test_group.rb +66 -0
  172. data/lib/origen/tester/doc/generator/tests.rb +47 -0
  173. data/lib/origen/tester/doc/generator.rb +126 -0
  174. data/lib/origen/tester/doc/model.rb +162 -0
  175. data/lib/origen/tester/generator/flow_control_api.rb +606 -0
  176. data/lib/origen/tester/generator/identity_map.rb +25 -0
  177. data/lib/origen/tester/generator/placeholder.rb +13 -0
  178. data/lib/origen/tester/generator/test_numberer.rb +25 -0
  179. data/lib/origen/tester/generator.rb +271 -0
  180. data/lib/origen/tester/interface.rb +154 -0
  181. data/lib/origen/tester/j750/files.rb +45 -0
  182. data/lib/origen/tester/j750/generator/flow.rb +123 -0
  183. data/lib/origen/tester/j750/generator/flow_line.rb +288 -0
  184. data/lib/origen/tester/j750/generator/patgroup.rb +111 -0
  185. data/lib/origen/tester/j750/generator/patgroups.rb +41 -0
  186. data/lib/origen/tester/j750/generator/patset.rb +111 -0
  187. data/lib/origen/tester/j750/generator/patsets.rb +41 -0
  188. data/lib/origen/tester/j750/generator/templates/flow.txt.erb +9 -0
  189. data/lib/origen/tester/j750/generator/templates/instances.txt.erb +16 -0
  190. data/lib/origen/tester/j750/generator/templates/patgroups.txt.erb +8 -0
  191. data/lib/origen/tester/j750/generator/templates/patsets.txt.erb +10 -0
  192. data/lib/origen/tester/j750/generator/test_instance.rb +846 -0
  193. data/lib/origen/tester/j750/generator/test_instance_group.rb +60 -0
  194. data/lib/origen/tester/j750/generator/test_instances.rb +182 -0
  195. data/lib/origen/tester/j750/generator.rb +203 -0
  196. data/lib/origen/tester/j750/j750.rb +845 -0
  197. data/lib/origen/tester/j750/j750_hpt.rb +35 -0
  198. data/lib/origen/tester/j750/parser/ac_spec.rb +11 -0
  199. data/lib/origen/tester/j750/parser/ac_specs.rb +0 -0
  200. data/lib/origen/tester/j750/parser/dc_spec.rb +36 -0
  201. data/lib/origen/tester/j750/parser/dc_specs.rb +50 -0
  202. data/lib/origen/tester/j750/parser/descriptions.rb +340 -0
  203. data/lib/origen/tester/j750/parser/flow.rb +111 -0
  204. data/lib/origen/tester/j750/parser/flow_line.rb +207 -0
  205. data/lib/origen/tester/j750/parser/flows.rb +23 -0
  206. data/lib/origen/tester/j750/parser/pattern_set.rb +94 -0
  207. data/lib/origen/tester/j750/parser/pattern_sets.rb +33 -0
  208. data/lib/origen/tester/j750/parser/test_instance.rb +322 -0
  209. data/lib/origen/tester/j750/parser/test_instances.rb +26 -0
  210. data/lib/origen/tester/j750/parser/timeset.rb +15 -0
  211. data/lib/origen/tester/j750/parser/timesets.rb +0 -0
  212. data/lib/origen/tester/j750/parser.rb +104 -0
  213. data/lib/origen/tester/jlink/jlink.rb +33 -0
  214. data/lib/origen/tester/parser/description_lookup.rb +64 -0
  215. data/lib/origen/tester/parser/searchable_array.rb +32 -0
  216. data/lib/origen/tester/parser/searchable_hash.rb +32 -0
  217. data/lib/origen/tester/parser.rb +24 -0
  218. data/lib/origen/tester/time.rb +338 -0
  219. data/lib/origen/tester/timing.rb +253 -0
  220. data/lib/origen/tester/ultraflex/files.rb +45 -0
  221. data/lib/origen/tester/ultraflex/generator/flow.rb +119 -0
  222. data/lib/origen/tester/ultraflex/generator/flow_line.rb +269 -0
  223. data/lib/origen/tester/ultraflex/generator/patgroup.rb +111 -0
  224. data/lib/origen/tester/ultraflex/generator/patgroups.rb +41 -0
  225. data/lib/origen/tester/ultraflex/generator/patset.rb +111 -0
  226. data/lib/origen/tester/ultraflex/generator/patsets.rb +41 -0
  227. data/lib/origen/tester/ultraflex/generator/templates/flow.txt.erb +9 -0
  228. data/lib/origen/tester/ultraflex/generator/templates/instances.txt.erb +16 -0
  229. data/lib/origen/tester/ultraflex/generator/templates/patgroups.txt.erb +8 -0
  230. data/lib/origen/tester/ultraflex/generator/templates/patsets.txt.erb +10 -0
  231. data/lib/origen/tester/ultraflex/generator/test_instance.rb +622 -0
  232. data/lib/origen/tester/ultraflex/generator/test_instance_group.rb +60 -0
  233. data/lib/origen/tester/ultraflex/generator/test_instances.rb +174 -0
  234. data/lib/origen/tester/ultraflex/generator.rb +200 -0
  235. data/lib/origen/tester/ultraflex/parser/ac_spec.rb +11 -0
  236. data/lib/origen/tester/ultraflex/parser/ac_specs.rb +0 -0
  237. data/lib/origen/tester/ultraflex/parser/dc_spec.rb +36 -0
  238. data/lib/origen/tester/ultraflex/parser/dc_specs.rb +50 -0
  239. data/lib/origen/tester/ultraflex/parser/descriptions.rb +342 -0
  240. data/lib/origen/tester/ultraflex/parser/flow.rb +111 -0
  241. data/lib/origen/tester/ultraflex/parser/flow_line.rb +207 -0
  242. data/lib/origen/tester/ultraflex/parser/flows.rb +23 -0
  243. data/lib/origen/tester/ultraflex/parser/pattern_set.rb +94 -0
  244. data/lib/origen/tester/ultraflex/parser/pattern_sets.rb +33 -0
  245. data/lib/origen/tester/ultraflex/parser/test_instance.rb +262 -0
  246. data/lib/origen/tester/ultraflex/parser/test_instances.rb +26 -0
  247. data/lib/origen/tester/ultraflex/parser/timeset.rb +15 -0
  248. data/lib/origen/tester/ultraflex/parser/timesets.rb +0 -0
  249. data/lib/origen/tester/ultraflex/parser.rb +104 -0
  250. data/lib/origen/tester/ultraflex/ultraflex.rb +759 -0
  251. data/lib/origen/tester/v93k/generator/flow.rb +63 -0
  252. data/lib/origen/tester/v93k/generator/flow_node/print.rb +10 -0
  253. data/lib/origen/tester/v93k/generator/flow_node.rb +17 -0
  254. data/lib/origen/tester/v93k/generator/pattern.rb +16 -0
  255. data/lib/origen/tester/v93k/generator/pattern_master.rb +54 -0
  256. data/lib/origen/tester/v93k/generator/templates/_test_method.txt.erb +6 -0
  257. data/lib/origen/tester/v93k/generator/templates/_test_suite.txt.erb +11 -0
  258. data/lib/origen/tester/v93k/generator/templates/template.flow.erb +121 -0
  259. data/lib/origen/tester/v93k/generator/templates/template.pmfl.erb +9 -0
  260. data/lib/origen/tester/v93k/generator/test_function.rb +103 -0
  261. data/lib/origen/tester/v93k/generator/test_functions.rb +79 -0
  262. data/lib/origen/tester/v93k/generator/test_method.rb +46 -0
  263. data/lib/origen/tester/v93k/generator/test_methods.rb +75 -0
  264. data/lib/origen/tester/v93k/generator/test_suite.rb +54 -0
  265. data/lib/origen/tester/v93k/generator/test_suites.rb +65 -0
  266. data/lib/origen/tester/v93k/generator.rb +80 -0
  267. data/lib/origen/tester/v93k/v93k.rb +420 -0
  268. data/lib/origen/tester/vector.rb +86 -0
  269. data/lib/origen/tester/vector_generator.rb +633 -0
  270. data/lib/origen/tester/vector_pipeline.rb +150 -0
  271. data/lib/origen/tester.rb +56 -0
  272. data/lib/origen/top_level.rb +134 -0
  273. data/lib/origen/users/ldap.rb +65 -0
  274. data/lib/origen/users/user.rb +149 -0
  275. data/lib/origen/users.rb +30 -0
  276. data/lib/origen/utility/block_args.rb +93 -0
  277. data/lib/origen/utility/csv_data.rb +110 -0
  278. data/lib/origen/utility/design_sync.rb +494 -0
  279. data/lib/origen/utility/diff.rb +158 -0
  280. data/lib/origen/utility/input_capture.rb +121 -0
  281. data/lib/origen/utility/mailer.rb +143 -0
  282. data/lib/origen/utility/s_record.rb +205 -0
  283. data/lib/origen/utility/time_and_date.rb +30 -0
  284. data/lib/origen/utility.rb +12 -0
  285. data/lib/origen/version_checker.rb +117 -0
  286. data/lib/origen/version_string.rb +356 -0
  287. data/lib/origen.rb +648 -0
  288. data/lib/tasks/gem.rake +27 -22
  289. data/origen_site_config.yml +36 -0
  290. data/source_setup +17 -0
  291. data/spec/format/rgen_formatter.rb +14 -0
  292. data/templates/api_doc/README.txt.erb +24 -0
  293. data/templates/code_generators/gemfile_app.rb +4 -0
  294. data/templates/code_generators/gemfile_plugin.rb +6 -0
  295. data/templates/code_generators/gemspec.rb +33 -0
  296. data/templates/code_generators/rakefile.rb +10 -0
  297. data/templates/code_generators/spec_helper.rb +49 -0
  298. data/templates/code_generators/version.rb +8 -0
  299. data/templates/code_generators/version_time.rb +3 -0
  300. data/templates/git/gitignore.erb +33 -0
  301. data/templates/j750/_vt_flow.txt.erb +8 -0
  302. data/templates/j750/_vt_instances.txt.erb +4 -0
  303. data/templates/j750/program_sheet.txt.erb +9 -0
  304. data/templates/nanoc/Rules +74 -0
  305. data/templates/nanoc/config.yaml +77 -0
  306. data/templates/nanoc/content/favicon.ico +0 -0
  307. data/templates/nanoc/layouts/bootstrap.html.erb +63 -0
  308. data/templates/nanoc/layouts/bootstrap3.html.erb +71 -0
  309. data/templates/nanoc/layouts/freescale.html.erb +79 -0
  310. data/templates/nanoc/lib/bootstrap_filter.rb +49 -0
  311. data/templates/nanoc/lib/codeblocks_filter.rb +41 -0
  312. data/templates/nanoc/lib/default.rb +2 -0
  313. data/templates/nanoc/lib/gzip_filter.rb +16 -0
  314. data/templates/nanoc/lib/haml_code_filter.rb +41 -0
  315. data/templates/nanoc/lib/helpers.rb +1 -0
  316. data/templates/nanoc/lib/search_filter.rb +62 -0
  317. data/templates/nanoc_dynamic/content/search.js.erb +92 -0
  318. data/templates/shared/web/_logo.html +10 -0
  319. data/templates/test/_inline_sub.txt.erb +2 -0
  320. data/templates/test/environment.txt.erb +1 -0
  321. data/templates/test/inline.txt.erb +11 -0
  322. data/templates/test/inspections.txt.erb +19 -0
  323. data/templates/test/set1/_sub1.txt.erb +12 -0
  324. data/templates/test/set1/_sub4.txt.erb +1 -0
  325. data/templates/test/set1/_sub5.txt.erb +1 -0
  326. data/templates/test/set1/main.txt.erb +53 -0
  327. data/templates/test/set1/sub_dir/_sub2.txt.erb +20 -0
  328. data/templates/test/set1/sub_dir/_sub3.txt.erb +12 -0
  329. data/templates/test/set1/sub_dir/main2.txt.erb +4 -0
  330. data/templates/test/set2/template_with_no_erb_1.txt +9 -0
  331. data/templates/test/set2/template_with_no_erb_2.txt +9 -0
  332. data/templates/test/set3/_layout.html.erb +4 -0
  333. data/templates/test/set3/content.html.erb +6 -0
  334. data/templates/time/filter.rb.erb +15 -0
  335. data/templates/time/rules.rb.erb +45 -0
  336. metadata +639 -5
@@ -0,0 +1,22 @@
1
+ # begin
2
+ if Origen.command_dispatcher.snapshots_exist?
3
+ ix = ARGV.index('--snapshot_rev')
4
+ if ix
5
+ ARGV.delete_at(ix)
6
+ version = ARGV[ix]
7
+ ARGV.delete_at(ix)
8
+ else
9
+ version = :latest
10
+ end
11
+
12
+ Origen.command_dispatcher.create_workspace(version) do |workspace|
13
+ workspace.execute(ARGV)
14
+ end
15
+
16
+ else
17
+ fail 'Sorry no worker snapshots could be found!'
18
+ end
19
+
20
+ # rescue
21
+ # Origen.command_dispatcher.record_error
22
+ # end
@@ -0,0 +1,11 @@
1
+ module Origen
2
+ env = ARGV.shift
3
+ if env
4
+ Origen.environment.default = env
5
+ puts "Environment now set to: #{Origen.environment.file.basename}"
6
+ else
7
+ Origen.environment.describe
8
+ end
9
+
10
+ exit 0
11
+ end
@@ -0,0 +1,63 @@
1
+ require 'optparse'
2
+ require 'fileutils'
3
+
4
+ options = {}
5
+
6
+ opt_parser = OptionParser.new do |opts|
7
+ opts.banner = <<-END
8
+ Automatically creates the workspace for the requested origen plugin and populates the latest version from the server.
9
+
10
+ By default this will always create the workspace at './[PLUGIN_NAME]'
11
+
12
+ Usage: origen fetch [PLUGIN_NAME] [options]
13
+ END
14
+ opts.on('-o', '--outputdir', 'User defined destination directory of the plugin workspace') { options[:debugger] = true }
15
+ opts.on('-h', '--help', 'Show this message') { puts opts; exit }
16
+ end
17
+ opt_parser.orig_parse! ARGV
18
+ options[:patterns] = ARGV
19
+
20
+ # Extract user input
21
+ plugin_name = ARGV[0]
22
+ dir = ARGV[1]
23
+
24
+ # Set valid_name to false by default
25
+ valid_name = false
26
+
27
+ # If requested plugin is origen_core or origen, then run special case, else search through all available plugins
28
+ if plugin_name.downcase == 'origen_core' || plugin_name.downcase == 'origen'
29
+ plugin_name = 'origen'
30
+ valid_name = true
31
+ rc_url = Origen.client.origen[:vault]
32
+ else
33
+ Origen.client.plugins.each do |name|
34
+ if name[:origen_name].downcase == plugin_name.downcase
35
+ valid_name = true
36
+ rc_url = name[:vault]
37
+ end
38
+ end
39
+ end
40
+
41
+ # If valid_name not found, then abort
42
+ unless valid_name == true
43
+ puts "The #{plugin_name} plugin which you have requested has not been found, check make sure you have typed in the name correctly"
44
+ puts "To see the list of available plugins, please run 'origen plugin list' inside an existing origen workspace"
45
+ exit 1
46
+ end
47
+
48
+ # If user didn't specify directory then configure for default directory
49
+ unless dir
50
+ dir = "./#{plugin_name}"
51
+ puts "You did not specify a workspace directory for #{plugin_name} plugin, it will therefore be created at"
52
+ puts "#{dir}"
53
+ end
54
+
55
+ # Checks to see if the destination directory is empty
56
+ unless Dir["#{dir}/*"].empty?
57
+ puts 'The requested workspace is not empty, please delete it and try again, or select a different path.'
58
+ exit 1
59
+ end
60
+
61
+ # Set up the requested plugin workspace
62
+ rc = Origen::RevisionControl.new remote: rc_url, local: dir
63
+ rc.build
@@ -0,0 +1,130 @@
1
+ require 'optparse'
2
+
3
+ options = {}
4
+
5
+ # App options are options that the application can supply to extend this command
6
+ app_options = @application_options || []
7
+ opt_parser = OptionParser.new do |opts|
8
+ opts.banner = 'Usage: origen g [space separated patterns or lists] [options]'
9
+ opts.on('-e', '--environment NAME', String, 'Override the default environment, NAME can be a full path or a fragment of an environment file name') { |e| options[:environment] = e }
10
+ opts.on('-t', '--target NAME', String, 'Override the default target, NAME can be a full path or a fragment of a target file name') { |t| options[:target] = t }
11
+ opts.on('-l', '--lsf [ACTION]', [:clear, :add], "Submit jobs to the LSF, optionally specify whether to 'clear' or 'add' to existing jobs") { |a| options[:lsf] = true; options[:lsf_action] = a }
12
+ opts.on('-w', '--wait', 'Wait for LSF processing to complete') { options[:wait_for_lsf_completion] = true }
13
+ opts.on('-c', '--continue', 'Continue on error (to the next pattern)') { options[:continue] = true }
14
+ opts.on('-pl', '--plugin PLUGIN_NAME', String, 'Set current plugin') { |pl_n| options[:current_plugin] = pl_n }
15
+ opts.on('-f', '--file FILE', String, 'Override the default log file') { |o| options[:log_file] = o }
16
+ opts.on('-o', '--output DIR', String, 'Override the default output directory') { |o| options[:output] = o }
17
+ opts.on('-r', '--reference DIR', String, 'Override the default reference directory') { |o| options[:reference] = o }
18
+ opts.on('-q', '--queue NAME', String, 'Specify the LSF queue, default is short') { |o| options[:queue] = o }
19
+ opts.on('-p', '--project NAME', String, 'Specify the LSF project, default is msg.te') { |o| options[:project] = o }
20
+ opts.on('--doc', 'Generate into doc format') { options[:doc] = true }
21
+ opts.on('--html', 'Generate into html format') { options[:html] = true }
22
+ opts.on('--nocom', 'No comments in the generated pattern') { options[:no_comments] = true }
23
+ opts.on('-d', '--debugger', 'Enable the debugger') { options[:debugger] = true }
24
+ opts.on('-m', '--mode MODE', Origen::Mode::MODES, 'Force the Origen operating mode:', ' ' + Origen::Mode::MODES.join(', ')) { |_m| }
25
+ app_options.each do |app_option|
26
+ opts.on(*app_option) {}
27
+ end
28
+ opts.separator ''
29
+ opts.on('-h', '--help', 'Show this message') { puts opts; exit }
30
+ end
31
+
32
+ opt_parser.parse! ARGV
33
+ options[:patterns] = ARGV
34
+
35
+ def self._with_doc_tester(options)
36
+ if options[:doc] || options[:html]
37
+ Origen.app.with_doc_tester(options) do
38
+ yield
39
+ end
40
+ else
41
+ yield
42
+ end
43
+ end
44
+
45
+ Origen.load_application
46
+
47
+ if options[:queue]
48
+ Origen.config.lsf.queue = options.delete(:queue)
49
+ end
50
+ if options[:project]
51
+ Origen.config.lsf.project = options.delete(:project)
52
+ end
53
+
54
+ _with_doc_tester(options) do
55
+ Origen.current_plugin.temporary = options[:current_plugin] if options[:current_plugin]
56
+ Origen.environment.temporary = options[:environment] if options[:environment]
57
+ Origen.target.temporary = options[:target] if options[:target]
58
+ Origen.app.load_target! # This initial load is required to apply any configuration
59
+ # options present in the target, it will loaded again before
60
+ # each generate/compile job
61
+ Origen.app.runner.generate(options)
62
+
63
+ Origen.lsf.wait_for_completion if options[:wait_for_lsf_completion]
64
+ end
65
+
66
+ # method_option :vector_comments, :default => false, :aliases => "-v", :type => :boolean,
67
+ # :desc => "Add vector and cycle number comments to the pattern, disabled by default to make diff viewing easier"
68
+
69
+ # === Task: $ origen g [patname/patlist] [options]
70
+ # Generate a pattern or list of patterns.
71
+ #
72
+ # ==== Supplying a pattern name
73
+ # Multiple pattern name arguments can be supplied on the command line. The generator is non-strict
74
+ # about pre and post-fixes to the pattern names so the following all work; use whichever is most
75
+ # convenient:
76
+ #
77
+ # origen g prb_ers_mas_atuf
78
+ # origen g prb_ers_mas_atuf.rb
79
+ # origen g nvm_prb_ers_mas_atuf.atp
80
+ # origen g pattern/erase/prb_ers_mas_atuf.rb
81
+ #
82
+ # For patterns that use iterators you can supply either the pattern source name or the generated name,
83
+ # for example these are equivalent:
84
+ #
85
+ # origen g prb_ers_mas_bx.rb
86
+ # origen g prb_ers_mas_b0.atp
87
+ #
88
+ # Multiple patterns can be supplied on the command line and should be comma separated with no spaces
89
+ # in between:
90
+ #
91
+ # origen g prb_ers_mas_atuf,prb_ers_mas_bx
92
+ #
93
+ # A pattern list is simply the name of any file that resides in the /list directory and which contains
94
+ # a list of patname arguments (same rules apply as for the command line version).
95
+ # The list files can be commented with '#' and can reference other list files. For example it is
96
+ # common to make a production.list or master.list file that references other sub lists: probe.list,
97
+ # ft.list, etc.
98
+ #
99
+ # ==== Generator output
100
+ # The command line output is as follows:
101
+ #
102
+ # Generating... nvm_prb_ers_mas_atuf.atp 3039 0.201732
103
+ # | | |
104
+ # Created output file, can be found in Number of Execution time
105
+ # output/<soc>/ vectors on the tester
106
+ #
107
+ # All output from the last run can be found in log.txt, this is just a direct copy of the output in
108
+ # the console.
109
+ #
110
+ # ==== Tracking changes
111
+ # Upon completion you will be alerted if there are some new or changed files and will prompted to
112
+ # save these. It is recommended that you perform the save if you know why the change happened (or if
113
+ # you are running in a brand new workspace). You can then use the automatic pattern diff feature to
114
+ # be alerted to any change in the pattern content the next time you generate a given pattern. Note that
115
+ # a tkdiff executable is automatically output to allow you to inspect the differences.
116
+ #
117
+ # To allow you to locate changed or new patterns easily they are automatically copied to:
118
+ # output/<soc>/changed/
119
+ #
120
+ # The reference files are stored in $ORIGEN_WORK/.ref <br>
121
+ # Very often you will want to compare the output of the current generator to a previous version,
122
+ # to do this remove the .ref and replace it with a link to the .ref in another workspace.
123
+ # rm -fr .ref
124
+ # ln -s <path_to_my_ref_workspace>/.ref .ref
125
+ # After that generate and save the patterns in the reference workspace and re-run the patterns in the original
126
+ # workspace to see if there are any differences.
127
+ #
128
+ # ==== Options
129
+ # For a list of options run:
130
+ # origen help g
@@ -0,0 +1,73 @@
1
+ require 'optparse'
2
+ require 'irb'
3
+ require 'irb/completion'
4
+ begin
5
+ require 'pry'
6
+ rescue LoadError
7
+ # If not installed simply not available
8
+ end
9
+
10
+ module Origen
11
+ # Methods available to the command line in a console session, split this to a
12
+ # separate file if it gets large over time
13
+ module ConsoleMethods
14
+ def j750
15
+ @_j750 ||= Origen::Tester::J750.new
16
+ @_j750.parser
17
+ end
18
+ end
19
+
20
+ # App options are options that the application can supply to extend this command
21
+ app_options = @application_options || []
22
+ options = {}
23
+ opt_parser = OptionParser.new do |opts|
24
+ opts.banner = <<-END
25
+ Start an interactive console session with your target.
26
+ Usage: origen i [options]
27
+ END
28
+ opts.on('-e', '--environment NAME', String, 'Override the default environment, NAME can be a full path or a fragment of an environment file name') { |e| options[:environment] = e }
29
+ opts.on('-t', '--target NAME', String, 'Override the default target, NAME can be a full path or a fragment of a target file name') { |t| options[:target] = t }
30
+ opts.on('-pl', '--plugin PLUGIN_NAME', String, 'Set current plugin') { |pl_n| options[:current_plugin] = pl_n }
31
+ opts.on('-p', '--pry', 'Use Pry for the session (instead of IRB)') { options[:pry] = true }
32
+ opts.on('-d', '--debugger', 'Enable the debugger') { options[:debugger] = true }
33
+ opts.on('-m', '--mode MODE', Origen::Mode::MODES, 'Force the Origen operating mode:', ' ' + Origen::Mode::MODES.join(', ')) { |_m| }
34
+ app_options.each do |app_option|
35
+ opts.on(*app_option) {}
36
+ end
37
+ opts.separator ''
38
+ opts.on('-h', '--help', 'Show this message') { puts opts; exit }
39
+ end
40
+ opt_parser.parse! ARGV
41
+
42
+ Origen.load_application
43
+ Origen.current_plugin.temporary = options[:current_plugin] if options[:current_plugin]
44
+ Origen.environment.temporary = options[:environment] if options[:environment]
45
+ Origen.target.temporary = options[:target] if options[:target]
46
+ Origen.app.load_console
47
+ Origen.app.runner.prepare_directories # Ensure tmp et all exist
48
+
49
+ if defined?(Pry) && options[:pry]
50
+ include ConsoleMethods
51
+ else
52
+ IRB::ExtendCommandBundle.send :include, Origen::ConsoleMethods
53
+ IRB.start
54
+ exit 0
55
+ end
56
+ # rubocop:disable Debugger, EmptyLines
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+ binding.pry
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+ # rubocop:enable Debugger, EmptyLines
73
+ end
@@ -0,0 +1,82 @@
1
+ options = {}
2
+
3
+ # App options are options that the application can supply to extend this command
4
+ app_options = @application_options || []
5
+ opt_parser = OptionParser.new do |opts|
6
+ opts.banner = <<-END
7
+ Run Ruby lint and style checks on your application code.
8
+
9
+ Usage: origen lint [space separated files, or directories] [options]
10
+
11
+ All options and the default files to test can be overridden via the
12
+ lint_test application configuration parameter, see here for more info:
13
+
14
+ http://origen.freescale.net/origen/latest/guides/utilities/lint/
15
+
16
+ END
17
+ opts.on('-c', '--correct', 'Correct errors automatically where possible') { options[:correct] = true }
18
+ opts.on('-n', '--no-correct', "Don't correct errors automatically (override if the app default is set to auto correct)") { options[:no_correct] = true }
19
+ opts.on('-e', '--easy', 'Be less strict, most checks run with this flag enabled can be corrected automatically') { options[:easy] = true }
20
+ opts.on('-m', '--mode MODE', Origen::Mode::MODES, 'Force the Origen operating mode:', ' ' + Origen::Mode::MODES.join(', ')) { |_m| }
21
+ opts.on('-d', '--debugger', 'Enable the debugger') { options[:debugger] = true }
22
+ app_options.each do |app_option|
23
+ opts.on(*app_option) {}
24
+ end
25
+ opts.separator ''
26
+ opts.on('-h', '--help', 'Show this message') { puts opts; exit }
27
+ end
28
+
29
+ opt_parser.parse! ARGV
30
+ if ARGV.empty?
31
+ if Origen.config.lint_test[:files]
32
+ files = Origen.config.lint_test[:files].map { |f| "#{Origen.root}/#{f}" }.join(' ')
33
+ else
34
+ files = "#{Origen.root}/lib"
35
+ end
36
+ else
37
+ files = ARGV.join(' ')
38
+ end
39
+
40
+ if options[:easy] || Origen.config.lint_test[:level] == :easy
41
+ config = "#{Origen.top}/config/rubocop/easy.yml"
42
+ else
43
+ config = "#{Origen.top}/config/rubocop/strict.yml"
44
+ end
45
+
46
+ command = "rubocop #{files} --config #{config} --display-cop-names"
47
+
48
+ unless options[:no_correct]
49
+ if options[:correct] || Origen.config.lint_test[:auto_correct]
50
+ command += ' --auto-correct'
51
+ end
52
+ end
53
+
54
+ if Origen.debugger_enabled?
55
+ command += ' --debug'
56
+ end
57
+
58
+ puts command
59
+ result = system(command)
60
+
61
+ if result == true
62
+ exit 0
63
+ elsif result == false
64
+ exit 1
65
+ else
66
+ begin
67
+ if gem 'rubocop'
68
+ if Origen.running_on_linux? && !File.exist?("#{Origen.top}/.bin/rubocop")
69
+ puts ''
70
+ puts 'It looks like you need to update your toolset to fix the above error, try running these commands before trying again:'
71
+ puts ''
72
+ puts " pushd #{Origen.top}"
73
+ puts ' source source_setup update'
74
+ puts ' popd'
75
+ puts ''
76
+ end
77
+ end
78
+ rescue Gem::LoadError
79
+ require_gem 'rubocop', version: '0.20.1'
80
+ end
81
+ exit 1
82
+ end
@@ -0,0 +1,93 @@
1
+ require 'optparse'
2
+
3
+ options = {}
4
+
5
+ def require_type_or_id(options)
6
+ unless options[:id] || options[:type]
7
+ puts 'You must supply a job type or ID'
8
+ exit 1
9
+ end
10
+ end
11
+
12
+ # Provides the hook to launch a monitored system command
13
+ # on a remote machine. This is intended to be used internally and
14
+ # is not part of the public API.
15
+ if ARGV.delete('--execute')
16
+ ix = ARGV.index('--id')
17
+ if ix
18
+ ARGV.delete_at(ix)
19
+ id = ARGV[ix]
20
+ ARGV.delete_at(ix)
21
+ else
22
+ puts 'You must supply a job ID to execute'
23
+ exit 1
24
+ end
25
+ ix = ARGV.index('--dependents')
26
+ if ix
27
+ ARGV.delete_at(ix)
28
+ dependents = ARGV[ix].split(',')
29
+ ARGV.delete_at(ix)
30
+ else
31
+ dependents = nil
32
+ end
33
+ Origen.app.lsf_manager.execute_remotely(cmd: ARGV, id: id, dependents: dependents)
34
+ exit 0
35
+ end
36
+
37
+ # App options are options that the application can supply to extend this command
38
+ app_options = @application_options || []
39
+ opt_parser = OptionParser.new do |opts|
40
+ opts.banner = <<-EOT
41
+ Manage job submissions to the LSF, with no options will display the current
42
+ status summary of all tracked jobs.
43
+
44
+ Usage: origen lsf [options]
45
+ EOT
46
+ opts.on('-v', '--verbose', 'Show job details') { options[:verbose] = true }
47
+ opts.on('-r', '--resubmit', 'Re-submit jobs') { options[:resubmit] = true }
48
+ opts.on('-c', '--clear', 'Clear jobs') { options[:clear] = true }
49
+ opts.on('-l', '--log', 'Build a log file from the completed jobs') { options[:log] = true }
50
+ # opts.on("-k", "--kill", "Kill jobs") { options[:kill] = true }
51
+ types = [:queuing, :running, :lost, :passed, :failed, :all]
52
+ opts.on('-t', '--type TYPE', types, 'Job type to apply the requested action to:', ' ' + types.join(', ')) { |t| options[:type] = t.to_sym }
53
+ opts.on('-i', '--id ID', String, 'Job ID to apply the requested action to') { |t| options[:id] = t }
54
+ opts.on('-w', '--wait', 'Wait for LSF processing to complete') { options[:wait_for_lsf_completion] = true }
55
+ # opts.on("-e", "--execute", "Execute....") { options[:execute] = true }
56
+ opts.on('-m', '--mode MODE', Origen::Mode::MODES, 'Force the Origen operating mode:', ' ' + Origen::Mode::MODES.join(', ')) { |_m| }
57
+ opts.on('-d', '--debugger', 'Enable the debugger') { options[:debugger] = true }
58
+ app_options.each do |app_option|
59
+ opts.on(*app_option) {}
60
+ end
61
+ opts.separator ''
62
+ opts.on('-h', '--help', 'Show this message') { puts opts; exit }
63
+ end
64
+
65
+ opt_parser.parse! ARGV
66
+
67
+ if options[:clear] || options[:kill] || options[:resubmit]
68
+ require_type_or_id(options)
69
+ end
70
+
71
+ Origen.load_application
72
+ Origen.app.lsf_manager.classify_jobs
73
+ if options[:clear]
74
+ Origen.app.lsf_manager.clear(options)
75
+ Origen.app.lsf_manager.classify_jobs
76
+ end
77
+ if options[:resubmit]
78
+ Origen.app.lsf_manager.resubmit(options)
79
+ Origen.app.lsf_manager.classify_jobs
80
+ end
81
+ # if options[:kill]
82
+ # Origen.app.lsf_manager.kill(options)
83
+ # Origen.app.lsf_manager.classify_jobs
84
+ # end
85
+ if options[:log]
86
+ Origen.app.lsf_manager.build_log(options)
87
+ else
88
+ Origen.app.lsf_manager.print_status(options)
89
+ end
90
+
91
+ Origen.lsf.wait_for_completion if options[:wait_for_lsf_completion]
92
+
93
+ exit 0
@@ -0,0 +1,55 @@
1
+ require 'optparse'
2
+
3
+ options = {}
4
+ Origen.log.deprecate <<-END
5
+
6
+ ********************************************************************************************
7
+ The 'merge' command has now been deprecated as the same functionality can be achieved by
8
+ performing the following tasks:
9
+
10
+ origen compile [COMPILE DIRECTORY/FILE] -r [DIRECTORY/FILE FOR COMPARISON]
11
+
12
+ By using the -r switch, it overrides the default reference directory which origen uses,
13
+ therefore essentially allowing origen to diff between your output directory and any directory
14
+ of your choice (for example ASCII UTIL export directory)
15
+ *********************************************************************************************
16
+ END
17
+ # App options are options that the application can supply to extend this command
18
+ app_options = @application_options || []
19
+ opt_parser = OptionParser.new do |opts|
20
+ opts.banner = <<-EOT
21
+ The reverse of 'origen compile' to help merge any changes made to compiled files back to the source.
22
+ The arguments are the same as the compile command, so run the merge with the same arguments and it will merge instead of compile.
23
+ Changes are processed as follows:
24
+ * Any files with a non-erb source are simply copied back if they have changes.
25
+ * Any files that don't have a source copy are ignored.
26
+ * Any differences in files with an ERB source are left to the user to resolve. Origen tries to help by giving you the
27
+ commands to execute to show the differences and the files that must be edited.
28
+
29
+ Usage: origen merge [space separated files, lists or directories] [options]
30
+ EOT
31
+ opts.on('-t', '--target NAME', String, 'Override the default target, NAME can be a full path or a fragment of a target file name') { |t| options[:target] = t }
32
+ opts.on('-c', '--continue', 'Continue on error (to the next file)') { options[:continue] = true }
33
+ opts.on('-m', '--mode MODE', Origen::Mode::MODES, 'Force the Origen operating mode:', ' ' + Origen::Mode::MODES.join(', ')) { |_m| }
34
+ opts.on('-d', '--debugger', 'Enable the debugger') { options[:debugger] = true }
35
+ opts.on('-f', '--file FILE', String, 'Override the default log file') { |o| options[:log_file] = o }
36
+ opts.on('-o', '--output DIR', String, 'Override the default output directory') { |o| options[:output] = o }
37
+ opts.on('-r', '--reference DIR', String, 'Override the default reference directory') { |o| options[:reference] = o }
38
+ app_options.each do |app_option|
39
+ opts.on(*app_option) {}
40
+ end
41
+ opts.separator ''
42
+ opts.on('-h', '--help', 'Show this message') { puts opts; exit 0 }
43
+ end
44
+
45
+ opt_parser.parse! ARGV
46
+ options[:patterns] = ARGV
47
+ options[:job_type] = :merge # To let the generator know a merge job has been requested
48
+
49
+ Origen.load_application
50
+ Origen.target.temporary = options[:target] if options[:target]
51
+ Origen.app.load_target!
52
+
53
+ Origen.app.runner.generate(options)
54
+
55
+ exit 0
@@ -0,0 +1,12 @@
1
+ module Origen
2
+ Origen.load_application
3
+ if Origen.app.cm.modified_objects_in_workspace?
4
+ puts 'Your workspace has the following modifications:'
5
+ Origen.app.cm.modified_objects_in_workspace_list.each do |file|
6
+ puts ' ' + Origen.app.cm.diff_cmd + ' ' + file
7
+ end
8
+ else
9
+ puts 'Your workspace is clean!'
10
+ end
11
+ exit 0
12
+ end
@@ -0,0 +1,113 @@
1
+ require 'optparse'
2
+ require 'fileutils'
3
+ require 'httparty'
4
+ require 'digest'
5
+
6
+ include Origen::Utility::InputCapture
7
+
8
+ options = {}
9
+
10
+ opt_parser = OptionParser.new do |opts|
11
+ opts.banner = <<-END
12
+ Generate a new Origen application.
13
+
14
+ This runs the Origen App Generators plugin to generate the new application, this provides many
15
+ engineering domain specific application shells as well as a generic application shell.
16
+
17
+ By default this will always run the latest and greatest production release of the application
18
+ generators regardless of the base Origen version that this command is being launched from.
19
+
20
+ See the website for more details:
21
+
22
+ http://origen.freescale.net/origen_app_generators
23
+
24
+ Usage: origen new [APP_NAME] [options]
25
+ END
26
+ opts.on('-d', '--debugger', 'Enable the debugger') { options[:debugger] = true }
27
+ opts.on('-v', '--version TAG', String, 'Use a specific version of Origen App Generators') { |f| options[:version] = f }
28
+ opts.separator ''
29
+ opts.on('-h', '--help', 'Show this message') { puts opts; exit }
30
+ end
31
+
32
+ opt_parser.orig_parse! ARGV
33
+ options[:patterns] = ARGV
34
+
35
+ dir = ARGV.first
36
+
37
+ unless dir
38
+ puts 'You must supply a path to the workspace you wish to create'
39
+ exit 1
40
+ end
41
+
42
+ unless Dir["#{dir}/*"].empty?
43
+ puts 'The requested workspace is not empty, please delete it and try again, or select a different path.'
44
+ exit 1
45
+ end
46
+
47
+ version = options[:version] || begin
48
+ plugin = Origen.client.plugin(:origen_app_generators)
49
+ plugin[:latest_version_prod]
50
+ end
51
+
52
+ version ||= '0.0.0'
53
+
54
+ version.sub!(/^v/, '')
55
+
56
+ if Origen.running_on_windows?
57
+ tmp = 'C:/tmp/origen_app_generators'
58
+ else
59
+ tmp = '/tmp/origen_app_generators'
60
+ end
61
+
62
+ dir = "#{tmp}/app_gen#{version}"
63
+ lib = "#{dir}/lib"
64
+ md5 = "#{tmp}/md5#{version}"
65
+
66
+ # If the app generators already exists in /tmp, check that all files are still there.
67
+ # This deals with the problem of some files being swept up by the tmp cleaner while
68
+ # leaving the top-level folder there.
69
+ if File.exist?(dir) && File.exist?(md5)
70
+ old_sig = File.read(md5)
71
+ hash = Digest::MD5.new
72
+ Dir["#{dir}/**/*"].each do |f|
73
+ hash << File.read(f) unless File.directory?(f)
74
+ end
75
+ new_sig = hash.hexdigest
76
+ all_present = old_sig == new_sig
77
+ else
78
+ all_present = false
79
+ end
80
+
81
+ unless all_present
82
+
83
+ FileUtils.rm_rf(dir) if File.exist?(dir)
84
+ FileUtils.mkdir_p(tmp) unless File.exist?(tmp)
85
+
86
+ File.open("#{tmp}/app_gen#{version}.gem", 'wb') do |f|
87
+ response = HTTParty.get("http://origen-hub.am.freescale.net:9292/gems/origen_app_generators-#{version}.gem")
88
+ if response.success?
89
+ f.write response.parsed_response
90
+ else
91
+ puts "Sorry, could not find app generators version #{version}"
92
+ exit 1
93
+ end
94
+ end
95
+
96
+ Dir.chdir tmp do
97
+ `gem unpack app_gen#{version}.gem`
98
+ `rm -f app_gen#{version}.gem`
99
+ end
100
+
101
+ hash = Digest::MD5.new
102
+ Dir["#{dir}/**/*"].each do |f|
103
+ hash << File.read(f) unless File.directory?(f)
104
+ end
105
+ File.open(md5, 'w') { |f| f.write(hash.hexdigest) }
106
+ end
107
+
108
+ $LOAD_PATH.unshift(lib)
109
+
110
+ Origen.with_boot_environment do
111
+ require 'origen_app_generators'
112
+ OrigenAppGenerators.invoke(dir)
113
+ end