Development Environment - pc2ccs/pc2v9 GitHub Wiki

This article describes the environment in which development on PC2 projects takes place. It also contains descriptions of how to do certain development tasks within the development environment.

General

All PC2 projects are stored in Git repositories. Before any developer can contribute to a PC2 project, they must obtain a copy of the relevant Git repository ("repo" for short). The most common (preferred) way of doing this is to go to GitHub, search for the PC2CCS (PC2 Contest Control System) organization, and use the GitHub fork command to create a copy of the relevant repo on GitHub. This (forked) copy can then be cloned onto the developer's local machine.

The majority of PC2 developers use the Eclipse Integrated Development Environment (IDE) for PC2 development. While it is certainly possible to do development in other IDEs (or even using command-line editors and similar tools), developers should be aware that most PC2 projects are organized as Eclipse projects in their respective repos; as a result, using Eclipse makes it easier to follow the project structures.

Building the System

The basic executable form of PC2 comes in a file named pc2.jar. There exists in the PC2 project an Ant "build file" named build.xml which can be used to create a new pc2.jar file. To create a pc2.jar file using build.xml in Eclipse, do the following:

  • Select the build.xml file
  • Right click to bring up context menu
  • Select Run As
  • select "2 Ant Build..."
  • check jar, uncheck other targets/Names
  • Click Run

Distributions

While the pc2.jar file contains the basic executable PC2 system, it does not contain all the ancillary components (such as documentation, execution scripts, etc.) which comprise the common downloadable form of PC2. A complete downloadable PC2 system (including all ancillary components) is referred to as a distribution. To create a complete packaged distribution, execute the Ant file package.xml. This file invokes various commands in build.xml and packages the resulting pc2.jar file together with all the other elements comprising a distribution. The output of package.xml is a complete distribution stored in a folder named "dist" under the PC2 project.

Automatic building of Distributions

Any commit/push to a branch (master or otherwise) causes a distribution to automatically be created. See Continuous Integration and Deployment (CI-CD) for details on this process, including information on the locations where the resulting downloadable distributions can be found.

Testing

Every code change to a PC2 project should be accompanied by a JUnit test stored under the test/ folder. All JUnits should be run prior to pushing any new code changes. See the PC2v9 Wiki page Unit Testing for details on running JUnit tests.

See Also

⚠️ **GitHub.com Fallback** ⚠️