origen 0.2.6 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (158) hide show
  1. checksums.yaml +4 -4
  2. data/bin/origen +3 -1
  3. data/config/boot.rb +1 -7
  4. data/config/commands.rb +0 -1
  5. data/config/version.rb +2 -2
  6. data/lib/c99/{j750_interface.rb → ate_interface.rb} +3 -11
  7. data/lib/c99/doc_interface.rb +1 -1
  8. data/lib/origen.rb +9 -30
  9. data/lib/origen/application.rb +10 -8
  10. data/lib/origen/application/configuration.rb +13 -26
  11. data/lib/origen/application/plugins.rb +122 -0
  12. data/lib/origen/application/plugins_manager.rb +16 -254
  13. data/lib/origen/application/release.rb +2 -2
  14. data/lib/origen/application/runner.rb +2 -4
  15. data/lib/origen/chips.rb +0 -0
  16. data/lib/origen/chips/chip.rb +0 -0
  17. data/lib/origen/chips/design_entry.rb +0 -0
  18. data/lib/origen/chips/doc_entry.rb +0 -0
  19. data/lib/origen/chips/note.rb +0 -0
  20. data/lib/origen/commands.rb +4 -44
  21. data/lib/origen/commands/compile.rb +1 -2
  22. data/lib/origen/commands/generate.rb +1 -1
  23. data/lib/origen/commands/interactive.rb +1 -2
  24. data/lib/origen/commands/plugin.rb +49 -56
  25. data/lib/origen/commands/program.rb +1 -1
  26. data/lib/origen/commands/rc.rb +2 -2
  27. data/lib/origen/commands/version.rb +2 -17
  28. data/lib/origen/commands_global.rb +3 -0
  29. data/lib/origen/file_handler.rb +10 -10
  30. data/lib/origen/generator.rb +1 -1
  31. data/lib/origen/generator/job.rb +1 -1
  32. data/lib/origen/generator/pattern.rb +2 -2
  33. data/lib/origen/generator/pattern_finder.rb +10 -9
  34. data/lib/origen/pins/pin.rb +0 -0
  35. data/lib/origen/regression_manager.rb +0 -0
  36. data/lib/origen/remote_manager.rb +2 -8
  37. data/lib/origen/revision_control/design_sync.rb +0 -0
  38. data/lib/origen/revision_control/git.rb +0 -0
  39. data/lib/origen/specs.rb +0 -0
  40. data/lib/origen/specs/checkers.rb +0 -0
  41. data/lib/origen/specs/creation_info.rb +0 -0
  42. data/lib/origen/specs/exhibit.rb +0 -0
  43. data/lib/origen/specs/spec.rb +0 -0
  44. data/lib/origen/utility.rb +0 -1
  45. data/lib/origen/utility/diff.rb +0 -0
  46. metadata +42 -119
  47. data/lib/origen/import_manager.rb +0 -596
  48. data/lib/origen/nvm.rb +0 -6
  49. data/lib/origen/nvm/block_array.rb +0 -72
  50. data/lib/origen/tester.rb +0 -56
  51. data/lib/origen/tester/api.rb +0 -277
  52. data/lib/origen/tester/bdm/bdm.rb +0 -25
  53. data/lib/origen/tester/doc/doc.rb +0 -226
  54. data/lib/origen/tester/doc/generator.rb +0 -126
  55. data/lib/origen/tester/doc/generator/flow.rb +0 -71
  56. data/lib/origen/tester/doc/generator/flow_line.rb +0 -203
  57. data/lib/origen/tester/doc/generator/test.rb +0 -68
  58. data/lib/origen/tester/doc/generator/test_group.rb +0 -66
  59. data/lib/origen/tester/doc/generator/tests.rb +0 -47
  60. data/lib/origen/tester/doc/model.rb +0 -162
  61. data/lib/origen/tester/generator.rb +0 -271
  62. data/lib/origen/tester/generator/flow_control_api.rb +0 -606
  63. data/lib/origen/tester/generator/identity_map.rb +0 -25
  64. data/lib/origen/tester/generator/placeholder.rb +0 -13
  65. data/lib/origen/tester/generator/test_numberer.rb +0 -25
  66. data/lib/origen/tester/interface.rb +0 -154
  67. data/lib/origen/tester/j750/files.rb +0 -45
  68. data/lib/origen/tester/j750/generator.rb +0 -203
  69. data/lib/origen/tester/j750/generator/flow.rb +0 -123
  70. data/lib/origen/tester/j750/generator/flow_line.rb +0 -288
  71. data/lib/origen/tester/j750/generator/patgroup.rb +0 -111
  72. data/lib/origen/tester/j750/generator/patgroups.rb +0 -41
  73. data/lib/origen/tester/j750/generator/patset.rb +0 -111
  74. data/lib/origen/tester/j750/generator/patsets.rb +0 -41
  75. data/lib/origen/tester/j750/generator/templates/flow.txt.erb +0 -9
  76. data/lib/origen/tester/j750/generator/templates/instances.txt.erb +0 -16
  77. data/lib/origen/tester/j750/generator/templates/patgroups.txt.erb +0 -8
  78. data/lib/origen/tester/j750/generator/templates/patsets.txt.erb +0 -10
  79. data/lib/origen/tester/j750/generator/test_instance.rb +0 -846
  80. data/lib/origen/tester/j750/generator/test_instance_group.rb +0 -60
  81. data/lib/origen/tester/j750/generator/test_instances.rb +0 -182
  82. data/lib/origen/tester/j750/j750.rb +0 -845
  83. data/lib/origen/tester/j750/j750_hpt.rb +0 -35
  84. data/lib/origen/tester/j750/parser.rb +0 -104
  85. data/lib/origen/tester/j750/parser/ac_spec.rb +0 -11
  86. data/lib/origen/tester/j750/parser/ac_specs.rb +0 -0
  87. data/lib/origen/tester/j750/parser/dc_spec.rb +0 -36
  88. data/lib/origen/tester/j750/parser/dc_specs.rb +0 -50
  89. data/lib/origen/tester/j750/parser/descriptions.rb +0 -340
  90. data/lib/origen/tester/j750/parser/flow.rb +0 -111
  91. data/lib/origen/tester/j750/parser/flow_line.rb +0 -207
  92. data/lib/origen/tester/j750/parser/flows.rb +0 -23
  93. data/lib/origen/tester/j750/parser/pattern_set.rb +0 -94
  94. data/lib/origen/tester/j750/parser/pattern_sets.rb +0 -33
  95. data/lib/origen/tester/j750/parser/test_instance.rb +0 -322
  96. data/lib/origen/tester/j750/parser/test_instances.rb +0 -26
  97. data/lib/origen/tester/j750/parser/timeset.rb +0 -15
  98. data/lib/origen/tester/j750/parser/timesets.rb +0 -0
  99. data/lib/origen/tester/jlink/jlink.rb +0 -33
  100. data/lib/origen/tester/parser.rb +0 -24
  101. data/lib/origen/tester/parser/description_lookup.rb +0 -64
  102. data/lib/origen/tester/parser/searchable_array.rb +0 -32
  103. data/lib/origen/tester/parser/searchable_hash.rb +0 -32
  104. data/lib/origen/tester/time.rb +0 -338
  105. data/lib/origen/tester/timing.rb +0 -253
  106. data/lib/origen/tester/ultraflex/files.rb +0 -45
  107. data/lib/origen/tester/ultraflex/generator.rb +0 -200
  108. data/lib/origen/tester/ultraflex/generator/flow.rb +0 -119
  109. data/lib/origen/tester/ultraflex/generator/flow_line.rb +0 -269
  110. data/lib/origen/tester/ultraflex/generator/patgroup.rb +0 -111
  111. data/lib/origen/tester/ultraflex/generator/patgroups.rb +0 -41
  112. data/lib/origen/tester/ultraflex/generator/patset.rb +0 -111
  113. data/lib/origen/tester/ultraflex/generator/patsets.rb +0 -41
  114. data/lib/origen/tester/ultraflex/generator/templates/flow.txt.erb +0 -9
  115. data/lib/origen/tester/ultraflex/generator/templates/instances.txt.erb +0 -16
  116. data/lib/origen/tester/ultraflex/generator/templates/patgroups.txt.erb +0 -8
  117. data/lib/origen/tester/ultraflex/generator/templates/patsets.txt.erb +0 -10
  118. data/lib/origen/tester/ultraflex/generator/test_instance.rb +0 -622
  119. data/lib/origen/tester/ultraflex/generator/test_instance_group.rb +0 -60
  120. data/lib/origen/tester/ultraflex/generator/test_instances.rb +0 -174
  121. data/lib/origen/tester/ultraflex/parser.rb +0 -104
  122. data/lib/origen/tester/ultraflex/parser/ac_spec.rb +0 -11
  123. data/lib/origen/tester/ultraflex/parser/ac_specs.rb +0 -0
  124. data/lib/origen/tester/ultraflex/parser/dc_spec.rb +0 -36
  125. data/lib/origen/tester/ultraflex/parser/dc_specs.rb +0 -50
  126. data/lib/origen/tester/ultraflex/parser/descriptions.rb +0 -342
  127. data/lib/origen/tester/ultraflex/parser/flow.rb +0 -111
  128. data/lib/origen/tester/ultraflex/parser/flow_line.rb +0 -207
  129. data/lib/origen/tester/ultraflex/parser/flows.rb +0 -23
  130. data/lib/origen/tester/ultraflex/parser/pattern_set.rb +0 -94
  131. data/lib/origen/tester/ultraflex/parser/pattern_sets.rb +0 -33
  132. data/lib/origen/tester/ultraflex/parser/test_instance.rb +0 -262
  133. data/lib/origen/tester/ultraflex/parser/test_instances.rb +0 -26
  134. data/lib/origen/tester/ultraflex/parser/timeset.rb +0 -15
  135. data/lib/origen/tester/ultraflex/parser/timesets.rb +0 -0
  136. data/lib/origen/tester/ultraflex/ultraflex.rb +0 -759
  137. data/lib/origen/tester/v93k/generator.rb +0 -80
  138. data/lib/origen/tester/v93k/generator/flow.rb +0 -63
  139. data/lib/origen/tester/v93k/generator/flow_node.rb +0 -17
  140. data/lib/origen/tester/v93k/generator/flow_node/print.rb +0 -10
  141. data/lib/origen/tester/v93k/generator/pattern.rb +0 -16
  142. data/lib/origen/tester/v93k/generator/pattern_master.rb +0 -54
  143. data/lib/origen/tester/v93k/generator/templates/_test_method.txt.erb +0 -6
  144. data/lib/origen/tester/v93k/generator/templates/_test_suite.txt.erb +0 -11
  145. data/lib/origen/tester/v93k/generator/templates/template.flow.erb +0 -121
  146. data/lib/origen/tester/v93k/generator/templates/template.pmfl.erb +0 -9
  147. data/lib/origen/tester/v93k/generator/test_function.rb +0 -103
  148. data/lib/origen/tester/v93k/generator/test_functions.rb +0 -79
  149. data/lib/origen/tester/v93k/generator/test_method.rb +0 -46
  150. data/lib/origen/tester/v93k/generator/test_methods.rb +0 -75
  151. data/lib/origen/tester/v93k/generator/test_suite.rb +0 -54
  152. data/lib/origen/tester/v93k/generator/test_suites.rb +0 -65
  153. data/lib/origen/tester/v93k/v93k.rb +0 -420
  154. data/lib/origen/tester/vector.rb +0 -86
  155. data/lib/origen/tester/vector_generator.rb +0 -637
  156. data/lib/origen/tester/vector_pipeline.rb +0 -150
  157. data/lib/origen/utility/design_sync.rb +0 -494
  158. data/lib/origen/version_checker.rb +0 -117
