origen_app_generators 1.1.4 → 2.2.0

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 (65) hide show
  1. checksums.yaml +5 -5
  2. data/bin/boot.rb +4 -2
  3. data/config/commands.rb +3 -3
  4. data/config/shared_commands.rb +17 -10
  5. data/config/version.rb +3 -4
  6. data/lib/origen_app_generators.rb +6 -4
  7. data/lib/origen_app_generators/application.rb +12 -12
  8. data/lib/origen_app_generators/base.rb +53 -9
  9. data/lib/origen_app_generators/new.rb +17 -9
  10. data/lib/{tasks/new_app_tests.rake → origen_app_generators/new_app_tests.rb} +1 -5
  11. data/lib/origen_app_generators/origen_infrastructure/app_generator_plugin.rb +6 -8
  12. data/lib/origen_app_generators/plugin.rb +4 -7
  13. data/lib/origen_app_generators/test_engineering/common.rb +29 -0
  14. data/lib/origen_app_generators/test_engineering/stand_alone_application.rb +9 -181
  15. data/lib/origen_app_generators/test_engineering/test_block.rb +4 -105
  16. data/templates/app_generators/application/Gemfile +17 -5
  17. data/templates/app_generators/application/{lib → app/blocks}/top_level.rb +1 -1
  18. data/templates/app_generators/application/app/lib/module.rb +6 -0
  19. data/templates/app_generators/application/{templates → app/templates}/web/index.md.erb +0 -0
  20. data/templates/app_generators/application/{templates → app/templates}/web/layouts/_basic.html.erb +0 -0
  21. data/templates/app_generators/application/{templates → app/templates}/web/partials/_navbar.html.erb +0 -0
  22. data/templates/app_generators/application/{templates → app/templates}/web/release_notes.md.erb +0 -0
  23. data/templates/app_generators/application/config/application.rb +51 -55
  24. data/templates/app_generators/origen_infrastructure/app_generator_plugin/{lib → app/lib}/application.rb +0 -0
  25. data/templates/app_generators/origen_infrastructure/app_generator_plugin/{lib → app/lib}/base.rb +0 -0
  26. data/templates/app_generators/origen_infrastructure/app_generator_plugin/{lib → app/lib}/module.rb +0 -0
  27. data/templates/app_generators/origen_infrastructure/app_generator_plugin/{lib → app/lib}/plugin.rb +0 -0
  28. data/templates/app_generators/origen_infrastructure/app_generator_plugin/config/load_generators.rb +1 -1
  29. data/templates/app_generators/plugin/Gemfile +13 -4
  30. data/templates/app_generators/plugin/{templates → app/templates}/web/index.md.erb +0 -0
  31. data/templates/app_generators/plugin/{templates → app/templates}/web/partials/_navbar_external.html.erb +0 -0
  32. data/templates/app_generators/plugin/{templates → app/templates}/web/partials/_navbar_internal.html.erb +0 -0
  33. data/templates/app_generators/plugin/gemspec.rb +4 -3
  34. data/templates/app_generators/test_engineering/{stand_alone_application/environment → environment}/j750.rb +0 -0
  35. data/templates/app_generators/test_engineering/{stand_alone_application/environment → environment}/uflex.rb +0 -0
  36. data/templates/app_generators/test_engineering/{stand_alone_application/environment → environment}/v93k.rb +0 -0
  37. data/templates/app_generators/test_engineering/stand_alone_application/.keep +0 -0
  38. data/templates/app_generators/test_engineering/test_block/.keep +0 -0
  39. metadata +25 -48
  40. data/bin/fix_my_workspace +0 -100
  41. data/lib/origen_app_generators/sub_block_parser.rb +0 -81
  42. data/lib/tasks/app_generators.rake +0 -6
  43. data/templates/app_generators/application/lib/app.rake +0 -6
  44. data/templates/app_generators/application/lib/module.rb +0 -22
  45. data/templates/app_generators/plugin/lib/README +0 -4
  46. data/templates/app_generators/plugin/lib_dev/README +0 -5
  47. data/templates/app_generators/test_engineering/stand_alone_application/Gemfile +0 -20
  48. data/templates/app_generators/test_engineering/stand_alone_application/environment/jlink.rb +0 -1
  49. data/templates/app_generators/test_engineering/stand_alone_application/lib/ip_block.rb +0 -23
  50. data/templates/app_generators/test_engineering/stand_alone_application/lib/ip_block_controller.rb +0 -5
  51. data/templates/app_generators/test_engineering/stand_alone_application/lib/top_level.rb +0 -33
  52. data/templates/app_generators/test_engineering/stand_alone_application/lib/top_level_controller.rb +0 -21
  53. data/templates/app_generators/test_engineering/stand_alone_application/pattern/example.rb +0 -4
  54. data/templates/app_generators/test_engineering/stand_alone_application/target/top_level.rb +0 -4
  55. data/templates/app_generators/test_engineering/test_block/environment/j750.rb +0 -2
  56. data/templates/app_generators/test_engineering/test_block/environment/ultraflex.rb +0 -2
  57. data/templates/app_generators/test_engineering/test_block/environment/v93k.rb +0 -2
  58. data/templates/app_generators/test_engineering/test_block/lib/controller.rb +0 -12
  59. data/templates/app_generators/test_engineering/test_block/lib/interface.rb +0 -21
  60. data/templates/app_generators/test_engineering/test_block/lib/model.rb +0 -18
  61. data/templates/app_generators/test_engineering/test_block/lib_dev/dut.rb +0 -27
  62. data/templates/app_generators/test_engineering/test_block/lib_dev/dut_controller.rb +0 -26
  63. data/templates/app_generators/test_engineering/test_block/pattern/example.rb +0 -5
  64. data/templates/app_generators/test_engineering/test_block/program/prb1.rb +0 -11
  65. data/templates/app_generators/test_engineering/test_block/target/default.rb +0 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3eeb6b201324eb47d17666280a9d5235933d32fd
