Skip to content

Latest commit

 

History

History
54 lines (43 loc) · 2.85 KB

README.md

File metadata and controls

54 lines (43 loc) · 2.85 KB
$ cargo-acap-build -h
Build app using cargo

Usage: cargo-acap-build [OPTIONS] [ARGS]...

Arguments:
  [ARGS]...  Pass additional arguments to `cargo build`

Options:
      --target <TARGET>  If given, build only for the given architecture(s) [possible values: aarch64, armv7hf]
  -h, --help             Print help (see more with '--help')
  -V, --version          Print version

Application project structure

A simple project will look something like:

  • <PACKAGE_ROOT>/: Directory in which the package manifest is located1.
    • Cargo.toml: Package manifest2 describing the binary crate that will be included in the app.
      • src/
        • main.rs: Conventional location for the executable3.
    • LICENSE: Open source acknowledgements4. If absent, it will be generated using cargo-about.
    • manifest.json Application manifest defining the app and its configuration5. If absent, the resulting artifact will be a plain executable instead of an EAP.
    • html/: Optional web client pages to include in the app67.
    • lib/: Optional dynamically linked libraries to include in the app67.
    • additional-files/: Optional additional files to include in the app7.

Some files and directories may be generated by a build script8 and placed in <OUT_DIR>/9 instead of in <PACKAGE_ROOT>/:

  • LICENSE
  • manifest.json
  • html/
  • lib/
  • additional-files/

In addition to the above structure this tool makes the following assumptions:

  • The package name (package.name in Cargo.toml) matches the app name (acapPackageConf.setup.appName in manifest.json).
  • The package version (package.version in Cargo.toml) matches the app version (acapPackageConf.setup.version in manifest.json).

Footnotes

  1. Defined in https://doc.rust-lang.org/cargo/appendix/glossary.html#package

  2. Documented in https://doc.rust-lang.org/cargo/reference/manifest.html

  3. A conventional Rust package layout is described in https://doc.rust-lang.org/cargo/guide/project-layout.html

  4. Documented in https://axiscommunications.github.io/acap-documentation/docs/develop/application-project-structure.html#license-file

  5. Documented in https://axiscommunications.github.io/acap-documentation/docs/develop/application-project-structure.html#manifest-file

  6. Mentioned in https://axiscommunications.github.io/acap-documentation/docs/develop/application-project-structure.html 2

  7. Mentioned in https://axiscommunications.github.io/acap-documentation/docs/develop/build-install-run.html#build-tool 2 3

  8. Documented in https://doc.rust-lang.org/cargo/reference/build-scripts.html

  9. One of many variables set for build scripts: https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts