A Dart library and CLI tool for managing APK dependencies using YAML specifications, with support for ADB integration, recursive dependency resolution, and optional URL-based APK sources.
- Define APK dependencies and metadata in YAML files
- Install APKs and their dependencies via ADB
- Support for optional dependencies and version constraints
- Block or allow APK installation from remote URLs
- Customizable install and detection logic for integration with Flutter or other platforms
- CLI for install, list, validate, and spec creation tasks
Each APK and its dependencies are described in a YAML file. Example:
package: com.example.myapp
version: 1.0.0
dependencies:
- package: com.example.dep1
min_version: 1.2.0
max_version: 2.0.0
is_optional: false
url: https://example.com/dep1.apk
- package: com.example.dep2
is_optional: truepackage: The package name of the APK.version: The version of the APK.dependencies: List of dependencies, each with:package: Dependency package name (required)min_version: Minimum version (optional)max_version: Maximum version (optional)is_optional: Whether the dependency is optional (default: false)url: Remote URL to fetch the APK (optional)
Install the CLI and run:
dependipk <command> [options]
-
install <spec.yaml> [--block-urls] [--main-url <url>]
Installs all dependencies and the main APK using ADB.
Use--block-urlsto prevent installing APKs from remote URLs.
Use--main-urlto specify a base URL for APKs. -
list <spec.yaml> [--main-url <url>]
Lists all dependencies in install order. -
validate <spec.yaml> [--main-url <url>]
Validates that all dependencies are resolvable. -
create <spec.yaml> <package> <version>
Generates a new YAML spec template.
Add dependipk to your Dart or Flutter project. Example:
import 'package:dependipk/dependipk.dart';
final dependipk = Dependipk(blockUrls: true);
await dependipk.installDependencies('myapp.yaml');You can provide custom logic for checking if an app is installed or for installing APKs, which is useful for Flutter or platform-specific integration:
final dependipk = Dependipk(
isInstalled: (package) async {
// Custom logic to check if the app is installed
return false;
},
installApk: (apkPath, package) async {
// Custom logic to install the APK
},
);If not provided, the library defaults to using ADB for installation and does not check if the app is already installed.
- Dependencies are resolved recursively. If a dependency's YAML file is present in the same directory, it will be used.
- Version constraints (
min_version,max_version) and optional dependencies are supported. - If a dependency specifies a
url, the APK will be downloaded unless--block-urlsis set. - The
--main-urloption can be used to provide a base URL for APKs that do not specify their own.
Given the following spec.yaml:
package: pack
version: 1.0.0
dependencies:
- package: com.example.dep1
min_version: 1.0.0
max_version: 2.0.0
is_optional: false
url: https://google.com/Run:
dependipk install spec.yaml
- APKs are installed using ADB by default.
- Downloading APKs from URLs is supported unless blocked.
- Recursive dependencies require YAML specs for each dependency in the same directory or accessible via URL.
- The tool prevents cyclic dependencies.
This project is licensed under the MIT License.
A project by The Better Internet.