esp-idf-lib/devtools/Rakefile

Wed, 12 Apr 2023 16:23:02 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 12 Apr 2023 16:23:02 +0200
changeset 24
74609f70411e
parent 1
1c9894662795
permissions
-rw-r--r--

Reduced I2C master speed from 400 to 100 Khz. Hope to get power-on init for BMP280 more reliable. Added warnings for I2C devices that are missing. Some logmessages reduced to debug log messages. Added extra 10 mSec delays before read shunt voltage in the INA219 task. Removed and reduced log levels in the MQTT task. Show received data events. Remove WiFi total time debug logging, it's ok now.

# frozen_string_literal: true

task default: [:test]

desc "Run all tests"
task test: [:rubocop, :rspec]

desc "Run rubocop"
task :rubocop do
  sh "rubocop"
end

desc "Run rspec"
task :rspec do
  sh "rspec --format d"
end

desc "Update README.md"
task :readme do
  require "erb"
  require_relative "spec/group_list"
  require_relative "spec/component"

  template = File.read("README.md.erb")
  groups = GroupList.new("groups.yml").all

  # * select if it is a directory
  # * make path to metadata file
  # * read it
  # * parse it as YAML
  # * take all components under "components" key
  # * flatten the list of components
  # * create a Component from the item
  all_components = Dir.children("../components")
                      .select { |f| File.directory?(File.join("../components", f)) }
                      .map { |c| File.join("../components", c, ".eil.yml") }
                      .map { |f| File.read(f) }
                      .map { |f| YAML.safe_load(f) }
                      .map { |y| y["components"] }
                      .flatten
                      .map { |c| Component.new(c) }
  markdown = ERB.new(template, trim_mode: "%-").result(binding)
  puts markdown
end

mercurial