Skip to content

Add more stuff about debugging #661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 47 additions & 2 deletions source/contributing/implementation/debugging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,51 @@ Debugging Sponge Within the IDE

.. note::

This page has not been filled yet by our Documentation Team. If you feel like you can help, you can do so on `our
GitHub repository <https://github.com/spongepowered/spongedocs>`_. Also see the `related GitHub Issue
This documentation is not yet complete see the `related GitHub Issue
<https://github.com/SpongePowered/SpongeDocs/issues/356>`_ for more information on what is required.

Debugging SpongeCommon
======================

By the point you debug, you should already finish making changes in your own branch in your fork (see
:doc:`../howtogit`).

Unfortunately, SpongeCommon exists as an abstract layer to reduce duplicate code between SpongeForge and SpongeVanilla;
thus, it is not for production environments, and you cannot run SpongeCommon directly. However, you can run SpongeForge
or SpongeVanilla with the changes you've applied in SpongeCommon. Below is a description on testing SpongeCommon changes
on SpongeForge.

Assume you have a branch ``fix/foo``, based on ``bleeding`` branch of ``SpongePowered/SpongeCommon``, on your
SpongeCommon fork. You want to test it against the corresponding SpongeForge (or the ``bleeding`` branch of it). The
procedure is as follows: (run the commands below in the Git Gui)

1. Clone SpongeForge repository from GitHub: Find a clean workspace, run
Copy link
Member

@Inscrutable Inscrutable Nov 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if ReST will interpret this as three lists and start each one at 1.. We shall see...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recall @Spongy builds prs automatically. Doesn't it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. appears spongy doesn't like me (no branch 661)

``git clone https://github.com/SpongePowered/SpongeForge`` and ``cd SpongeForge`` so that you are in the folder
of the SpongeForge clone.

2. Check out your SpongeCommon branch in the submodule: Run ``cd SpongeCommon`` to enter the SpongeCommon folder. Run
``git remote add myRemote https://github.com/myAccount/SpongeCommon.git`` (Replace ``myAccount`` with your account or
organization where your SpongeCommon fork is located; replace ``myRemote`` with the choice of your remote name if you
had a different one). Then, run ``git fetch myRemote`` and ``git checkout myRemote/fix/foo`` so that the SpongeCommon
submodule switches to your changes for testing.

3. Run Minecraft client. Run ``cd ../`` to return to the base repo of SpongeForge. Then, run
``./gradlew setupDecompWorkspace`` for the prerequisites of running Minecraft client.

Intellij Idea specific operations:

Close Intellij Idea if it is open.

Run ``./gradlew idea genIntellijRuns`` to generate run configurations for Minecraft client and server.

Once all gradle takes completed, you may open Intellij Idea and sync the Gradle project (click on a blue refresh icon on
the top left of the Gradle window) so that latest changes by gradle tasks are properly reflected.

Go to ``run->Edit Configurations``. You will see a ``Minecraft Client`` and a ``Minecraft Server`` configuration in the
``Application`` section of all available configurations. You need to update the ``use classpath of module`` section for
the configuration you want to run to ``SpongeForge_main`` so that it can run properly.

Before you run the configurations, consider adding some Java System Properties to help debugging, such as `Mixin
Java System Properties <https://github.com/SpongePowered/Mixin/wiki/Mixin-Java-System-Properties>`_.

Finally, you can run the configuration and test the changes.