4
- data.tar.gz: 434f5ed2879e524353e286edf88843a2db290c55
2
+ SHA256:
3
+ metadata.gz: 64a1039908eba30b3a33e2da0d8696af09c414f91a7a42cea5aa90982586129b
4
+ data.tar.gz: fab5ecfe17f9cf65c765c651b8447081ad9081c5b04c60511dcfabbad200a4e8
5
5
  SHA512:
6
- metadata.gz: bf475ec0c8e8049b2e332185d384306327c3bd2d9973fb2baa915e2e5a0f8981b0829de581e9f3f1c4d46169d41c6e217983904d13dfc4d1c5a049db7093507b
7
- data.tar.gz: e570d4f5f11f014b7dd105d3dbadd0ab301e1d1406fba86a8d93f23ef2d11bfd35263e703cf901fb95f1f2d4efa73d188b3ebfdd5ef78d8171ff670f1d24c442
6
+ metadata.gz: 2f7a4bf3e601713cade91fffd45e866f4c9e66fbd0554afbf222e303d6efa9d12f65f9a9574f7f766657c8cf5dacc3e7de5bc4b910533d92be679fef07402322
7
+ data.tar.gz: 29c49bae93ea8ef4970d06f5f3bf9ed98304b8e24ada166a5136049a93609e4bf229c53bb18c40aaa2e95ab2498d71e70b15e4759525d0328d6ab6e2c4f7d9bb
@@ -30,8 +30,10 @@ begin
30
30
  OrigenAppGenerators.unload_generators unless ARGV[0]
31
31
  require load_generators if File.exist?(load_generators)
32
32
 
33
- OrigenAppGenerators.invoke('tmp')
33
+ OrigenAppGenerators.invoke('my_app')
34
34
  end
35
35
  ensure
