gradle-josm-plugin / org.openstreetmap.josm.gradle.plugin.config / JosmManifest

JosmManifest

class JosmManifest

The info that will be written into the manifest file of the plugin *.jar

Most of the attributes are corresponding to the ones listed in the documentation for developing JOSM plugins. But note that some of them have been renamed a bit to better express what each attribute is good for.

The properties used by the Ant build (e.g. plugin.author or plugin.description) are automatically picked up by both Ant and Gradle, if you define them in your gradle.properties file and load them into your build.xml file using the following snippet:

<!-- edit the properties of this plugin in the file `gradle.properties` -->
<property file="${basedir}/gradle.properties"/>

The detailed documentation for each field below tells you, which one corresponds to which Ant/Gradle property and to which attribute in the MANIFEST.MF file.

For a successful build you'll have to at least set the following properties in this class: mainClass, description, minJosmVersion Your project also has to set a value for Project.getVersion

Types

Platform

enum class Platform

The three platforms for which JOSM supports virtual plugins.

Constructors

<init>

JosmManifest(project: Project)

The info that will be written into the manifest file of the plugin *.jar

Properties

author

var author: String?

The author of the plugin.

canLoadAtRuntime

var canLoadAtRuntime: Boolean

Determines if the plugin needs a restart after installation. true if no restart is required, false otherwise.

description

var description: String?

The description of what the plugin does.

iconPath

var iconPath: String?

Path to the logo of the plugin. Relative to the root of the released jar-file, so that it can be loaded via Class.getResource.

includeLinksToGithubReleases

var includeLinksToGithubReleases: Boolean

If true, load the old version download links from GitHub releases (see GithubConfig). Values added through oldVersionDownloadLink are ignored, if this is set to true.

langCompileTask

var langCompileTask: LangCompile?

The task that processes the *.lang files for translations. This is set automatically and you normally don't have to change it.

loadEarly

var loadEarly: Boolean

This can be set to true, when the plugin should load before the GUI classes of JOSM.

loadPriority

var loadPriority: Int?

A number indicating the order in which the plugins should be loaded. Lower numbers first, higher numbers later, then the plugins with this field set to null.

mainClass

var mainClass: String?

The full name of the main class of the plugin.

minJavaVersion

var minJavaVersion: Int?

The minimum Java version needed to run this plugin.

minJosmVersion

var minJosmVersion: String?

The minimum JOSM version with which the plugin is compatible.

platform

var platform: JosmManifest.Platform?

The platform for which this native implementation of a virtual plugin is made. Must be set in conjunction with provides.

pluginDependencies

val pluginDependencies: MutableSet<String>

A collection of the names of all JOSM plugins that must be installed for this JOSM plugin to work

provides

var provides: String?

The name of a virtual plugin for which this plugin is a native implementation. Must be set in conjunction with platform.

website

var website: URL?

A URL pointing to a web resource describing the plugin.

Functions

createJosmPluginJarManifest

fun createJosmPluginJarManifest(): Map<String, String>

Returns a map containing all manifest attributes, which are set. This map can then be fed into org.gradle.api.java.archives.Manifest.attributes. That's already done automatically by the gradle-josm-plugin, so you normally don't need to call this yourself.

oldVersionDownloadLink

fun oldVersionDownloadLink(minJosmVersion: Int, pluginVersion: String, downloadURL: URL): Unit

Add a link to an earlier release of the plugin, that is compatible with JOSM versions, with which the current version is no longer compatible.

setPlatform

fun setPlatform(name: String): Unit

Convenience method to set the platform using a String instead of a Platform enum value.

translatedDescription

fun translatedDescription(language: String, translatedDescription: String): Unit

Adds a translation of the plugin description for a certain language.