@@ -1,279 +1,41 @@
1
1
  module Origen
2
2
  class Application
3
+ # This module is deprecated and is replaced by Origen::Application::Plugins
3
4
  class PluginsManager
4
- # Returns the temporary plugin instance if set, otherwise nil
5
- attr_reader :temporary
6
-
7
- # Returns the current plugin instance, this will be the temporary plugin if set, if
8
- # not then the current default plugin if set, otherwise nil
9
- def current
10
- if @disabled || @set_to_nil
11
- nil
12
- else
13
- temporary || default
14
- end
15
- end
16
- alias_method :instance, :current
17
- alias_method :current_plugin_instance, :current
18
-
19
- def disable
20
- @disabled = true
21
- end
22
-
23
- def enable
24
- @disabled = false
25
- end
5
+ # ***********************************************************************
6
+ # ***********************************************************************
7
+ # Don't add anything new here, use origen/application/plugins.rb instead
8
+ # ***********************************************************************
9
+ # ***********************************************************************
26
10
 
27
11
  # Returns the current plugin name, equivalent to calling current.name
28
12
  def name
29
- current ? current.name : nil
13
+ Origen.deprecated 'Origen.current_plugin.name is deprecated, use Origen.app.plugins.name instead'
14
+ if Origen.app.plugins.current
15
+ Origen.app.plugins.current.name
16
+ end
30
17
  end
