Migrate fuchsia docs from pm to ffx

The `pm` tool has been deprecated, so this migrates the fuchsia
documentation to the new `ffx` based tooling.
This commit is contained in:
Erick Tryzelaar 2024-05-13 20:13:48 +00:00
parent 030a12ce2b
commit 58ee9192e0

View File

@ -387,7 +387,7 @@ meta/hello_fuchsia.cm=pkg/meta/hello_fuchsia.cm
``` ```
*Note: Relative manifest paths are resolved starting from the working directory *Note: Relative manifest paths are resolved starting from the working directory
of `pm`. Make sure to fill out `<SDK_PATH>` with the path to the downloaded of `ffx`. Make sure to fill out `<SDK_PATH>` with the path to the downloaded
SDK.* SDK.*
The `.manifest` file will be used to describe the contents of the package by The `.manifest` file will be used to describe the contents of the package by
@ -459,12 +459,10 @@ hello_fuchsia/
Next, we'll build a package manifest as defined by our manifest: Next, we'll build a package manifest as defined by our manifest:
```sh ```sh
${SDK_PATH}/tools/${ARCH}/pm \ ${SDK_PATH}/tools/${ARCH}/ffx package build \
-api-level $(${SDK_PATH}/tools/${ARCH}/ffx version -v | grep "api-level" | head -1 | awk -F ' ' '{print $2}') \ --api-level $(${SDK_PATH}/tools/${ARCH}/ffx --machine json version | jq .tool_version.api_level) \
-o pkg/hello_fuchsia_manifest \ --out pkg/hello_fuchsia_manifest \
-m pkg/hello_fuchsia.manifest \ pkg/hello_fuchsia.manifest
build \
-output-package-manifest pkg/hello_fuchsia_package_manifest
``` ```
This will produce `pkg/hello_fuchsia_manifest/` which is a package manifest we can This will produce `pkg/hello_fuchsia_manifest/` which is a package manifest we can
@ -498,8 +496,7 @@ to.
We can set up our repository with: We can set up our repository with:
```sh ```sh
${SDK_PATH}/tools/${ARCH}/pm newrepo \ ${SDK_PATH}/tools/${ARCH}/ffx repository create pkg/repo
-repo pkg/repo
``` ```
**Current directory structure** **Current directory structure**
@ -523,17 +520,17 @@ hello_fuchsia/
We can publish our new package to that repository with: We can publish our new package to that repository with:
```sh ```sh
${SDK_PATH}/tools/${ARCH}/pm publish \ ${SDK_PATH}/tools/${ARCH}/ffx repository publish \
-repo pkg/repo \ --package pkg/hello_fuchsia_package_manifest \
-lp -f <(echo "pkg/hello_fuchsia_package_manifest") pkg/repo
``` ```
Then we can add the repository to `ffx`'s package server as `hello-fuchsia` using: Then we can add the repository to `ffx`'s package server as `hello-fuchsia` using:
```sh ```sh
${SDK_PATH}/tools/${ARCH}/ffx repository add-from-pm \ ${SDK_PATH}/tools/${ARCH}/ffx repository add-from-pm \
pkg/repo \ --repository hello-fuchsia \
-r hello-fuchsia pkg/repo
``` ```
## Running a Fuchsia component on an emulator ## Running a Fuchsia component on an emulator