hikage-declaration-gradle-plugin
This is the Hikage Gradle plugin for automatically packaging View declaration files.
Configure Plugin
You can add this plugin to your project using the following method.
Version Catalog (Recommended)
Add plugin in your project's gradle/libs.versions.toml.
[versions]
hikage-plugin = "<version>"
[plugins]
hikage-declaration = { id = "com.highcapable.hikage.declaration", version.ref = "hikage-plugin" }
Apply plugin in your project's build.gradle.kts.
plugins {
// ...
alias(libs.plugins.hikage.declaration)
}
Please change <version> to the version displayed at the top of this document.
Traditional Method
Apply plugin in your project's build.gradle.kts.
plugins {
// ...
id("com.highcapable.hikage.declaration") version "<version>"
}
Please change <version> to the version displayed at the top of this document.
Function Introduction
The plugin reads hikage-view-declaration under the current module's main source set resources directory and copies it to META-INF when packaging.
src/
└── main
└── resources
└── hikage-view-declaration
├── widget.json
├── view.json
└── ...
The published resource path is as follows.
META-INF/
└── hikage
└── view-declaration
└── <group>
└── <module>
├── widget.json
├── view.json
└── ...
The original hikage-view-declaration/** path is not kept at the root of the published artifact.
For the JSON format of the View declaration file, please refer to hikage-compiler → View Declaration File.
Tips
This plugin can be applied to Android, Java, or Kotlin JVM projects, and you can flexibly choose the published artifacts and publishing formats.
The plugin is only responsible for packaging View declaration files, not for generating layout component functions (Hikage Performer), nor will it automatically apply the Maven Publish plugin.
After applying hikage-gradle-plugin in the consumer module, the declaration files from dependencies are collected automatically and passed to hikage-compiler to generate layout component functions (Hikage Performer).