Clone this repo:

Branches

  1. c93e42f Update scripts paths. by Darren Chan · 1 year, 10 months ago main
  2. d1b78aa Use Bazel SDK from CIPD. by Darren Chan · 1 year, 10 months ago
  3. b4793ae [scripts] Delete obsolete scripts by Anthony Fandrianto · 1 year, 10 months ago
  4. abd6016 [roll] Update submodules by global-integration-roller · 1 year, 10 months ago
  5. 2645e48 [roll] Update submodules by global-integration-roller · 1 year, 10 months ago

SDK Samples: Fortune Teller

This repository contains instructions and source code to build, package and run Fuchsia samples using only the Fuchsia SDK.

Requirements

  1. Make sure this repository has the required submodules:

    git submodule update --recursive --init
    
  2. Run bootstrap to download bazel

    scripts/bootstrap.sh
    
  3. Ensure that there are Fuchsia SSH keys in your host machine. You will need them for running the Fuchsia emulator.

     [[ -f "${HOME}/.ssh/fuchsia_ed25519" ]] || ssh-keygen -P "" -t ed25519 -f "${HOME}/.ssh/fuchsia_ed25519" -C "${USER}@$(hostname -f) Shared SSH Key for Fuchsia"
    
     [[ -f "${HOME}/.ssh/fuchsia_authorized_keys" ]] || ssh-keygen -y -f "${HOME}/.ssh/fuchsia_ed25519" > "${HOME}/.ssh/fuchsia_authorized_keys"
    

Build and package the sample

Now the repository is ready to build the sample.

  1. Prepare the development environment

    tools/bazel run :ws_emu_development
    
  2. (optional) Verify that your enviroment is correctly set up

    tools/bazel run :ws_emu_development.status
    

1.. (optional) watch the device log in a separate window

tools/ffx log

1.. Run the fortune-teller component

bazel run //src/fortune_teller:pkg.component

Watch that your fortune is printed in the log.

Run Tests

  1. Start emulator (see step #1 above)

  2. Run tests

    bazel test --config=fuchsia_x64 //src/fortune_teller:test_pkg