36
- FileUtils.mv "#{tmp_dir}/tmp", 'tmp' if File.exist?("#{tmp_dir}/tmp")
36
+ FileUtils.mv "#{tmp_dir}/my_app", 'output' if File.exist?("#{tmp_dir}/my_app")
37
+ puts
38
+ puts "Ignore the above, your new app is in: output/my_app"
37
39
  end
@@ -56,8 +56,8 @@ when "specs"
56
56
  ## origen -h, you can do this be assigning the required text to @application_commands
57
57
  ## before handing control back to Origen. Un-comment the example below to get started.
58
58
  else
59
- @application_commands = <<-EOT
60
- specs Run the specs (tests), -c will enable coverage
61
- EOT
59
+ # @application_commands = <<-EOT
60
+ # specs Run the specs (tests), -c will enable coverage
61
+ # EOT
62
62
 
63
63
  end
@@ -7,9 +7,11 @@ when "app_gen:test"
7
7
  opt_parser = OptionParser.new do |opts|
8
8
  opts.banner = <<-END
9
9
  Test the generators by emulating the 'origen new' command execution and building the new
10
- application into the tmp directory.
10
+ application into the output/my_app directory.
11
11
 
12
12
  Usage: origen app_gen:test [options]
13
+ origen app_gen:test --regression # Test all generators
14
+ origen app_gen:test --inputs 0 # Test with user inputs set 0
13
15
  END
14
16
  opts.on('-d', '--debugger', 'Enable the debugger') { options[:debugger] = true }
15
17
  opts.on('-i', '--inputs INDEX', Integer, "Apply the set of test inputs defined in #{Origen.app.namespace}::TEST_INPUTS[INDEX]") { |f| options[:inputs] = f }
@@ -21,7 +23,9 @@ END
21
23
 
22
24
  opt_parser.orig_parse! ARGV
23
25
 
24
- FileUtils.rm_rf "#{Origen.root}/tmp" if File.exist?("#{Origen.root}/tmp")
26
+ output_dir = File.join(Origen.root, 'output')
27
+ FileUtils.rm_rf output_dir if File.exist?(output_dir)
28
+ FileUtils.mkdir_p output_dir
25
29
 
26
30
  if options[:inputs] || options[:regression]
27
31
  if options[:regression]
@@ -41,14 +45,16 @@ END
41
45
  post_build_operations = post_build_operations.map do |op|
42
46
  if op.to_s == 'default'
43
47
  target_load_test_required = true
44
- ['origen -v',
45
- 'origen lint --no-correct',
46
- 'bundle exec rake new_app_tests:load_target',
47
- 'origen web compile --no-serve'
48
- ]
48
+ cmds = ['origen -v']
49
+ # For some reason this command doesn't work in Travis CI, don't know why and
50
+ # couldn't work out how to fix (looks like a Bundler-related issue)
51
+ cmds << 'origen lint --no-correct' unless ENV['TRAVIS']
52
+ cmds << 'bundle exec origen exec tmp/new_app_tests.rb'
53
+ cmds << 'origen web compile --no-serve'
54
+ cmds
49
55
  elsif op.to_s == 'load_target'
50
56
  target_load_test_required = true
51
- 'rake new_app_tests:load_target'
57
+ 'origen exec tmp/new_app_tests.rb'
52
58
  else
53
59
  op
54
60
  end
@@ -67,12 +73,13 @@ END
67
73
  # The app is successfully built, now see if it works...
68
74
  unless post_build_operations.empty?
69
75
  if target_load_test_required
70
- FileUtils.cp "#{Origen.root!}/lib/tasks/new_app_tests.rake", 'tmp/lib/tasks'
76
+ FileUtils.mkdir_p('output/my_app/tmp')
77
+ FileUtils.cp "#{Origen.root!}/lib/origen_app_generators/new_app_tests.rb", 'output/my_app/tmp'
71
78
  end
72
79
 
73
80
  operation_failed = false
74
81
  Bundler.with_clean_env do
75
- Dir.chdir "#{Origen.root}/tmp" do
82
+ Dir.chdir "#{Origen.root}/output/my_app" do
76
83
  post_build_operations.each_with_index do |op, i|
