.properties
The properties file synapticloop.testSample.properties
file is output to the ./src/main/resources/META-INF/gradle-plugins/
directory. This indicates to gradle that it is a plugin, and the points to the implementation class.
Looking at the file, you will see the contents:
implementation-class=synapticloop.plugin.sample.TestSamplePlugin
Variables used in the generation
synapticloop.plugin.sample.TestSamplePlugin
is generated from the following:
{package}
- the command line argument-p
or--package
.
- plain text{name}
- the command line argument-n
or--name
Plugin
- plain text{lowerName}
- this is generated from the-n
or--name
command line argument. NOTE: this is generated from the{name}
variable with its first letter lowercased. (e.g.TestSample
->testSample
)- This is used to create the name of the
.properties
file
- This is used to create the name of the
Things of note
You probably won't need to change anything in this file, however, a few things to note:
- The location of the file is important - it must reside in the
/META-INF/gradle-plugins/
of the produced artefact (i.e..jar
file) - The name of the file is important - it must be the same as the name of the plugin appended with '.properties' (in this case
synapticloop.plugin.sample.TestSample.properties
) - The properties file must contain a key of
implementation-class
with the value being thePlugin
class.