Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .pubignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.dart_tool/
build/
doc/api/
rootstraps/
7 changes: 7 additions & 0 deletions doc/dartdoc/module_topic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Module topic

This topic groups the generated docs namespace for one Tizen module.

The page title identifies the exact Tizen version and module. The listed API
surface is generated from `package:tizen_interop/<version>/tizen.dart`, and
each namespace class points back to the corresponding runtime getter.
63 changes: 63 additions & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,66 @@ Run the script with:
```sh
python3 scripts/generate_doc_script.py
```

## Preparing module-scoped pub.dev docs

`pub.dev` generates API docs only from the uploaded package contents. To avoid
publishing one oversized API page for `package:tizen_interop/6.0/tizen.dart`,
prepare a publish-time docs library and a root `dartdoc_options.yaml`
before publishing.

Use:

```sh
scripts/prepare_pubdev_module_docs.sh prepare 6.0
```

This generates:

1. A docs-only library at `lib/6.0/tizen_docs.dart`
2. A publish-time `dartdoc_options.yaml`

The generated `dartdoc_options.yaml` is intentionally scoped to the docs-only
library:

* groups APIs under version/module topic pages such as `Tizen 6.0 / accounts_svc`
* excludes the original monolithic `tizen_interop` library
* includes only the generated docs library
* reuses the shared topic markdown at `doc/dartdoc/module_topic.md`

Running `prepare` again for another version updates the same root
`dartdoc_options.yaml` so it covers all currently prepared versions. For
example, running `prepare 6.0` and then `prepare 6.5` produces one
`dartdoc_options.yaml` containing both `Tizen 6.0 / ...` and
`Tizen 6.5 / ...` module topic entries.

To verify the exact publish-time setup:

```sh
scripts/prepare_pubdev_module_docs.sh verify 6.0
```

`verify` prepares the docs library, runs `dart doc --validate-links`,
runs `dart pub publish --dry-run`, and then removes the generated publish-time
files again. Pass `--keep-generated` if the package should remain in the
publish-ready state after verification. If other versions are already prepared,
their generated `dartdoc_options.yaml` entries stay in place and only the
verified version is cleaned up.

To remove the generated publish-time files:

```sh
scripts/prepare_pubdev_module_docs.sh clean 6.0
```

`clean` removes only the generated files for that version and rebuilds the root
`dartdoc_options.yaml` from any remaining prepared versions. When the last
prepared version is cleaned, the original `dartdoc_options.yaml` is restored
if one existed before preparation.

If a symbol from `generated_symbols.dart` is not found in
`generated_bindings.dart` and appears callback-related, the generated docs
namespace points readers to `package:tizen_interop_callbacks` so callback APIs
can be checked through `TizenInteropCallbacks.register()`,
`RegisteredCallback.interopCallback`, and
`RegisteredCallback.interopUserData`.
23 changes: 23 additions & 0 deletions scripts/prepare_pubdev_module_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
# Copyright 2026 Samsung Electronics Co., Ltd. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)"
ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd -P)"

command="${1:-verify}"
if [ "$#" -gt 0 ]; then
shift
fi

version="6.0"
if [ "$#" -gt 0 ] && [ "${1#--}" = "$1" ]; then
version="$1"
shift
fi

cd "$ROOT_DIR"
dart run tool/prepare_pubdev_module_docs.dart "$command" --version "$version" "$@"
Loading
Loading