Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(json-init): add a --with-json-config=path/to/config.json flag for passing json to init #279

Merged
merged 6 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
339 changes: 184 additions & 155 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions book/src/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ Note that the Cargo license-file flag only accepts one path, so it can't handle



## metadata.dist
## workspace.metadata.dist

Cargo allows other tools to include their own project-wide settings in [metadata tables][workspace-metadata]. The one cargo-dist uses is `[workspace.metadata.dist]`, which must appear in your root Cargo.toml (whether or not it's [virtual][workspace]). All settings specified here apply to all packages in your project. You can override them on a per-package basis with `[package.metadata.dist]`, which accepts all the same fields (except for those which must be specified once globally, see the docs for each individual option).
Cargo allows other tools to include their own project-wide settings in [metadata tables][workspace-metadata]. The one cargo-dist uses is `[workspace.metadata.dist]`, which must appear in your root Cargo.toml (whether or not it's [virtual][workspace]). You can override them on a per-package basis with `[package.metadata.dist]`, which accepts all the same fields (except for those which must be specified once globally, see the docs for each individual option).

### cargo-dist-version

Expand Down Expand Up @@ -211,6 +211,8 @@ Future work is planned to [support more robust signed checksums][issue-sigstore]

Example `precise-builds = true`

**This can only be set globally**

Build only the required packages, and individually (default: false)

By default when we need to build anything in your workspace, we build your entire workspace with --workspace. This setting tells cargo-dist to instead build each app individually.
Expand All @@ -232,6 +234,8 @@ If that downside is big enough for you, this setting is a good idea.

Example `merge-tasks = true`

**This can only be set globally**

Whether we should try to merge otherwise-parallelizable tasks onto the same machine, sacrificing latency and fault-isolation for more the sake of minor effeciency gains.

For example, if you build for x64 macos and arm64 macos, by default we will generate ci which builds those independently on separate logical machines. With this enabled we will build both of those platforms together on the same machine, making it take twice as long as any other build and making it impossible for only one of them to succeed.
Expand All @@ -244,6 +248,8 @@ The default is `false`. Before 0.1.0 it was always `true` and couldn't be change

Example `fail-fast = true`

**This can only be set globally**

Whether failing tasks should make us give up on all other tasks. (defaults to false)

When building a release you might discover that an obscure platform's build is broken. When this happens you have two options: give up on the release entirely (`fail-fast = true`), or keep trying to build all the other platforms anyway (`fail-fast = false`).
Expand Down
4 changes: 2 additions & 2 deletions cargo-dist/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ xz2 = "0.1.7"
guppy = "0.15.0"
camino = "1.1.1"
semver = "1.0.14"
toml_edit = "0.15.0"
toml_edit = "0.19.0"
parse-changelog = { version = "0.5.3", default-features = false }
newline-converter = "0.2.2"
axoproject = { version = "0.3.0", default-features = false, features = ["cargo-projects"] }
dialoguer = "0.10.4"
axoasset = "0.2.0"
axoasset = { version = "0.4.0", features = ["json-serde", "toml-serde", "toml-edit"] }
sha2 = "0.10.6"

[dev-dependencies]
Expand Down
4 changes: 4 additions & 0 deletions cargo-dist/src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! All the clap stuff for parsing/documenting the cli

use camino::Utf8PathBuf;
use clap::{
builder::{PossibleValuesParser, TypedValueParser},
Args, Parser, Subcommand, ValueEnum,
Expand Down Expand Up @@ -214,6 +215,9 @@ pub struct InitArgs {
/// Don't automatically invoke 'cargo dist generate-ci' at the end
#[clap(long)]
pub no_generate_ci: bool,
/// A path to a json file containing values to set in workspace.metadata.dist
#[clap(long)]
pub with_json_config: Option<Utf8PathBuf>,
}

#[derive(Args, Clone, Debug)]
Expand Down
Loading