77
84
  if i == 0 && !Origen.site_config.gem_manage_bundler
78
85
  system('bundle')
@@ -1,8 +1,7 @@
1
1
  module OrigenAppGenerators
2
- MAJOR = 1
3
- MINOR = 1
4
- BUGFIX = 4
2
+ MAJOR = 2
3
+ MINOR = 2
4
+ BUGFIX = 0
5
5
  DEV = nil
6
-
7
6
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
8
7
  end
@@ -7,6 +7,7 @@ require 'origen_app_generators/plugin'
7
7
  require 'origen_app_generators/empty_application'
8
8
  require 'origen_app_generators/empty_plugin'
9
9
  require 'origen_app_generators/new'
10
+ require 'origen_app_generators/test_engineering/common'
10
11
  require 'origen_app_generators/test_engineering/test_block'
11
12
  require 'origen_app_generators/test_engineering/stand_alone_application'
12
13
  require 'origen_app_generators/origen_infrastructure/app_generator_plugin'
@@ -16,15 +17,16 @@ module OrigenAppGenerators
16
17
 
17
18
  TEST_INPUTS = [
18
19
  # 0 - Empty app
19
- ['0', '0', :default, :default, :default],
20
+ ['0', '0', :default],
20
21
  # 1 - Empty plugin
21
22
  ['0', '1', :default, :default, 'A test block', 'yes', :default],
22
23
  # 2 - Stand alone test engineering app
23
- ['2', '0', :default, :default, 'Falcon, Eagle', 'Falcon[ram, atd(2), comm[ram(2), osc](3)], Eagle[ram(2), atd(4)]', [:default, 'origen g example']],
24
+ ['2', '0', [:default]],
24
25
  # 3 - Test module
25
- ['2', '1', :default, :default, 'Test module for all flash IPs', 'FLASH_512K, FLASH_1024K', 'flash', [:default, 'origen g example']],
26
+ # ['2', '1', 'Test module for all flash IPs', [:default, 'origen g example']],
27
+ ['2', '1', 'Test module for all flash IPs', :default],
26
28
  # 4 - An app generators plugin
27
- ['1', '0', :default, :default, 'My application generators', :default]
29
+ ['1', '0', 'My application generators', :default]
28
30
  ] # END_OF_TEST_INPUTS Don't remove this comment, it is used by the app_gen:new command!
29
31
 
30
32
  # As you add new generators to this app they will be entered here, this enables the
@@ -33,19 +33,19 @@ module OrigenAppGenerators
33
33
  config_prod: { source: 'config/maillist_prod.txt' },
34
34
  doc_history: { source: 'doc/history' },
35
35
  target_default: { source: 'target/default.rb' },
36
- # target_default: { source: 'debug.rb', # Relative to the file being linked to
37
- # dest: 'target/default.rb', # Relative to destination_root
38
- # type: :symlink },
36
+ # target_default: { source: 'debug.rb', # Relative to the file being linked to
37
+ # dest: 'target/default.rb', # Relative to destination_root
38
+ # type: :symlink },
39
39
  environment_dir: { dest: 'environment', type: :directory },
40
- lib_module: { source: 'lib/module.rb',
41
- dest: "lib/#{@name}.rb" },
42
- lib_tasks: { source: 'lib/app.rake',
43
- dest: "lib/tasks/#{@name}.rake" },
40
+ lib_module: { source: 'app/lib/module.rb',
41
+ dest: "app/lib/#{@name}.rb" },
42
+ lib_module_dir: { dest: "app/lib/#{@name}", type: :directory },
43
+ app_blocks_dir: { dest: 'app/blocks', type: :directory },
44
44
  spec_helper: { source: 'spec/spec_helper.rb' },