31
18
 
32
19
  # Sets the given plugin as the temporary current plugin, this will last until
33
20
  # changed or the end of the current Origen thread
34
21
  def temporary=(plugin_name)
35
- if !plugin_name || plugin_name.to_sym == :none
36
- @set_to_nil = true
37
- @temporary = nil
38
- else
39
- @set_to_nil = false
40
- @temporary = find_plugin!(plugin_name)
41
- end
22
+ Origen.deprecated 'Origen.current_plugin.temporary= is deprecated, use Origen.app.plugins.temporary= instead'
23
+ Origen.app.plugins.temporary = plugin_name
42
24
  end
43
25
 
44
26
  # Same as temporary= except it will be remembered in the next Origen thread.
45
27
  # Setting this will also clear any temporary assignment that is currently in
46
28
  # effect.
47
29
  def default=(plugin_name)
48
- self.temporary = nil
49
- if !plugin_name || plugin_name.to_sym == :none
50
- @default = nil
51
- else
52
- @default = find_plugin!(plugin_name)
53
- Origen.app.session.origen_core[:default_plugin] = @default.name
54
- @default
55
- end
30
+ Origen.deprecated 'Origen.current_plugin.default= is deprecated, use Origen.app.plugins.current= instead'
31
+ Origen.app.plugins.current = plugin_name
56
32
  end
