#version #date #cargo-toml #make #write #js #rust

yanked lmake_version_from_date

In Cargo.toml and service_worker.js writes the version as the date

0.3.41 Aug 14, 2021
0.3.40 Aug 22, 2020
0.3.38 May 21, 2020
0.3.32 Apr 29, 2020

#24 in #make

MIT license

23KB
260 lines

lmake_version_from_date

🔴OBSOLETE, 🔴DEPRECATED, 🔴DEFUNCT!
It was replaced by the crate cargo-auto



\

version: 0.3.37 date: 2020-05-21 authors: Luciano Bestia
In cargo.toml and service_worker.js writes the version as the date.

Lines in Rust code Lines in Doc comments Lines in Comments Lines in examples Lines in tests

In cargo.toml writes the version as the date yyyy.mmdd.HHMM ex. 2019.1221.2359.
For non-library projects, the semver specification is not really useful.
Having the version as the date is just fine for executables and much more human readable.
The util exe must be executed in the root project folder where is the cargo.toml.

service_worker.js

Inside the PWA service worker javascript file is also needed to change the version.
The program searches for service_worker.js and modify the version.

no need to change version if no files changed

If src/*.rs or cargo.tom. files are not changed from last compile, than no need to change version.
This happend is workspaces when one project is modified and the others are not.
I need to store the dates somewhere.
Probably the Target folder is ok. The filename will be lmakeversionfromdate.json. Warning: I don't check if the service worker has changed because it rarely does.

Install

cargo install lmake_version_from_date

Makefile.toml for cargo-make

In Makefile.toml for cargo make add a task like this:

[tasks.dev]
description = "cargo build release"
clear = true
dependencies = [
    "lmake_version_from_date",
    "build_release",
    "post_build",
]

[tasks.lmake_version_from_date]
clear = true
private = true
description = "in cargo.toml change version to today date"
script= ["lmake_version_from_date"]

cargo crev reviews and advisory

It is recommended to always use cargo-crev
to verify the trustworthiness of each of your dependencies.
Please, spread this info.
On the web use this url to read crate reviews. Example:
https://web.crev.dev/rust-reviews/crate/num-traits/

Dependencies

~3–11MB
~119K SLoC