lib/origen/generator/compiler.rb
# Compile all files found under the source directory, non-erb files will be copied
# to the destination un-altered
Compile all files found under the source directory, non-erb files will be copied
to the destination un-altered
Compile all files found under the source directory non - erb files will be copied to the destination un - altered
def compile(file_or_dir, options = {})
        options = {
          check_for_changes: true,
          sub_template:      false,
          collect_stats:     true
        }.merge(options)
        @scope = options[:scope]
        options[:output_directory] ||= output_directory
        @check_for_changes = options[:check_for_changes]
        @options = options
        if options[:sub_template]
          block = options.delete(:block)
          if is_erb?(file_or_dir)
            run_erb(file_or_dir, options, &block)
          else
            f = File.open(file_or_dir)
            content = f.read
            f.close
            insert(content)
          end
        else
          Origen.file_handler.resolve_files(file_or_dir, ignore_with_prefix: '_', import: :template) do |file|
            compile_file(file, options)
          end
        end
      end
def compile ( file_or_dir , options = { } ) options = { check_for_changes : true , sub_template : false , collect_stats : true } . merge ( options ) @scope = options [ :scope ] options [ :output_directory ] ||= output_directory @check_for_changes = options [ :check_for_changes ] @options = options if options [ :sub_template ] block = options . delete ( :block ) if is_erb? ( file_or_dir ) run_erb ( file_or_dir , options , & block ) else f = File . open ( file_or_dir ) content = f . read f . close insert ( content ) end else Origen . file_handler . resolve_files ( file_or_dir , ignore_with_prefix : '_' , import : :template ) do | file | compile_file ( file , options ) end end end
Compile all files found under the source directory, non-erb files will be copied
to the destination un-altered
Compile all files found under the source directory non - erb files will be copied to the destination un - altered
# Doing here so the output_directory (requiring target load) doesn't get hit if # it is already defined
file_or_dir
<not_specific>
options
<not_specific>