LateralGM:Developing

From ENIGMA
Jump to navigation Jump to search

Before helping to develop LateralGM (or LGM), it helps to understand what it is first, so be sure to read the LateralGM page, and especially read the LateralGM:Building page, as that will give you instructions on how to obtain the necessarily development tools, and how to set it up the officially recognized way that actually lets you Build it (in other words, if you do it another way, you're pretty much on your own for figuring out how to build it).

LateralGM's lead developer is User:IsmAvatar. For developing LateralGM, she is invaluable for understanding the internal workings, assigning or recommending specific areas that need to be worked on, helping develop certain areas, applying patches, or obtaining Commit privileges to the repository.

Prerequisites

Notice that developers do not necessarily need to be able to Build LateralGM, so many of the build tools, like Batik and Ant, are entirely optional. What is necessary, however, is Eclipse and the Java JDK, and some way to fetch the LGM source code, such as Git.

  • The JDK is obviously necessary because LGM is written in Java, and the JDK is used to compile source code into Java bytecode so that it can be run. Recommended either OpenJDK or Oracle Sun JDK. Obviously OpenJDK is awesomer because of its openness.
  • Eclipse is our IDE of choice. Our project layout, formatting options, and everything else is set up for use with Eclipse. While it's technically not necessary, going without it is about as easy as writing a game in Assembly. You can use another IDE if you'd like, but again, it probably won't be able to pick up all our settings, so you'll be on your own.
  • Git is used to allow us to keep track of changes and to allow multiple people to work on LGM at the same time. It is used to fetch LGM for the first time, and used to update LGM's source code to the latest. Without it, you will need to fetch LGM some other way, which could be an outdated copy, and any changes that you make may conflict with other developer copies - all problems that Git solves for us. Note that Git can also be used to fetch ENIGMA's source code. You may use EGit in place of Git, or in addition to it.

Getting LateralGM into Eclipse

There are a few ways to load LGM into Eclipse.

  • The preferred way is by doing an checkout from the repository, as this will ensure that you have the latest version, and makes it very easy to update whenever someone commits changes, as well as being easy to commit your changes if you have commit privileges. Instructions to that effect can be found at LateralGM:Building#Checking out LateralGM.
  • An alternative method is loading an existing copy of LGM, such as a jar, zip, or folder/directory. This method is usually most useful if you don't have internet access. It can also be used if the repository server is down, but usually in those cases you would simply wait for the server to come back up again. Instructions for this method can be found at LateralGM:Developing:Import.

Package Hierarchy

Once you have the prerequisites and have checked out LateralGM, you will now need to be able to navigate it. We've designed a page on LateralGM:Packages just for that purpose.

Making Changes

Once you are familiar with LateralGM and ready to start making changes, it would be wise to fork the project. This gives you your own copy of the repository that you can commit and push your changes to without interfering with the developers. Once you have a set of changes that you are happy with, you can then submit those changes from your fork to the original repository for review, where they may be accepted.

Alternatively, you may submit a diff of your changes to one of the developers responsible for the project. This is useful for smaller changes, and if you don't plan to develop much. Otherwise, you're generally encouraged to go the Github route because it makes this process a lot more modular.

Fork

First, you will need a Github account, if you don't already have one. Creating an account is simple, and it means that Github will allow you to host project repositories (and forks) on their site.

Once you are logged in, forking is as simple as visiting our repository: https://github.com/IsmAvatar/LateralGM and then clicking the "Fork" button. Now you have your very own fork.

Near the top of the page, you will see a URI that looks like git@github.com:UserName/enigma-dev.git. This is your fork's repository URI, which you will be using very shortly.

Switching your working copy to the fork


I don't know how to do this. Someone who figures out how to do this should update this section.

It probably involves something with git remote set-url origin git@github.com:Username/LateralGM.git

Submitting

Submitting changes from your fork to the main repository is called a Pull Request. Github has instructions for how to do it here: http://help.github.com/send-pull-requests/

Please make sure that you have committed *AND* pushed your changes to your forked Github repository. Otherwise, there won't be any changes to submit!


If you become a frequent and trusted developer, you'll probably even be granted access to the main LateralGM repository. We would love to have you on board.