#manifest-file #workspace #create #cargo-manifest #parent #projects #subdirectories

app workspace-gen

给定包含cargo项目的几个子目录,创建父工作区清单文件

15个版本 (9个破坏性版本)

0.10.0 2022年9月6日
0.8.0 2022年8月24日
0.1.3 2022年7月31日

#1283 in 文件系统

Apache-2.0

490KB
537 代码行

workspace-gen

给定包含cargo项目的几个子目录,创建父工作区清单文件。

crates.io 上找到。

用法

git clone x                   # clone a project into a subfolder
git clone y                   # clone a 2nd project 
cargo install workspace-gen   # add this executable to the path
workspace-gen local-path      # switch paths to local for hacking
cargo build                   # A Cargo.toml now exists, and should wrap both subprojects in a workspace!
workspace-gen git-ref         # switch paths to git refs to share work with others
workspace-gen --help          # display message below
workspace-gen 0.3.0
Given several subdirectories containing cargo projects, creates a parent workspace manifest file

USAGE:
    workspace-gen <MODE>

ARGS:
    <MODE>    What mode to run the program in [possible values: local-path, git-ref, version]

OPTIONS:
    -h, --help       Print help information
    -V, --version    Print version information

约定优于配置

技巧

  • 要使用 git-ref 模式,将上游远程命名 upstream
  • 通过设置 两个不同的URL 使用HTTP URL进行获取

示例输出

diff

[workspace]
members = [
    "arrow-datafusion/datafusion-examples",
    "arrow-datafusion/benchmarks",
    "arrow-datafusion/datafusion/physical-expr",
    "arrow-datafusion/datafusion/jit",
    "arrow-datafusion/datafusion/proto",
    "arrow-datafusion/datafusion/row",
    "arrow-datafusion/datafusion/core/fuzz-utils",
    "arrow-datafusion/datafusion/core",
    "arrow-datafusion/datafusion/sql",
    "arrow-datafusion/datafusion/expr",
    "arrow-datafusion/datafusion/optimizer",
    "arrow-datafusion/datafusion/common",
    "arrow-datafusion/datafusion-cli",
    "arrow-ballista/benchmarks",
    "arrow-ballista/ballista/rust/client",
    "arrow-ballista/ballista/rust/core",
    "arrow-ballista/ballista/rust/executor",
    "arrow-ballista/ballista/rust/scheduler",
    "arrow-ballista/ballista-cli",
    "arrow-ballista/python",
    "arrow-ballista/examples",
    "arrow-rs/integration-testing",
    "arrow-rs/parquet",
    "arrow-rs/arrow",
    "arrow-rs/object_store",
    "arrow-rs/arrow-flight",
    "arrow-rs/parquet_derive_test",
    "arrow-rs/parquet_derive",
    "arrow-rs/arrow-pyarrow-integration-testing"
]
exclude = [
    "arrow-datafusion",
    "arrow-ballista",
    "arrow-rs"
]

依赖项

~15MB
~344K SLoC