rlsbl v0.40.1 /rlsbl.targets.cargo
On this page

Cargo (Rust) release target with round-trip Cargo.toml editing via tomlkit, asset builds, dev-install support, and hybrid publish via CARGO_REGISTRY_TOKEN.

#rlsbl.targets.cargo

#rlsbl.targets.cargo

Cargo (Rust) release target that uses tomlkit for round-trip Cargo.toml editing with hybrid publish support via CARGO_REGISTRY_TOKEN.

#CargoTarget

Release target for Rust/Cargo projects (Cargo.toml).

#name

python
def name(self)

#read_name

python
def read_name(self, dir_path)

Read the package name from Cargo.toml.

#read_metadata

python
def read_metadata(self, dir_path)

Read license and description from Cargo.toml.

#detect

python
def detect(self, dir_path)

Detect if dir has a Cargo.toml with a [package] section (not workspace-only).

#read_version

python
def read_version(self, dir_path)

Read version from Cargo.toml [package].version.

#write_version

python
def write_version(self, dir_path, version)

Write version to Cargo.toml using tomlkit round-trip (preserves comments).

Returns a list of relative file paths that were modified.

#version_file

python
def version_file(self)

#tag_format

python
def tag_format(self, version)

#_is_library

python
def _is_library(self, dir_path)

Return True if the crate is a library (no binary target).

#template_dir

python
def template_dir(self)

#template_vars

python
def template_vars(self, dir_path)

Extract template variables from Cargo.toml.

#template_mappings

python
def template_mappings(self)

#build_assets

python
def build_assets(self, dir_path, version, dist_dir)

Build Rust binary in release mode and copy to dist_dir.

#publish

python
def publish(self, dir_path, version)

Publish to crates.io based on per-target config and token availability.

#check_project_exists

python
def check_project_exists(self, dir_path)

#get_project_init_hint

python
def get_project_init_hint(self)

#dev_install_command

python
def dev_install_command(self, project_dir)