2

我正在尝试将 origen 设置为在使用origen p命令生成流程后自动生成 Web 文档,因此我添加了以下回调:

def on_flow_end(options)
  OrigenDocHelpers.generate_flow_docs layout: "#{Origen.root}/templates/web/layouts/_basic.html.erb", tab: :flows do |d|
    d.page  flow: "#{options[:test_module]}_flow".to_sym,
            name: "#{options[:test_module].to_s.upcase} Flow",
            target: "#{Origen.target.name}.rb"  
  end
end

这会在构建流程页面时导致错误:

[INFO]       14.641[0.005]   || Building flow page: /users/chorton/osdk/ppekit/web/content/flows/pcie_flow.md

COMPLETE CALL STACK
-------------------
Can't find: partials/_navbar.html
/home/chorton/.origen/gems/ruby/2.3.0/bundler/gems/origen-7bf48a874995/lib/origen/file_handler.rb:137:in `clean_path_to'
/home/chorton/.origen/gems/ruby/2.3.0/bundler/gems/origen-7bf48a874995/lib/origen/file_handler.rb:226:in `rescue in clean_path_to_sub_template'
/home/chorton/.origen/gems/ruby/2.3.0/bundler/gems/origen-7bf48a874995/lib/origen/file_handler.rb:213:in `clean_path_to_sub_template'
/home/chorton/.origen/gems/ruby/2.3.0/bundler/gems/origen-7bf48a874995/lib/origen/generator/renderer.rb:8:in `render'
(erb):4:in `_get_binding'

如果我单独调用origen p(没有添加回调)然后运行,则没有错误:

origen web compile --remote --api

是否可以将这两个命令与我正在尝试做的回调组合成一个命令,或者是否有必要在origen web compile之后调用origen p

谢谢。

4

1 回答 1

2

这似乎是一个错误,如果您无法解决,请在此处为其开票 - https://github.com/Origen-SDK/origen/issues

我会说通常用于执行此操作的约定是挂钩到after_web_site_compile您的config/application.rb.

这是一个例子:

# config/application.rb

def after_web_site_compile(options)
  # Build the test flow docs
  Origen.environment.temporary = 'v93k.rb'
  # Generate the program for the target(s) you want to document
  %w(device_a device_b).each do |target|
    Origen.target.temporary = "#{target}.rb"
    Origen.app.runner.launch action: :program,
                             files:  'program/full.list' # Or whatever file arg you pass to 'origen p'

    OrigenDocHelpers.generate_flow_docs layout: "#{Origen.root}/templates/web/layouts/_basic.html.erb", tab: :flows do |d|
      d.page flow: "#{options[:test_module]}_flow".to_sym,
             name: "#{options[:test_module].to_s.upcase} Flow",
           target: "#{target}.rb"  
    end
  end
end 
于 2018-02-13T13:27:50.020 回答