57
33
 
58
34
  # Returns the current plugin instance currently set as the default plugin,
59
35
  # otherwise nil
60
36
  def default
61
- return @default if @default
62
- if name = Origen.app.session.origen_core[:default_plugin]
63
- begin
64
- @default = find_plugin!(name)
65
- rescue
66
- # Hit here if what has been set to the default plugin has since been
67
- # removed from the application
68
- self.default = :none
69
- nil
70
- end
71
- end
72
- end
73
-
74
- # Checks the given plugin name with the list of installed plugins
75
- # and returns true if found else returns false
76
- def valid_plugin_name?(plugin_name)
77
- Origen.import_manager.names.include?(plugin_name)
78
- end
79
-
80
- # Lists all the plugins available on server
81
- def list
82
- puts 'The following plugins are available to add to your application:'
83
- puts ''
84
- Origen.client.plugins.group_by { |p| p[:category] }.sort_by { |k, _v| k }.each do |category, plugins|
85
- puts category.upcase
86
- puts '=' * category.length
87
- plugins.sort_by { |p| p[:name] }.each do |plugin|
88
- line = "#{plugin[:origen_name]}".ljust(25) + plugin[:name].strip.ljust(30)
89
- if plugin[:latest_version_prod] || plugin[:latest_version_dev]
90
- line += [plugin[:latest_version_prod] || plugin[:latest_version_dev]].compact.join(', ')
91
- end
92
- puts line
93
- end
94
- puts ''
95
- end
96
- end
97
-
98
- # Updates the plugin to the supplied version
99
- def update(plugin_name, version)
100
- if plugin_name.class != Symbol
101
- plugin_name = plugin_name.to_sym
102
- end
103
- if valid_plugin_name?(plugin_name)
104
- update_config_file!(version: version,
105
- plugin_name: plugin_name,
106
- action: :update)
107
- else
108
- puts "Plugin #{plugin_name} not found in this app!"
109
- end
110
- end
111
-
112
- # Adds the given plugin to the current app
113
- def add(plugin_name, version, options)
114
- if plugin_name.class != Symbol
115
- plugin_name = plugin_name.to_sym
116
- end
117
- if !valid_plugin_name?(plugin_name)
118
- plugin_data = read_plugin_info_from_server(plugin_name)
119
- update_config_file!(vault: plugin_data[:vault],
120
- version: version,
121
- plugin_name: plugin_name,
122
- action: :add,
123
- dev_import: options[:dev_import])
124
-
125
- puts 'Plugin added successfully!'
126
- else
127
- puts "Plugin #{plugin_name} is already included in this app!"
128
- end
129
- end
130
-
131
- def remove(plugin_name)
132
- if plugin_name.class != Symbol
133
- plugin_name = plugin_name.to_sym
134
- end
135
- if valid_plugin_name?(plugin_name)
136
- update_config_file!(plugin_name: plugin_name,
137
- action: :remove)
138
- if File.exist?("#{imports_dir}/#{plugin_name}")
139
- FileUtils.rm_rf("#{imports_dir}/#{plugin_name}")
140
- puts "Plugin '#{plugin_name}' removed successfully!"
141
- end
142
- else
143
- puts "Plugin #{plugin_name} not found in this app!"
144
- end
145
- end
146
-
147
- # Lists out the currently added plugins within the app on console
148
- def list_added_plugins
149
- puts 'The following plugins are included in this app:'
150
- format = "%30s\t%30s\t%30s\n"
151
- printf(format, 'Origen_Name', 'Name', 'Version')
152
- printf(format, '---------', '----', '-------')
153
-
154
- Origen.plugins.sort_by { |p| p.name.to_s }.each do |plugin|
155
- printf(format, plugin.name, plugin.config.name, plugin.version)
156
- end
157
- puts ''
158
- end
159
-
160
- # Describes the plugin
161
- def describe(plugin_name)
162
- if plugin_name
163
- if plugin_name.class != Symbol
164
- plugin_name = plugin_name.to_sym
165
- end
166
- description = nil
167
- Origen.client.plugins.each do |plugin|
168
- if plugin[:origen_name].to_sym == plugin_name
169
- description = <<-EOT
170
- Origen_Name: #{plugin[:origen_name]}
171
- Actual Name: #{plugin[:name]}
172
- Category: #{plugin[:category]}
173
- Description: #{plugin[:description]}
174
- EOT
175
- break
176
- end
177
- end
178
- if description.nil?
179
- puts "Plugin #{plugin_name} not found or it does not include a description"
180
- exit 1
181
- end
182
- description
183
- else
184
- puts 'No plugin name provided'
185
- exit 1
186
- end
187
- end
188
-
189
- private
190
-
191
- def find_plugin!(name)
192
- plugin = Origen.plugins.find { |p| p.name.to_sym == name.to_sym }
193
- return plugin if plugin
194
- puts ''
195
- puts "No plugin named '#{name}' is included in this application!"
196
- puts 'The plugins currently available are:'
197
- Origen.plugins.each do |plugin|
198
- puts " #{plugin.name}"
199
- end
200
- puts ''
201
- fail 'Missing plugin error!'
202
- end
203
-
204
- def read_plugin_info_from_server(plugin_name)
205
- plugin_data = nil
206
- Origen.client.plugins.each do |plugin|
207
- if plugin[:origen_name].to_sym == plugin_name
208
- plugin_data = plugin
209
- break
210
- end
211
- end
212
-
213
- if plugin_data.nil?
214
- fail "No plugin with name #{plugin_name} found!"
215
- end
216
- plugin_data
217
- end
218
-
219
- def update_config_file!(options = {})
220
- file = "#{Origen.root}/config/application.rb"
221
- lines = File.readlines(file)
222
- if options[:action] == :add && !valid_plugin_name?(options[:plugin_name])
223
- if options[:dev_import]
224
- unless lines.find_index { |line| line =~ /config.imports_dev/ }
225
- index = lines.find_index { |line| line =~ /config.vault =/ }
226
- lines.insert(index + 1, ' config.imports_dev = [', '', ' ]')
227
- end
228
- else
229
- unless lines.find_index { |line| line =~ /config.imports\s=\s/ }
230
- index = lines.find_index { |line| line =~ /config.vault =/ }
231
- lines.insert(index + 1, ' config.imports = [', '', ' ]')
232
- end
233
- end
234
-
235
- File.open(file, 'w') do |f|
236
- lines.each do |line|
237
- f.puts line
238
- if line =~ (options[:dev_import] ? (/config.imports_dev\s=\s/) : (/config.imports\s=\s/))
239
- f.puts ' {'
240
- f.puts " :vault => \"#{options[:vault]}\","
241
- f.puts " :version => \"#{options[:version]}\","
242
- if (options[:dev_import] ? (Origen.config.imports_dev) : (Origen.config.imports)).size == 0
243
- f.puts ' }'
244
- else
245
- f.puts ' },'
246
- end
247
- end
248
- end
249
- end
250
- elsif options[:action] == :remove && valid_plugin_name?(options[:plugin_name])
251
- lines.slice!(plugin_index_range(lines, options))
252
- File.open(file, 'w') { |f| lines.each { |line| f.puts line } }
253
- elsif options[:action] == :update && valid_plugin_name?(options[:plugin_name])
254
- range = plugin_index_range(lines, options)
255
- version_index = lines[range].find_index { |line| line =~ /:version/ }
256
- version_index += range.first
257
- lines[version_index] = " :version => \"#{options[:version]}\","
258
- File.open(file, 'w') { |f| lines.each { |line| f.puts line } }
259
- end
260
- load "#{Origen.root}/config/application.rb"
261
- Origen.import_manager.required = false
262
- Origen.import_manager.require!
263
- end
264
-
265
- def plugin_index_range(file_lines, options)
266
- center = file_lines.find_index { |line| line =~ /:vault(.*)(#{options[:plugin_name]})/i }
267
- if center
268
- first = file_lines[0..center].length - 1 - file_lines[0..center].rindex.find_index { |line| line =~ /^(\s*)({)(\s*)$/ }
269
- last = file_lines[center..(file_lines.size - 1)].find_index { |line| line =~ /^\s*}(,?)\s*$/ }
270
- last = center + last
271
- first..last
272
- end
273
- end
274
-
275
- def imports_dir
276
- Origen.application.workspace_manager.imports_directory
37
+ Origen.deprecated 'Origen.current_plugin.default is deprecated, use Origen.app.plugins.current instead'
38
+ Origen.app.plugins.current
277
39
  end
278
40
  end
279
41
  end
@@ -26,10 +26,10 @@ module Origen
26
26
  # Release a new application version
27
27
  def run(options)
28
28
  # Don't want plugin callbacks kicking in during the release process
29
- Origen.current_plugin.disable
29
+ Origen.app.plugins.disable_current
30
30
  @options = options
31
31
  if authorized?
32
- Origen.import_manager.validate_production_status(true)
32
+ Origen.app.plugins.validate_production_status(true)
33
33
  unless Origen.app.rc.local_modifications.empty?
34
34
  puts <<-EOT
35
35
  Your workspace has local modifications that are preventing the requested action
@@ -69,7 +69,7 @@ module Origen
69
69
  temporary_plugin_from_options = options[:current_plugin]
70
70
  expand_lists_and_directories(options[:files], options).each do |file|
71
71
  if temporary_plugin_from_options
72
- Origen.current_plugin.temporary = temporary_plugin_from_options
72
+ Origen.app.plugins.temporary = temporary_plugin_from_options
73
73
  end
74
74
  case options[:action]
75
75
  when :compile
@@ -83,9 +83,7 @@ module Origen
83
83
  else
84
84
  Origen.generator.generate_pattern(file, options)
85
85
  end
86
- if temporary_plugin_from_options
87
- Origen.current_plugin.default
88
- end
86
+ Origen.app.plugins.temporary = nil if temporary_plugin_from_options
89
87
  end
90
88
  end
91
89
  end
data/lib/origen/chips.rb CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -192,7 +192,7 @@ if File.exist? "#{Origen.root}/config/commands.rb"
192
192
  end
193
193
  end
194
194
 
195
- shared_commands = Origen.import_manager.command_launcher
195
+ shared_commands = Origen.app.plugins.shared_commands
196
196
  if shared_commands && shared_commands.size != 0
197
197
  shared_commands.each do |file|
198
198
  require file
@@ -218,50 +218,10 @@ when 'generate', 'program', 'compile', 'merge', 'interactive', 'target', 'enviro
218
218
  require "origen/commands/#{@command}"
219
219
  exit 0 unless @command == 'interactive'
220
220
 
221
- when 'upgrade_app'
222
- Origen::CodeGenerators.invoke 'bundler', [], config: { type: :application }
223
- Origen::CodeGenerators.invoke 'rake', []
224
- Origen::CodeGenerators.invoke 'r_spec', ['-f']
225
- exit 0
226
-
227
- when 'upgrade_plugin'
228
- unless Origen.app.version.semantic?
229
- puts 'To upgrade to a gem your plugin must switch to semantic (1.2.3) style versioning.'
230
- puts
231
- end
232
- Origen::CodeGenerators.invoke 'semver', []
233
- Origen::CodeGenerators.invoke 'gem_setup', []
234
- Origen::CodeGenerators.invoke 'bundler', []
235
- Origen::CodeGenerators.invoke 'rake', []
236
- Origen::CodeGenerators.invoke 'r_spec', ['-f']
237
- exit 0
238
-
239
221
  when 'version'
240
- Origen.disable_origen_version_check do
241
- Origen.load_application(false)
242
- require 'origen/commands/version'
243
- end
244
-
245
- when 'serve'
246
- puts '***************************************************************'
247
- puts "'origen serve' is deprecated, please use 'origen web serve' instead"
248
- puts '***************************************************************'
249
- ARGV.unshift 'serve'
250
- load 'origen/commands/web.rb'
251
-
252
- when 'tag'
253
- puts '***************************************************************'
254
- puts "'origen tag' is deprecated, please use 'origen rc tag' instead"
255
- puts '***************************************************************'
256
- ARGV.unshift 'tag'
257
- load 'origen/commands/rc.rb'
258
-
259
- when 'modifications'
260
- puts '***************************************************************'
261
- puts "'origen mods' is deprecated, please use 'origen rc mods' instead"
262
- puts '***************************************************************'
263
- ARGV.unshift 'modifications'
264
- load 'origen/commands/rc.rb'
222
+ Origen.app # Load app
223
+ require 'origen/commands/version'
224
+ exit 0
265
225
 
266
226
  else
267
227
  if ['-h', '--help'].include?(@command)
@@ -53,8 +53,7 @@ opt_parser.parse! ARGV
53
53
  options[:patterns] = ARGV
54
54
  options[:compile] = true # To let the generator know a compile job has been requested
55
55
 
56
- Origen.load_application
57
- Origen.current_plugin.temporary = options[:current_plugin] if options[:current_plugin]
56
+ Origen.app.plugins.temporary = options[:current_plugin] if options[:current_plugin]
58
57
  Origen.environment.temporary = options[:environment] if options[:environment]
59
58
  Origen.target.temporary = options[:target] if options[:target]
60
59
  Origen.app.load_target!
@@ -52,7 +52,7 @@ if options[:project]
52
52
  end
53
53
 
54
54
  _with_doc_tester(options) do
55
- Origen.current_plugin.temporary = options[:current_plugin] if options[:current_plugin]
55
+ Origen.app.plugins.temporary = options[:current_plugin] if options[:current_plugin]
56
56
  Origen.environment.temporary = options[:environment] if options[:environment]
57
57
  Origen.target.temporary = options[:target] if options[:target]
58
58
  Origen.app.load_target! # This initial load is required to apply any configuration
@@ -47,8 +47,7 @@ Usage: origen i [options]
47
47
  end
48
48
  opt_parser.parse! ARGV
49
49
 
50
- Origen.load_application
51
- Origen.current_plugin.temporary = options[:current_plugin] if options[:current_plugin]
50
+ Origen.app.plugins.temporary = options[:current_plugin] if options[:current_plugin]
52
51
  Origen.environment.temporary = options[:environment] if options[:environment]
53
52
  Origen.target.temporary = options[:target] if options[:target]
54
53
  Origen.app.load_console
@@ -8,28 +8,20 @@ opt_parser = OptionParser.new do |opts|
8
8
  opts.banner = <<-EOT
9
9
  Usage: origen pl
10
10
  origen pl [plugin name]
11
- origen pl [CMD] [plugin name] [options]
11
+ origen pl [CMD] [options]
12
12
 
13
13
  Quickstart Examples:
14
14
  origen pl # Displays the current plugin
15
15
  origen pl added # Lists the included plugins
16
- origen pl plugin_name # Sets the specified plugin as current plugin
16
+ origen pl [plugin_name] # Sets the specified plugin as current plugin
17
17
  origen pl reset # Resets the current plugin to none
18
- origen pl describe plugin_name # Describes the specified plugin
19
- origen pl add plugin_name va.b.c.dev0 # Adds the plugin of version va.b.c.dev0
20
18
 
21
19
  The following commands are available:
22
20
 
23
- list Displays all known plugins from the server
24
21
  added Displays all plugins that are currently included in this app locally
25
- describe [plugin_name] Describes the plugin
26
- add [plugin_name] [version] Adds the specified plugin if found on server to the local app
27
- remove [plugin_name] Removes the specified plugin from this local app
28
- update [plugin_name] [version] Updates the specific plugin to the given version
29
22
 
30
23
  The following options are available:
31
24
  EOT
32
- opts.on('--dev', 'Adds the plugin to config.imports_dev rather that config.imports') { options[:dev_import] = true }
33
25
  opts.on('-d', '--debugger', 'Enable the debugger') { options[:debugger] = true }
34
26
  opts.on('-h', '--help', 'Show this message') { puts opts; exit }
35
27
  end
@@ -37,8 +29,8 @@ end
37
29
  opt_parser.parse! ARGV
38
30
 
39
31
  if !ARGV[0]
40
- if Origen.current_plugin.default
41
- puts "Current plugin is: #{Origen.current_plugin.name}"
32
+ if Origen.app.plugins.current
33
+ puts "Current plugin is: #{Origen.app.plugins.current.name}"
42
34
  else
43
35
  puts <<-EOT
44
36
  No plugin set!
@@ -50,56 +42,57 @@ To work with an included plugin, set it as current plugin using the following co
50
42
  else
51
43
  case input = ARGV.shift
52
44
  when 'reset', 'none'
53
- Origen.current_plugin.default = :none
45
+ Origen.app.plugins.current = nil
54
46
  puts 'Successfully cleared the default plugin!'
55
- when 'add'
56
- plugin_name = ARGV.shift
57
- version = ARGV.shift
58
- if plugin_name && version
59
- Origen.plugins_manager.add(plugin_name, version, options)
60
- else
61
- puts 'Zero or less arguments provided!'
62
- end
47
+ # when 'add'
48
+ # plugin_name = ARGV.shift
49
+ # version = ARGV.shift
50
+ # if plugin_name && version
51
+ # Origen.plugins_manager.add(plugin_name, version, options)
52
+ # else
53
+ # puts 'Zero or less arguments provided!'
54
+ # end
63
55
  when 'added'
64
- Origen.plugins_manager.list_added_plugins
65
- when 'list'
66
- Origen.plugins_manager.list
67
- when 'describe'
68
- puts Origen.plugins_manager.describe(ARGV.shift)
69
- when 'remove'
70
- plugin_name = ARGV.shift
71
- if plugin_name
72
- Origen.plugins_manager.remove(plugin_name)
73
- else
74
- puts 'No plugin name provided!'
75
- end
76
- when 'update'
77
- plugin_name = ARGV.shift
78
- version = ARGV.shift
79
- if plugin_name && version
80
- Origen.plugins_manager.update(plugin_name, version)
81
- else
82
- puts 'Zero or less arguments provided!'
56
+ puts 'The following plugins are included in this app:'
57
+ puts
58
+ format = "%30s\t%30s\t%30s\n"
59
+ printf(format, 'Origen_Name', 'Name', 'Version')
60
+ printf(format, '---------', '----', '-------')
61
+
62
+ Origen.app.plugins.sort_by { |p| p.name.to_s }.each do |plugin|
63
+ printf(format, plugin.name, plugin.config.name, plugin.version)
83
64
  end
65
+ puts
66
+ exit 0
67
+
68
+ # when 'list'
69
+ # Origen.plugins_manager.list
70
+ # when 'describe'
71
+ # puts Origen.plugins_manager.describe(ARGV.shift)
72
+ # when 'remove'
73
+ # plugin_name = ARGV.shift
74
+ # if plugin_name
75
+ # Origen.plugins_manager.remove(plugin_name)
76
+ # else
77
+ # puts 'No plugin name provided!'
78
+ # end
79
+ # when 'update'
80
+ # plugin_name = ARGV.shift
81
+ # version = ARGV.shift
82
+ # if plugin_name && version
83
+ # Origen.plugins_manager.update(plugin_name, version)
84
+ # else
85
+ # puts 'Zero or less arguments provided!'
86
+ # end
84
87
 
85
88
  else
86
89
 
87
- Origen.current_plugin.default = input.to_sym
88
- puts "#{Origen.current_plugin.default.name} is now set as the current plugin."
90
+ Origen.app.plugins.current = input.to_sym
91
+ if Origen.app.plugins.current
92
+ puts "#{Origen.app.plugins.current.name} is now set as the current plugin."
93
+ else
94
+ puts "#{input} is not among this application's plugins, the current plugin is currently cleared!"
95
+ end
89
96
  end
90
97
 
91
98
  end
92
-
93
- # def _workspace_plugin_command
94
- # puts 'local'
95
- # end
96
- #
97
- # def _global_plugin_command
98
- # puts 'global'
99
- # end
100
-
101
- # if Origen.in_application_directory? || Origen.in_application_subdirectory?
102
- # _workspace_plugin_command
103
- # else
104
- # _global_plugin_command
105
- # end