Skip to content

Commit

Permalink
Merge branch 'runelite:master' into did-I-compost
Browse files Browse the repository at this point in the history
  • Loading branch information
AbusiveTuna authored Nov 10, 2024
2 parents c40f1d9 + fc4d4f0 commit f9682d0
Show file tree
Hide file tree
Showing 467 changed files with 1,170 additions and 521 deletions.
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* @runelite/developers
/package/verification-template/ @runelite/plugin-mergers
/plugins/
/README.md
24 changes: 12 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ on:
push:
pull_request:
env:
CACHE_VERSION: 2.3.1
CACHE_VERSION: 2.4.0
jobs:
build:
# any forks that predate this repo having an action will have actions
# enabled by default, which will fail in a lot of cases because the branch
# is new, which makes the differential build fail
if: github.event_name != 'push' || github.repository_owner == 'runelite'
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 11
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches/
Expand Down Expand Up @@ -68,12 +68,12 @@ jobs:
export PACKAGE_COMMIT_RANGE="${COMMIT_RANGE:-${COMMIT_BEFORE:+$COMMIT_BEFORE...$COMMIT_AFTER}}"
fi
exec java -XX:+UseParallelGC -cp package/package/build/libs/package.jar net.runelite.pluginhub.packager.Packager
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: manifest_diff
path: /tmp/manifest_diff
retention-days: 1
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: ${{ github.event_name == 'pull_request' }}
with:
name: jars
Expand All @@ -83,22 +83,22 @@ jobs:
if: (github.event_name != 'push' || github.repository_owner == 'runelite') && github.event_name != 'pull_request'
needs: build
concurrency: upload
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 11
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches/
~/.gradle/wrapper/
key: upload-${{ env.CACHE_VERSION }}
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: manifest_diff
path: /tmp
Expand Down
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions LICENSE.templateplugin
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
The contents of the template plugin and the output of the `create_net_plugin.py`
script are, released into the public domain unless otherwise noted.
The contents of the template plugin and the output of the `create_new_plugin.py`
script are, released into the public domain unless otherwise noted.
45 changes: 12 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,28 @@ provided "as is"; we make no guarantees about any plugin in this repo.
## Setting up the development environment

We recommend [IntelliJ Idea Community Edition](https://www.jetbrains.com/idea/download/) as well as Java 11. You can either have
IntelliJ install Java (select `Eclipse Temurin`) or download it from https://adoptium.net/temurin/releases/.
IntelliJ install Java (select `Eclipse Temurin`) or download it from https://adoptium.net/temurin/releases/. You must also have a GitHub account.

## Creating new plugins
There are two methods to create an external plugin, you can either:
## Contribute to existing plugins

- Use [this](https://github.com/runelite/example-plugin/) plugin template.
We recommend contributing to existing plugins if the author(s) are accepting contributions, and the feature you want to add fits well into the plugin, to avoid fragmentation of plugin ecosystem. Reducing plugin fragmentation helps users discover features more easily, and helps us review changes in a more timely manner.

- Clone this repository and run the `create_new_plugin.py` script. This requires you to have `python3` installed
You may contribute to existing plugins by selecting the plugin from https://runelite.net/plugin-hub, navigating to the plugin's GitHub repository by following the "Report an issue" link, and then following the "Create new plugins" section below from step 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.
## Creating new plugins
1. Generate your own repository from the [plugin template](https://github.com/runelite/example-plugin/generate) link (you must be signed into GitHub first).
Alternatively, you may use the `create_new_plugin.py` script provided in this repository to generate a new plugin project.

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. 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. In order to make sure everything works correctly, try to start the client with your external plugin enabled by running the test. The test requires `-ea` to be added to your VM options to enable assertions, which can be found in IntellIJ in `Run/Debug Configurations` under `Modify options`, `Add VM options`, and then adding `-ea` into the input field which appears.
5. In order to make sure everything works correctly, try to start the client with your external plugin enabled by running the provided test. If you don't have a run configuration yet for the test, attempt to run it by clicking `Run test`. This will create a run configuration and fail to run due to asserts being disabled. Add `-ea`
to your VM options in the run configuration to enable assertions, which can be found under `Run/Debug Configurations` under `Modify options`, `Add VM options`, and then adding `-ea` into the input field which appears.

The client should now launch with your plugin enabled. If you have a Jagex account, you will be unable to login without first following [this guide](https://github.com/runelite/runelite/wiki/Using-Jagex-Accounts).

![run-test](https://i.imgur.com/tKSQH5e.png)

Expand All @@ -52,30 +55,6 @@ There are two methods to create an external plugin, you can either:

12. When you have your plugin working. Commit your changes and push them to your repository.


### Using the script
1. Navigate to the folder in which you cloned the `plugin-hub` repository.

2. Run the script with:
```
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.

3. Move the generated folder to its own git repository and open the `build.gradle` file in IntelliJ.

4. In order to make sure everything works correctly, try to start the client with your external plugin enabled by running the test. The test requires `-ea` to be added to your VM options to enable assertions, which can be found in IntellIJ in `Run/Debug Configurations` under `Modify options`, `Add VM options`, and then adding `-ea` into the input field which appears.

![run-test](https://i.imgur.com/tKSQH5e.png)

5. Edit `runelite-plugin.properties` with tags. `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.

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. 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 *Add file* (next to the green *Code* button), and choose *Create new file* from the drop-down.
2. In the file name field type *LICENSE* and click the *Choose a license template* button that will appear.
Expand All @@ -102,7 +81,7 @@ commit=9db374fc205c5aae1f99bd5fd127266076f40ec8

7. Write a short description of what your plugin does and then create your pull request.

8. Check the result of your PR's CI workflow. With a ✔️ all is good, however if it has a ❌ next to your commit click it to check the build log for details of the failure. Once you've read over the build error, make the required changes, and push another commit to update the PR with the new `commit=` hash.
8. Check the result of your PR's CI workflow, next to `.github/workflows/build.yml / build (pull_request)` will be either a ✔️ or an ❌. With a ✔️ all is good, however if it has an ❌, click `Details` to check the build log for details of the failure. Along with the build workflow there also may be an ❌ next to `RuneLite Plugin Hub Checks`, you will only need to worry about this if it says `View details for requested changes.`, in that case you should also read over those requested changes. Once you've read over the build error and requested changes, make the required changes, and push another commit to update the PR with the new `commit=` hash.
Don't worry about how many times it takes you to resolve build errors; we prefer all changes be kept in a single pull request to avoid spamming notifications with further newly-opened PRs.

9. Be patient and wait for your plugin to be reviewed and merged.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,11 @@ public void recordClass(int modifiers, String descriptor)
}
}

public void recordClassHierarchy(String from, String superDescriptor)
{
apis.add(from + ">" + superDescriptor);
}

public void recordMethod(int modifiers, String classDescriptor, CharSequence name, String descriptor)
{
if (classDescriptor != null & descriptor != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ public void visit(int version, int access, String name, String signature, String
{
this.className = "L" + name + ";";
api.recordClass(access, className);
api.recordClassHierarchy(this.className, "L" + superName + ";");
for (String iface : interfaces)
{
api.recordClassHierarchy(this.className, "L" + iface + ";");
}
super.visit(version, access, name, signature, superName, interfaces);
}

Expand Down Expand Up @@ -102,7 +107,7 @@ public void recordClass(File jarFile) throws IOException
}
}

public static void main(String ...classes) throws IOException
public static void main(String... classes) throws IOException
{
var cr = new ClassRecorder();
Iterator<String> args = List.of(classes).iterator();
Expand Down
Loading

0 comments on commit f9682d0

Please sign in to comment.