readme: update build guide

This commit is contained in:
dekvall
2020-01-13 22:14:44 +01:00
parent b76e9666f0
commit 79e21c05fa

View File

@@ -8,47 +8,48 @@ provided "as is"; we make no guarantees about any plugin in this repo.
## Creating new plugins
There are two methods to create an external plugin, you can either:
- Use [this](https://github.com/runelite/example-plugin/) plugin template.
- Clone this repository and run the `create_new_plugin.py` script. This requires you to have `python3` installed
**If you are using IntelliJ, you will need at least version 2017.3**
### Using the template repository
1. Generate your own repository with [this](https://github.com/runelite/example-plugin/generate) link. You have to be logged in to GitHub.
2. Name your repository something appropriate, in my case I will name it `helmet-check` with the description `You should always wear a helmet.` **Make sure that your repository is set to public**.
3. Add a `README` to your repository, this is a short description of what your plugin does. In the bottom right you will find an *Add README*-button.
Click it and add a description of your plugin, it will be autofilled with the description you wrote in the previous step. This is the first thing a user will see when it visits your plugin repository.
3. In the top right, you will see a *Clone or download*-button. Click on it and copy the link.
4. In the top right, you will see a *Clone or download*-button. Click on it and copy the link.
4. Open IntelliJ and choose *Get from Version Control*. Paste the link you just copied in the URL field and where you want to save it in the second field.
5. Open IntelliJ and choose *Get from Version Control*. Paste the link you just copied in the URL field and where you want to save it in the second field.
6. In order to make sure everything works correctly, try to start the client with your external plugin enabled by running the test.
5. In order to make sure everything works correctly, try to start the client with your external plugin enabled by running the test.
![run-test](https://i.imgur.com/tKSQH5e.png)
7. Use the refactor tool to rename the package to what you want your plugin to be. Rightclick the package in the sidebar and choose *Refactor > Rename*.
6. Use the refactor tool to rename the package to what you want your plugin to be. Rightclick the package in the sidebar and choose *Refactor > Rename*. I choose to rename it to `com.helmetcheck`.
Do the same for `ExamplePlugin`, `ExampleConfig` and `ExamplePluginTest`.
7. Use the same tool, *Refactor > Rename*, to rename `ExamplePlugin`, `ExampleConfig` and `ExamplePluginTest` to `HelmetCheckPlugin` etc.
Right-click the src folder in the sidebar and choose *Replace in path*, enter `example` in the upper field and `<yourpluginname>`, no spaces. in the lower one. Then press replace all. Go to your plugin file and set it's name in the `PluginDescriptor`, this can have spaces.
8. Go to your plugin file and set it's name in the `PluginDescriptor`, this can have spaces.
9. Open the `runelite-plugin.properties` file and add info to each row.
```
displayName=Helmet check
author=dekvall
support=https://github.com/dekvall/helmet-check
description=Alerts you when you have nothing equipped in your head slot
tags=hint,gear,head
plugins=com.example.HelmetCheckPlugin
displayName=Helmet check
author=dekvall
support=https://github.com/dekvall/helmet-check
description=Alerts you when you have nothing equipped in your head slot
tags=hint,gear,head
plugins=com.helmetcheck.HelmetCheckPlugin
```
`support` is the URL you want players to use to leave feedback for your plugin; you can just use your repository for that. `tags` will make it easier to find your plugin when searching for related words.
`support` is the URL you want players to use to leave feedback for your plugin; you can just use your repository for that. `tags` will make it easier to find your plugin when searching for related words. If you want to add multiple plugin files, the `plugins` field allows for comma separated values, but this is not usually needed.
10. Optionally, you can add an icon to be displayed alongside with your plugin. Place a file with the name `icon.png` no larger than 48x72 px at the root of the repository.
11. When you have your plugin working. Commit your changes and push them to your repository.
11. Write a nice README so your users can see the features of your plugin.
12. When you have your plugin working. Commit your changes and push them to your repository.
### Using the script
@@ -56,7 +57,7 @@ plugins=com.example.HelmetCheckPlugin
2. Run the script with:
```
python3 create_new_plugin.py
python3 create_new_plugin.py [--output_directory OUTPUT_DIRECTORY]
```
It will ask you a series of questions, and then generate a folder with the name of your plugin.
@@ -70,7 +71,9 @@ plugins=com.example.HelmetCheckPlugin
6. Optionally, you can add an icon to be displayed alongside with your plugin. Place a file with the name `icon.png` no larger than 48x72 px at the root of the repository.
7. When you have your plugin working. Commit your changes and push them to your repository.
7. Write a nice README so your users can see the features of your plugin.
8. When you have your plugin working. Commit your changes and push them to your repository.
### Licensing your repository
1. Go to your repository on GitHub and select *Insights* from the top bar. Then choose *Community* in the list to the left.