Trait playdate_build::layout::Layout

source ·
pub trait Layout {
    // Required methods
    fn name(&self) -> &Name;
    fn root(&self) -> &Path;

    // Provided methods
    fn dest(&self) -> Cow<'_, Path> { ... }
    fn assets(&self) -> Cow<'_, Path> { ... }
    fn assets_hash(&self) -> Cow<'_, Path> { ... }
    fn assets_plan(&self) -> Cow<'_, Path> { ... }
    fn build(&self) -> Cow<'_, Path> { ... }
    fn manifest(&self) -> Cow<'_, Path> { ... }
    fn binary(&self) -> Cow<'_, Path> { ... }
    fn library(&self) -> Cow<'_, Path> { ... }
    fn artifact(&self) -> Cow<'_, Path> { ... }
    fn prepare(&mut self) -> Result<()> { ... }
}

Required Methods§

source

fn name(&self) -> &Name

source

fn root(&self) -> &Path

The root directory: /path/to/target/profile/playdate. If per-target: /path/to/target/$TRIPLE/profile/playdate. If build-script: /path/to/target(/$TRIPLE)/profile/build/**/out ($OUT_DIR or export-dir).

Provided Methods§

source

fn dest(&self) -> Cow<'_, Path>

The intermediate artifact destination: $root/$NAME/

Crate can have multiple targets (e.g. bins, lib, examples), so we’re have to specify the name, so dest will be $root/$NAME/, where $NAME is the name of the target.

source

fn assets(&self) -> Cow<'_, Path>

Collected assets

source

fn assets_hash(&self) -> Cow<'_, Path>

Hash of collected assets: $dest/.assets.hash

source

fn assets_plan(&self) -> Cow<'_, Path>

source

fn build(&self) -> Cow<'_, Path>

The directory for build package: $dest/build

Directory with all files prepared to build with pdc.

Contains:

  • pdex.elf : by cargo (+gcc) (link)
  • pdex.dylib : by cargo (link)
  • pdxinfo : manifest
    • files : linked assets
source

fn manifest(&self) -> Cow<'_, Path>

Playdate package manifest: $build/pdxinfo

source

fn binary(&self) -> Cow<'_, Path>

Playdate (hw) executable: $build/pdex.elf

source

fn library(&self) -> Cow<'_, Path>

Playdate (sim) library: $build/pdex.(dylib|dll)

Type of library depends on the current (HOST) target.

source

fn artifact(&self) -> Cow<'_, Path>

The final package: $root/$NAME.pdx

source

fn prepare(&mut self) -> Result<()>

Create all directories.

Implementors§