45
- web_index: { source: 'templates/web/index.md.erb' },
46
- web_basic_layout: { source: 'templates/web/layouts/_basic.html.erb' },
47
- web_navbar: { source: 'templates/web/partials/_navbar.html.erb' },
48
- web_release_notes: { source: 'templates/web/release_notes.md.erb' },
45
+ web_index: { source: 'app/templates/web/index.md.erb' },
46
+ web_basic_layout: { source: 'app/templates/web/layouts/_basic.html.erb' },
47
+ web_navbar: { source: 'app/templates/web/partials/_navbar.html.erb' },
48
+ web_release_notes: { source: 'app/templates/web/release_notes.md.erb' },
49
49
  rakefile: { source: 'Rakefile' },
50
50
  gemfile: { source: 'Gemfile' },
51
51
  gitignore: { source: '.gitignore' },
@@ -55,7 +55,7 @@ module OrigenAppGenerators
55
55
  session: { source: 'origen_core_session',
56
56
  dest: '.session/origen_core',
57
57
  copy: true
58
- }
58
+ }
59
59
  }
60
60
  end
61
61
  end
@@ -5,6 +5,21 @@ module OrigenAppGenerators
5
5
 
6
6
  require 'gems'
7
7
 
8
+ def validate_application_name
9
+ @name = args.first.to_s.strip
10
+ if @name == ''
11
+ puts
12
+ puts "You must supply a name for what you want to call your application: 'origen new my_name'"
13
+ puts
14
+ exit 1
15
+ elsif @name != @name.symbolize.to_s
16
+ puts
17
+ puts 'The name of your new app must be lowercased and underscored and contain no special characters'
18
+ puts
19
+ exit 1
20
+ end
21
+ end
22
+
8
23
  def set_source_paths
9
24
  # The base Origen generator puts the Origen core directory on the source path, in retrospect this
10
25
  # was a bad idea and makes for hard to debug errors if an app generator resolves a template from
@@ -25,7 +40,11 @@ module OrigenAppGenerators
25
40
  dir << "#{template_dir}/base"
26
41
  klass = last_class
27
42
  else
28
- dir = "#{Origen.root!}/templates/app_generators/#{class_dir(klass)}"
43
+ dir = []
44
+ class_dirs(klass).each do |class_dir|
45
+ dir << "#{Origen.root!}/templates/app_generators/#{class_dir}"
46
+ dir << "#{Origen.root!}/app/templates/app_generators/#{class_dir}"
47
+ end
29
48
  end
30
49
  Array(dir).each do |dir|
31
50
  self.class.source_paths << dir if File.exist?(dir) && !self.class.source_paths.include?(dir)
@@ -40,11 +59,31 @@ module OrigenAppGenerators
40
59
  end
41
60
 
42
61
  def get_common_user_input
43
- get_name_and_namespace
62
+ # Don't bother asking the user for this, their life will be easier if they just go with
63
+ # Origen's default namespace based on their app's name
64
+ @namespace = @name.to_s.camelize
44
65
  end
45
66
 
46
67
  def get_lastest_origen_version
47
- @latest_origen_version = (Gems.info 'origen')['version']
68
+ @latest_origen_version ||= begin
69
+ (Gems.info 'origen')['version']
70
+ rescue
71
+ # If the above fails, e.g. due to an SSL error in the runtime environment, try to fetch the
72
+ # latest Origen version from the Origen website, before finally falling back to the version
73
+ # we are currently running if all else fails
74
+ begin
75
+ require 'httparty'
76
+ response = HTTParty.get('http://origen-sdk.org/origen/release_notes/')
77
+ version = Origen::VersionString.new(response.body.match(/Tag: v(\d+\.\d+.\d+)</).to_a.last)
78
+ if version.valid?
79
+ version
80
+ else
81
+ fail "Can't get the latest version!"
82
+ end
83
+ rescue
84
+ Origen.version
85
+ end
86
+ end
48
87
  end
49
88
 
50
89
  protected
@@ -55,6 +94,17 @@ module OrigenAppGenerators
55
94
  names.map(&:underscore).join('/')
56
95
  end
57
96
 
