Introduction to `cjpm`
Inspect one language lane at a time so line-level text and code deltas stay readable.
Diff Lane
English
0 modified sections0 code block delta0 anchor delta
Diff Lane
中文
1 modified sections0 code block delta0 anchor delta
modified`cjpm` 基本使用方法code
v1.0.5
Section Text
1
通过 `cjpm -h` 即可查看主界面,由几个板块组成,从上到下分别是: 当前命令说明、使用示例(Usage)、支持的可用命令(Available subcommands)、支持的配置项(Available options)、更多提示内容。2
3
4
`cjpm init` 用来初始化一个新的仓颉模块或工作空间。初始化模块时会默认在当前文件夹创建 `cjpm.toml` 文件,并且新建 `src` 源码文件夹,在 `src` 下生成默认的 `main.cj` 文件。自定义参数初始化功能支持可以通过 `cjpm init -h` 查看。5
6
例如:7
8
9
`cjpm build` 用来构建当前仓颉项目,执行该命令前会先检查依赖项,检查通过后调用 `cjc` 进行构建。支持全量编译、增量编译、交叉编译、并行编译等,更多编译功能支持可以通过 `cjpm build -h` 查看。通过 `cjpm build -V` 命令可以打印所有的编译过程命令。10
11
例如:Code 1 · text
1
Cangjie Project Manager2
3
Usage:4
cjpm [subcommand] [option]5
6
Available subcommands:7
init Init a new cangjie module8
check Check the dependencies9
update Update cjpm.lock10
tree Display the package dependencies in the source code11
build Compile the current module12
run Compile and run an executable product13
test Unittest a local package or module14
bench Run benchmarks in a local package or module15
clean Clean up the target directory16
install Install a cangjie binary17
uninstall Uninstall a cangjie binary18
19
Available options:20
-h, --help help for cjpm21
-v, --version version for cjpm22
23
Use "cjpm [subcommand] --help" for more information about a command.Code 2 · text
1
输入: cjpm init2
输出: cjpm init successCode 3 · text
1
输入: cjpm build -V2
输出:3
compile package module1.package1: cjc --import-path target -p "src/package1" --output-type=staticlib -o target/release/module1/libmodule1.package1.a4
compile package module1: cjc --import-path target -L target/release/module1 -lmodule1.package1 -p "src" --output-type=exe --output-dir target/release/bin -o main5
6
cjpm build successv1.1.0
Section Text
1
通过 `cjpm -h` 即可查看主界面,由几个板块组成,从上到下分别是: 当前命令说明、使用示例(Usage)、支持的可用命令(Available subcommands)、支持的配置项(Available options)、更多提示内容。2
3
4
`cjpm init` 用来初始化一个新的仓颉模块或工作空间。初始化模块时会默认在当前文件夹创建 `cjpm.toml` 文件,并且新建 `src` 源码文件夹,在 `src` 下生成默认的 `main.cj` 文件。自定义参数初始化功能支持可以通过 `cjpm init -h` 查看。5
6
例如:7
8
9
`cjpm build` 用来构建当前仓颉项目,执行该命令前会先检查依赖项,检查通过后调用 `cjc` 进行构建。支持全量编译、增量编译、交叉编译、并行编译等,更多编译功能支持可以通过 `cjpm build -h` 查看。通过 `cjpm build -V` 命令可以打印所有的编译过程命令。10
11
例如:Code 1 · text
1
Cangjie Project Manager2
3
Usage:4
cjpm [subcommand] [option]5
6
Available subcommands:7
init Init a new cangjie module8
check Check the dependencies9
update Update cjpm.lock10
tree Display the package dependencies in the source code11
build Compile the current module12
run Compile and run an executable product13
test Unittest a local package or module14
bench Run benchmarks in a local package or module15
clean Clean up the target directory16
bundle Make distributable tarball of current module17
publish Publish a module to central repository18
install Install a cangjie binary19
uninstall Uninstall a cangjie binary20
21
Available options:22
-h, --help help for cjpm23
-v, --version version for cjpm24
25
Use "cjpm [subcommand] --help" for more information about a command.Code 2 · text
1
输入: cjpm init2
输出: cjpm init successCode 3 · text
1
输入: cjpm build -V2
输出:3
compile package module1.package1: cjc --import-path target -p "src/package1" --output-type=staticlib -o target/release/module1/libmodule1.package1.a4
compile package module1: cjc --import-path target -L target/release/module1 -lmodule1.package1 -p "src" --output-type=exe --output-dir target/release/bin -o main5
6
cjpm build success