34 Adding Illumine repo to IntelliJ
illumineawake edited this page 2020-11-21 17:29:11 +11:00

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:

  1. Building the OPRS Client with IntelliJ IDEA

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

  1. Building the official OPRS plugins with IntelliJ IDEA

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) Start Project

And my OPRS client Run command looks like: Start Run Goal

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

  1. In IntellIj create a new project using File -> New -> New Project from Version Control
  2. In the following window provide the URL, Directory and click Clone
  1. 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.

  2. 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 add build.gradle

  3. Edit your OPRS Client Run configuration

Edit Run Config

  1. 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 illu environment run

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)

All setup projects

Your OPRS Client Run command should now include Owain's repo and look similar to: Run with Owain

  1. In the Gradle sidebar, expand Owain's repo and navigate Tasks -> build -> build -> right click Run

Build Owain

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

Owain publishToMavenLocal

  1. Reload All Gradle Projects by clicking the "Refresh" icon in the Gradle pane

Reload All Gradle Projects

YOU MAY RECEIVE A VERSION MISMATCH ERROR ON THE NEXT STEP. IF YOU DO PROCEED TO TROUBLESHOOTING/FAQ (then return to here)

  1. 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) Version Error

  1. 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 Version 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)

  1. 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.

  2. Click Find In Path...

Find in path

  1. Search the old version number (3.4.5) our project is referencing and it should take you to a file called Dependencies.kt

  2. change the old value of 3.4.5 to the new value 3.5.3

Updated version number

You should now be able to successfully build!