97
+ def class_dirs(klass)
98
+ names = klass.to_s.split('::')
99
+ names.shift
100
+ dirs = []
101
+ until names.empty?
102
+ dirs << names.map(&:underscore).join('/')
103
+ names.pop
104
+ end
105
+ dirs
106
+ end
107
+
58
108
  # def application_class?(klass)
59
109
  # until klass == OrigenAppGenerators::Base
60
110
  # end
@@ -115,12 +165,6 @@ module OrigenAppGenerators
115
165
  symlink_cmds.each { |cmd| system(cmd) }
116
166
  end
117
167
 
118
- # Convenience method that is equivalent to calling get_name and then get_namespace
119
- def get_name_and_namespace
120
- get_name
121
- get_namespace
122
- end
123
-
124
168
  # Prompts the user to confirm or enter the Ruby namespace to be used in the app.
125
169
  #
126
170
  # If @name is already defined a proposal will be generated from that, alternatively a proposal
@@ -28,13 +28,13 @@ module OrigenAppGenerators
28
28
 
29
29
  # **** Add require line ****
30
30
  module_declaration = /\nmodule #{Origen.app.namespace}/
31
- inject_into_file "lib/#{Origen.app.name}.rb", "require '#{Origen.app.name}/#{@domain_namespace.underscore}/#{@classname.underscore}'\n",
31
+ inject_into_file "#{app_dir}lib/#{Origen.app.name}.rb", "require '#{Origen.app.name}/#{@domain_namespace.underscore}/#{@classname.underscore}'\n",
32
32
  before: module_declaration
33
33
 
34
34
  # **** Add to the AVAILABLE hash ****
35
35
  if available[@domain_summary]
36
36
  existing_domain = /\s*('|")#{@domain_summary}('|") => \[\s*\n/
37
- inject_into_file "lib/#{Origen.app.name}.rb", " #{Origen.app.namespace}::#{@domain_namespace}::#{@classname},\n",
37
+ inject_into_file "#{app_dir}lib/#{Origen.app.name}.rb", " #{Origen.app.namespace}::#{@domain_namespace}::#{@classname},\n",
38
38
  after: existing_domain
39
39
  else
40
40
  new_domain = <<-END
@@ -43,7 +43,7 @@ module OrigenAppGenerators
43
43
  ],
44
44
  END
45
45
  available_hash = /AVAILABLE = {\s*\n/
46
- inject_into_file "lib/#{Origen.app.name}.rb", new_domain, after: available_hash
46
+ inject_into_file "#{app_dir}lib/#{Origen.app.name}.rb", new_domain, after: available_hash
47
47
  end
48
48
 
49
49
  # **** Add a starter set of test inputs ****
@@ -59,11 +59,11 @@ module OrigenAppGenerators
59
59
  if @parentclass == 'Plugin'
60
60
  inputs += " ['#{first}', '#{second}', :default, :default, 'A cool plugin', 'yes', :default]"
61
61
  else
62
- inputs += " ['#{first}', '#{second}', :default, :default, :default]"
62
+ inputs += " ['#{first}', '#{second}', :default]"
63
63
  end
64
64
  inputs = ",#{inputs}" unless test_inputs.empty?
65
65
  end_of_test_inputs = /\n\s*\]\s*#\s*END_OF_TEST_INPUTS/
66
- inject_into_file "lib/#{Origen.app.name}.rb", inputs, before: end_of_test_inputs
66
+ inject_into_file "#{app_dir}lib/#{Origen.app.name}.rb", inputs, before: end_of_test_inputs
67
67
  end
68
68
 
69
69
  # Can't compile this as contains some final ERB, so substitute instead
@@ -78,7 +78,7 @@ module OrigenAppGenerators
78
78
  # end
79
79
 
80
80
  def conclude
81
- system "origen lint #{Origen.root}/lib/#{Origen.app.name}.rb"
81
+ system "origen lint #{Origen.root}/#{app_dir}lib/#{Origen.app.name}.rb"
82
82
  puts
