Class: Thermite::Tasks
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- Thermite::Tasks
- Includes:
- Cargo, CustomBinary, GithubReleaseBinary, Package, Util
- Defined in:
- lib/thermite/tasks.rb
Overview
Create the following rake tasks:
thermite:build
thermite:clean
thermite:test
thermite:tarball
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
The configuration used for the Rake tasks.
-
#options ⇒ Object
readonly
Possible configuration options for Thermite tasks:.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Tasks
constructor
Define the Thermite tasks with the given configuration parameters (see
options
).
Methods included from Util
Methods included from Package
#build_package, #prepare_downloaded_library, #unpack_tarball
Methods included from GithubReleaseBinary
#download_binary_from_github_release
Methods included from CustomBinary
#download_binary_from_custom_uri
Methods included from Cargo
#cargo, #cargo_msg, #cargo_recommended_msg, #cargo_required_msg, #inform_user_about_cargo, #run_cargo, #run_cargo_if_exists, #run_cargo_rustc
Constructor Details
Instance Attribute Details
#config ⇒ Object (readonly)
The configuration used for the Rake tasks.
52 53 54 |
# File 'lib/thermite/tasks.rb', line 52 def config @config end |
#options ⇒ Object (readonly)
Possible configuration options for Thermite tasks:
binary_uri_format
- if set, the interpolation-formatted string used to construct the download URI for the pre-built native extension. If the environment variableTHERMITE_BINARY_URI_FORMAT
is set, it takes precedence over this option. Either method of setting this option overrides thegithub_releases
option. Example:https://example.com/download/%{version}/%{filename}
. Replacement variables:filename
- The value of Config#tarball_filenameversion
- the crate version from theCargo.toml
file
cargo_project_path
- the path to the Cargo project. Defaults to the current working directory.cargo_workspace_member
- if set, the relative path to the Cargo workspace member. Usually used when it is part of a repository containing multiple crates.github_releases
- whether to look for rust binaries via GitHub releases when installing the gem, andcargo
is not found. Defaults tofalse
.github_release_type
- whengithub_releases
istrue
, the mode to use to download the Rust binary from GitHub releases.'cargo'
(the default) uses the version inCargo.toml
, along with thegit_tag_format
option (described below) to determine the download URI.'latest'
takes the latest release matching thegit_tag_regex
option (described below) to determine the download URI.git_tag_format
- whengithub_release_type
is'cargo'
(the default), the format string used to determine the tag used in the GitHub download URI. Defaults tov%s
, where%s
is the version inCargo.toml
.git_tag_regex
- whengithub_releases
is enabled andgithub_release_type
is'latest'
, a regular expression (expressed as aString
) that determines which tagged releases to look for precompiled Rust tarballs. One group must be specified that indicates the version number to be used in the tarball filename. Defaults tovN.N.N
, whereN
is any n-digit number. In this case, the group is around the entire expression.optional_rust_extension
- prints a warning to STDERR instead of raising an exception, if Cargo is unavailable andgithub_releases
is either disabled or unavailable. Useful for projects where either fallback code exists, or a native extension is desirable but not required. Defaults tofalse
.ruby_project_path
- the toplevel directory of the Ruby gem's project. Defaults to the current working directory.
These values can be overridden by values with the same key name in the
package.metadata.thermite
section of Cargo.toml
, if that section exists.
94 95 96 |
# File 'lib/thermite/tasks.rb', line 94 def @options end |