PluginDefaults.kt 1.0 KB

12345678910111213141516171819202122232425
  1. package org.mjdev.desktop.plugins
  2. /** Constants describing where plugins live and how they are recognised on disk. */
  3. object PluginDefaults {
  4. /** Directory name (under the `.mjdev` folder in the user's home) holding plugin jars. */
  5. const val PLUGINS_DIR_NAME = "plugins"
  6. /** File name of the persisted plugin state, stored beside the desktop config. */
  7. const val STATE_FILE_NAME = "plugins.json"
  8. /** Extension of a loadable plugin archive. */
  9. const val JAR_EXTENSION = "jar"
  10. /** Entry inside the jar that carries the [PluginMetadata] JSON. */
  11. const val METADATA_ENTRY = "plugin.json"
  12. /** Entry inside the jar used as the plugin image when metadata does not name one. */
  13. const val DEFAULT_ICON_ENTRY = "icon.png"
  14. /** Upper bound for a metadata or icon entry read from a jar, protects against huge entries. */
  15. const val MAX_ENTRY_BYTES = 1_048_576
  16. /** Default period in milliseconds between two variable refreshes of a widget. */
  17. const val DEFAULT_REFRESH_MS = 5_000L
  18. }