83
83
  puts "New generator created at: #{filelist[:generator][:dest]}"
84
84
  puts
@@ -90,6 +90,14 @@ module OrigenAppGenerators
90
90
 
91
91
  protected
92
92
 
93
+ def app_dir
94
+ if File.exist?("#{Origen.root}/app/lib")
95
+ 'app/'
96
+ else
97
+ ''
98
+ end
99
+ end
100
+
93
101
  def get_summary
94
102
  puts
95
103
  puts 'DESCRIBE YOUR NEW GENERATOR IN A FEW WORDS'
@@ -151,11 +159,11 @@ module OrigenAppGenerators
151
159
  def filelist
152
160
  @filelist ||= {
153
161
  generator: { source: 'generator.rb',
154
- dest: "lib/#{Origen.app.name}/#{@domain_namespace.underscore}/#{@classname.underscore}.rb" },
155
- templates_dir: { dest: "templates/app_generators/#{@domain_namespace.underscore}/#{@classname.underscore}",
162
+ dest: "#{app_dir}lib/#{Origen.app.name}/#{@domain_namespace.underscore}/#{@classname.underscore}.rb" },
163
+ templates_dir: { dest: "#{app_dir}templates/app_generators/#{@domain_namespace.underscore}/#{@classname.underscore}",
156
164
  type: :directory },
157
165
  # doc_info: { source: 'info.md.erb',
158
- # dest: "templates/web/#{Origen.app.name}/#{@domain_namespace.underscore}/#{@classname.underscore}.md.erb" }
166
+ # dest: "#{app_dir}templates/web/#{Origen.app.name}/#{@domain_namespace.underscore}/#{@classname.underscore}.md.erb" }
159
167
  }
160
168
  end
161
169
  end
@@ -1,8 +1,4 @@
1
1
  # This file has been added by origen_app_generators to test that the target can be
2
2
  # loaded within this application, it will not be included in your final application
3
3
  # builds once your generator has been released.
4
- namespace :new_app_tests do
5
- task :load_target do
6
- Origen.app.target.load!
7
- end
8
- end
4
+ Origen.app.target.load!
@@ -77,23 +77,21 @@ module OrigenAppGenerators
77
77
  list = super # Always pick up the parent list
78
78
  # Example of how to remove a file from the parent list
79
79
  # list.delete(:web_doc_layout)
80
- list.delete(:lib_readme)
81
- list.delete(:lib_readme_dev)
82
80
  list.delete(:templates_shared)
83
81
  # Example of how to add a file, in this case the file will be compiled and copied to
84
82
  # the same location in the new app
85
83
  # list[:config_shared_commands] = { source: 'config/shared_commands.rb' }
86
84
  list[:config_load_generators] = { source: 'config/load_generators.rb' }
87
- list[:lib_base] = { source: 'lib/base.rb', dest: "lib/#{@name}/base.rb" }
88
- list[:lib_plugin] = { source: 'lib/plugin.rb', dest: "lib/#{@name}/plugin.rb" }
89
- list[:lib_application] = { source: 'lib/application.rb', dest: "lib/#{@name}/application.rb" }
85
+ list[:lib_base] = { source: 'app/lib/base.rb', dest: "app/lib/#{@name}/base.rb" }
86
+ list[:lib_plugin] = { source: 'app/lib/plugin.rb', dest: "app/lib/#{@name}/plugin.rb" }
87
+ list[:lib_application] = { source: 'app/lib/application.rb', dest: "app/lib/#{@name}/application.rb" }
90
88
  # Alternatively specifying a different destination, typically you would do this when
91
89
  # the final location is dynamic
92
90
  # list[:gemspec] = { source: 'gemspec.rb', dest: "#{@name}.gemspec" }
93
91
  # Example of how to create a directory
