-
Notifications
You must be signed in to change notification settings - Fork 514
Development Setup
Some tips and recommendations for people who want to work on AuthMe.
If the org.bukkit
classes are not available as a dependency, ensure that the Maven profile "spigot" is enabled. This adds the Spigot API as dependency to the project. Alternatively, you can enable the "bukkit" profile (be sure to disable "spigot" then). This allows us to easily verify that our code compiles against both APIs.
For local development, you can enable the profile "skipLongHashTests". This disables some of the hash algorithm tests and shaves off a substantial amount of time from the build time.
-
Make sure you are running idea64.exe if on a 64-bit operating system (faster).
-
Maven: if asked to enable auto-import, select it. This will update your dependencies automatically when they are changed in the pom.xml
-
If
@Inject
fields are marked with the "never declared" warning, go to Settings > search "unused declaration," select the Java one and press the button "Configure annotations." Add@Inject
and@InjectDelayed
. -
You can make issue numbers in commit messages clickable by going to Settings > search "issue navigation", add a new rule:
Issue ID: #(\d+)
Issue link: https://github.com/Xephi/AuthMeReloaded/issues/$1
- Do you get an error message "missing argLine" when trying to run unit tests? Go to settings > search "Running Tests" and uncheck "argLine"
IntelliJ has a checkstyle plugin that nicely couples with our use of Code Climate. With the plugin you can perform the same validations in your IDE as is done on remotely on Code Climate.
- Ctrl+Shift+A, type "Plugins" and search for "Checkstyle". If it doesn't appear click on "Search repositories."
- Install Checkstyle-IDEA
- In File > Settings > Other Settings > Checkstyle, add the configuration file (.checkstyle.xml). Don't forget to check the "Active" checkbox.
After this, checkstyle will automatically run on your IDE and rule violations will be shown as warnings.
-
Please fork the AuthMe/AuthMeReloaded repo, NOT the one under Xephi's name. The AuthMe/AuthMeReloaded repo is sometimes hundreds of commits ahead.
-
Tip: add the AuthMe repository to Git. Execute in console:
git remote add upstream https://github.com/AuthMe/AuthMeReloaded.git
. In IntelliJ use Ctrl+Shift+A > "fetch" and you will see the branches of your repository as well as of the AuthMe-Team. -
Do not commit any changes to your master. Use it only to keep in sync with the upstream repo. This way you can always pull new changes from the parent repo into your local master without any conflicts. Then you can merge your local master with your custom branches to keep them up to date.
- If you commit changes to your fork's master directly, you will generate a merge commit every time you pull new changes from AuthMe/AuthMeReloaded into your local master. This creates unnecessary noise in the Git history and generates ugly pull requests.
See Run Configuration to Debug Bukkit/Minecraft Plugin in IntelliJ IDEA on StackOverflow.
If you get ClassDefNotFoundError
, make sure you extract all dependencies into the JAR. Right-click the dependencies on the right and select "Extract Into Output Root." Then move them inside the JAR file.