Class: Tebako::Cli
- Inherits:
-
Thor
- Object
- Thor
- Tebako::Cli
- Defined in:
- lib/tebako/cli.rb
Overview
Tebako packager front-end
Constant Summary collapse
- CWD_DESCRIPTION =
<<~DESC Current working directory for packaged application. This directory shall be specified relative to root. #{" " * 65}# If this parameter is not set, the application will start in the current directory of the host file system. DESC
- REF_DESCRIPTION =
<<~DESC "Referenced tebako run-time package; 'tebako-runtime' by default". #{" " * 65}# This option specifies the tebako runtime to be used by the application on Windows and if mode is 'application' only . DESC
- RGP_DESCRIPTION =
<<~DESC Current working directory for packaged application. This directory shall be specified relative to root. #{" " * 65}# If this parameter is not set, the application will start in the current directory of the host file system. DESC
Class Method Summary collapse
Instance Method Summary collapse
- #clean ⇒ Object
- #clean_ruby ⇒ Object
- #hash ⇒ Object
-
#press ⇒ Object
rubocop:disable Metrics/MethodLength.
- #setup ⇒ Object
Class Method Details
.exit_on_failure? ⇒ Boolean
172 173 174 |
# File 'lib/tebako/cli.rb', line 172 def self.exit_on_failure? true end |
Instance Method Details
#clean ⇒ Object
70 71 72 73 74 |
# File 'lib/tebako/cli.rb', line 70 def clean (om, cm) = bootstrap(clean: true) cm.clean_cache extra_win_clean([om.deps]) end |
#clean_ruby ⇒ Object
80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/tebako/cli.rb', line 80 def clean_ruby puts "Cleaning Ruby sources from tebako packaging environment" (om,) = bootstrap(clean: true) suffix = ["Ruby"].nil? ? "" : "_#{["Ruby"]}" nmr = Dir.glob(File.join(om.deps, "src", "_ruby#{suffix}*")) nms = Dir.glob(File.join(om.deps, "stash#{suffix}*")) FileUtils.rm_rf(nmr + nms, secure: true) extra_win_clean(nmr) end |
#hash ⇒ Object
93 94 95 |
# File 'lib/tebako/cli.rb', line 93 def hash print Digest::SHA256.hexdigest [File.read(File.join(source, "CMakeLists.txt")), Tebako::VERSION].join end |
#press ⇒ Object
rubocop:disable Metrics/MethodLength
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/tebako/cli.rb', line 141 def press # rubocop:disable Metrics/MethodLength (om, cm) = bootstrap reporter = Tebako::BuildReporter.start(explain: om.explain?, format: om.report_format) success = false do_press(om) cm.ensure_version_file success = true rescue Tebako::Error => e puts "Tebako script failed: #{e.} [#{e.error_code}]" exit e.error_code ensure reporter&.finish(success: success) Tebako::BuildReporter.current = nil end |