94
- list[:templates_app] = { dest: 'templates/app_generators/application', type: :directory }
95
- list[:templates_plugin] = { dest: 'templates/app_generators/plugin', type: :directory }
96
- list[:templates_base] = { dest: 'templates/app_generators/base', type: :directory }
92
+ list[:templates_app] = { dest: 'app/templates/app_generators/application', type: :directory }
93
+ list[:templates_plugin] = { dest: 'app/templates/app_generators/plugin', type: :directory }
94
+ list[:templates_base] = { dest: 'app/templates/app_generators/base', type: :directory }
97
95
  # By default, directories created in this way will contain a .keep file, to inhibit this:
98
96
  # list[:pattern_dir] = { dest: "pattern", type: :directory, nokeep: true }
99
97
  # Example of how to create a symlink
@@ -1,8 +1,7 @@
1
1
  module OrigenAppGenerators
2
2
  # The base generator class that should be used by all plugin generators
3
3
  class Plugin < Application
4
- def get_common_user_input
5
- get_name_and_namespace
4
+ def get_additional_user_input
6
5
  get_summary
7
6
  get_audience unless @audience
8
7
  end
@@ -19,15 +18,13 @@ module OrigenAppGenerators
19
18
  list.delete(:web_installation)
20
19
  list.delete(:web_introduction)
21
20
  list[:gemspec] = { source: 'gemspec.rb', dest: "#{@name}.gemspec" }
22
- list[:templates_shared] = { dest: 'templates/shared', type: :directory }
21
+ list[:templates_shared] = { dest: 'app/templates/shared', type: :directory }
23
22
  if @audience == :external
24
23
  list[:travis] = { source: '.travis.yml' }
25
- list[:web_navbar] = { source: 'templates/web/partials/_navbar_external.html.erb', dest: 'templates/web/partials/_navbar.html.erb' }
24
+ list[:web_navbar] = { source: 'app/templates/web/partials/_navbar_external.html.erb', dest: 'app/templates/web/partials/_navbar.html.erb' }
26
25
  else
27
- list[:web_navbar] = { source: 'templates/web/partials/_navbar_internal.html.erb', dest: 'templates/web/partials/_navbar.html.erb' }
26
+ list[:web_navbar] = { source: 'app/templates/web/partials/_navbar_internal.html.erb', dest: 'app/templates/web/partials/_navbar.html.erb' }
28
27
  end
29
- list[:lib_readme] = { source: 'lib/README', dest: "lib/#{@name}/README" }
30
- list[:lib_readme_dev] = { source: 'lib_dev/README', dest: "lib/#{@name}_dev/README" }
31
28
  list
32
29
  end
33
30
  end
@@ -0,0 +1,29 @@
1
+ module OrigenAppGenerators
2
+ module TestEngineering
3
+ module Common
4
+ def common_filelist(list)
5
+ # Example of how to remove a file from the parent list
6
+ # list.delete(:target_debug)
7
+ # Example of how to add a file, in this case the file will be compiled and copied to
8
+ # the same location in the new app
9
+ list[:environment_v93k] = { source: 'environment/v93k.rb' }
10
+ list[:environment_j750] = { source: 'environment/j750.rb' }
11
+ list[:environment_uflex] = { source: 'environment/uflex.rb' }
12
+ # Alternatively specifying a different destination, typically you would do this when
13
+ # the final location is dynamic
14
+ # list[:gemspec] = { source: 'gemspec.rb', dest: "#{@name}.gemspec" }
15
+ # Example of how to create a directory
16
+ # list[:pattern_dir] = { dest: 'pattern', type: :directory }
17
+ # Example of how to create a symlink
18
+ list[:environment_default] = { source: 'uflex.rb', # Relative to the file being linked to
19
+ dest: 'environment/default.rb', # Relative to destination_root
20
+ type: :symlink }
21
+ # Test engineering source directories
22
+ list[:patterns_dir] = { dest: 'app/patterns', type: :directory }
23
+ list[:flows_dir] = { dest: 'app/flows', type: :directory }
24
+ # Remember to return the final list
25
+ list
26
+ end
27
+ end
28
+ end
29
+ end