Before you start
Before adding my github repo to your IntelliJ project you must have successfully setup the OPRS client and official OPRS plugins. I recommend following these 2 tutorials from the official OPRS wiki:
On the next tutorial, follow all steps until you reach "Using your locally built plugins" section. At this point skip to the running from source section
After successfully completing both tutorials this is what my IntelliJ setup looks like (Note that BOTH the OPRS client and OPRS plugins project are in the same intellij project window. Your project names will vary)
And my OPRS client Run command looks like:
IF YOU CANNOT BUILD AND RUN THE OPRS CLIENT AND OPRS OFFICIAL PLUGINS IN INTELLIJ DO NOT PROCEED BEYOND THIS POINT
Adding the Illumine repo into IntelliJ
Forking
If you think you might add changes or updates to any of the Illumine plugins (iUtils, iPowerskiller etc.) you will need to Fork my repository and use the URL of your fork instead of the URL for this repository when adding it to IntelliJ. To fork my repo, go to my repository in github and click Fork at the top right. Contributing is highly encouraged and what this entire repository and community is about.
New Project
- In IntellIj create a new project using File -> New -> New Project from Version Control
- In the following window provide the URL, Directory and click Clone
-
URL: Your forked repository URL, e.g. : https://github.com/illumineawake/illu-plugins-fork
-
Directory: Your filepath, this can be anything but make sure you know where it is!
-
The project will open in a new IntelliJ window. Wait for it to finish loading (small loading bar down the bottom right) then close this Project window.
-
Back in the IntelliJ project window containing the OPRS client and official OPRS plugins on the Gradle pane (Right-hand side) click the + icon, navigate to where you saved the illu-plugins cloned repo and select build.gradle
-
Edit your OPRS Client Run configuration
- Add your illu-plugins path to your environment variables. Ensure you use a semicolon and no spaces between multiple directories. e.g.
PLUGIN_DEVELOPMENT_PATH=../plugins\;../illu-plugins
7. Add Owain's repo/Chin Break Handler
Spend a brief moment thinking you're done, accept you're wrong, then proceed with:
Repeat steps 1-6 but instead of my repo use Owain's repo. This will add Owain's repository to your IntelliJ OPRS project window and ensure you can use chin-break handler and all plugins that rely on chin break-handler.
The Github URL to create your new project for Owain's is: https://github.com/Owain94/OpenOSRS-external-plugins
The home stretch
If you have successfully completed the above steps in your OPRS IntelliJ project window you should now see:
- OPRS Client
- OPRS Official Plugins
- Illu-plugins
- Owain's external repo containing chin break handler (OpenOSRS-external-plugins)
Your OPRS Client Run command should now include Owain's repo and look similar to:
- In the Gradle sidebar, expand Owain's repo and navigate Tasks -> build -> build -> right click Run
9.After successfully building Owain's repo, you need to run the **publishToMavenLocal **task to allow the other projects to see it. Again under Owain's repo navigate to Tasks -> publishing -> publishToMavenLocal Run this
- Reload All Gradle Projects by clicking the "Refresh" icon in the Gradle pane
YOU MAY RECEIVE A VERSION MISMATCH ERROR ON THE NEXT STEP. IF YOU DO PROCEED TO TROUBLESHOOTING/FAQ (then return to here)
- Now repeat steps 8, 9 and 10 for the Illumine Plugins repo i.e.
- Expand Illumine Plugins - Tasks -> build -> build Run this
- Again under Illumine Plugins - Tasks -> publishing -> publishToMavenLocal Run This
- Reload All Gradle Projects
IF YOU RECEIVE THE BELOW ERROR PROCEED TO TROUBLESHOOTING/FAQ (then return to here)
- Run OPRS Client, if setup correctly all of the OPRS official plugins, Illumine Plugins and Owain's plugins should have loaded. YOU ARE DONE! BUT, you probably want to know how to make your own project that can use iUtils and other plugins like Chin Break Handler. Follow the tutorial below: tutorial to come
FAQ/Troubleshooting
When trying to build I get a "Could not find any version that matches" error
It is important to understand what this error is telling you, you will come across it again. In the screenshot above the error is essentially saying:
I am looking for Version 3.4.5+, but I can only find version 3.5.3. To resolve this we simply need to find where our project is referencing the old version (3.4.5) and tell it to look for the new version (3.5.3)
-
In the Project Panel (left-hand side) right click the Project that is causing the issue. In this case it's illu-plugins, I know this as in the error it is referencing botUtils which is an Illumine Plugins plugin.
-
Click Find In Path...
-
Search the old version number (3.4.5) our project is referencing and it should take you to a file called Dependencies.kt
-
change the old value of 3.4.5 to the new value 3.5.3
You should now be able to successfully build!