You are not logged in. Click here to log in.

Application Lifecycle Management

Search In Project

Search inClear

Tags:  not added yet

Accessing and Contributing to the Ages Source Code

Introduction

The Ages source code is stored inside a Git repository. Git is a very powerful tool allowing multiple users to simultaneously change the source code and merge these changes back together. However, this tool can be rather complex to use. The goal of this documentation is to help ease the usage of Git with the Ages repositories.

Git Terminology

  • Repository – A repository is a place where source code or data is stored.
    • A local repository is stored locally on your machine.
    • A remote repository is stored remotely on a server.
  • Cloning – Cloning is the process of downloading a repository and creating a local copy on your machine.
  • Branching – Branching is a technique that allows multiple features to be developed simultaneously and independently of each other. This is done to prevent code that is not fully completed from breaking other code that is working.
  • Fetching – Fetching is the process of checking if there are any changes on the remote repository. This does not modify your local repository. This should be done frequently.
  • Pulling – Pulling is the process of bringing remote changes into the local repository. This step may result in file change conflicts that need to be resolved before proceeding. It is recommended to fetch changes before pulling them. This way you can inspect and changes and see if there may be conflicts. It is also recommended that you do not have any uncommitted changes before pulling.
  • Committing – Committing is the process of documenting and finalized a set of code changes. A commit only affects the local repository and is not shared with other people. All commits exist on one and only one branch. It is recommended that you fetch changes before committing to make sure that your changes are appropriate.
  • Pushing – Pushing is the process in which all your local commits are shared with everyone else. Once your commits have pushed to the remote repository, they are now visible to other users. Also, note that pushed commits are only visible on the branch it was committed to.



Git Flow

Git flow is an extension to Git that facilitates a specific branching model. The Ages model uses this branching model to ease the development of new features. Here is a highlight of the basic branches used.

  • Master – The master branch is considered the stable release version. This branch is only updated when a new release of the model is made.
  • Develop – This main development branch should be able to be run, but it may have occasional issues caused by new features.
  • Feature – A feature branch should contain changes for a feature that is being developed. When someone wishes to modify the 'develop' branch a new feature branch should be created and tested first.

There are more branches in the Git flow model, but these are the basic ones that will be used most frequently.

Git Resources

Git Documentation: https://www.git-scm.com/doc

Git Flow Documentation: https://nvie.com/posts/a-successful-git-branching-model/


Finding a repository

  1. Go to CB:/project/ages/repositories. You may need to log in to see all project repositories.
  2. Select which repository you want from the list
  3. The repository URL should be list in the upper left. The cloning URL is what is needed.

SourceTree a UI for Git


Prerequisites

  1. SourceTree is only available for Windows and Mac. It is not currently available in Linux.
  2. You are going to need a BitBucket account. This can be created during installation.
  3. This guide directs you through the Windows version. It is known that the Mac edition has a different UI appearance and some of the steps may be different.



Installing SourceTree

  1. SourceTree can be downloaded from https://www.sourcetreeapp.com/.
  2. You should be able to install using the default options.



Configuring SourceTree

  1. Select Tools > Options
  2. Adjust your name and email address. Your name should be first and last. Your email address should be your official work email address. This is important as this information is used when you commit changes. This is shown in red on the figure below.
  3. You can disable SSH agent. This is optional, but if left there may be pop ups during startup. This is shown in green on the figure below.
  4. You can set a default folder in which projects should be stored in. This is shown in blue in the figure below.


Cloning a repository

  1. Open a new tab and select clone

  2. Insert the repository URL. The URL for AgES is CB:/git/ages. Also, you should change or adjust the where the repository should be cloned to.

  3. Press the clone button.
  4. Initialize Git Flow. For some projects, this step may not be necessary, but it is for the AgES repository.

  5. Accept the default settings and select OK.



Switching Branches

The list of branches is displayed on the left side. You can change branches by double-clicking on the branch name. This should be done with care if there are any uncommitted changes. If you do not see a branch listed here it needs to be checked out first. Please see the section on checking out branches.

Checking out a branch

  1. Make sure you can view the repository history.

  2. Scroll to find the latest commit on the branch. This can be identified by the tag stating the branch name
  3. Double-click on this entry and select OK.



Creating a new feature branch

  1. Switch to the develop branch
  2. Select the Git flow button in the top right
  3. Select start new feature.

  4. Provide a feature name. It is preferable to use either “-“ or “_” as spaces for names.


Fetching Changes

  1. Select the fetch button on the top bar.

  2. Verify that you are fetching from all remotes and you are prune local branches that are no longer present in the remote repository.



Pulling Changes

  1. Verify that there are not any uncommitted changes.
  2. Verify that you are on the branch that you want to update. (See Switching Branches)
  3. Select the pull button on the top bar.

  4. Verify that you have the correct branch and select Pull.



Creating a Commit

  1. Switch the File Status screen

  2. Review the changes. Select individual files and review the changes.

  3. All the files in the stage section (The top box) will be committed. You need to stage changes by using the “stage selected” and “Stage All” buttons.
  4. Write a commit message in the box at the bottom. Click the commit button when finished.



Pushing Changes

  1. Select push button in the top bar.

  2. Verify that you are pushing to the correct branch and then select Push.



Installing Java


Background

In 2017, Java released version 9. This release came with many structural changes in Java and in Oracle, the company managing Java. Oracle decided to change the license that Java 9 and all future version would be released under. This exasperated the split between the Oracle JDK and Open JDK. Oracle used this new license on Java 8 after update 202.

Prior to Java 9, Java came in two types JDK (Java Development Kit) and JRE (Java Runtime Environment). The JDK is required to compile and develop Java programs. The JRE is needed to run the program. The JRE was always included with JDK and did not need to be downloaded separately. With Java 9 and all versions after there is only the JDK.

The Ages project currently still uses Java 8; however, it is possible to compile and run with the later versions of Java It is also recommended that when developing on Ages that you are using Open JDK or Oracle Java 8 update 202. It is also recommended to use a 64-bit version if you are planning to run Ages with more than 4 GB of memory.

Windows

Recommend Setup

  • Java 8
  • JDK
  • 64-bit
  • Open JDK Installer from Adopt Open JDK
  • Only install one version of Java as multiple version can be difficult to manage which one is being used



Adopt Open JDK

  1. Open https://adoptopenjdk.net/releases.html
  2. Select the Java Version (Java 8 Hotspot)
  3. Select the Operating System (Windows)
  4. Select the Architecture (x64)
  5. Select the installer/manual version of the JDK

  6. If selected the Installer version, run using the default options. If you selected the manual version see Manual Installation section.
  7. By default, the JDK will be installed to C:\Program Files\AdoptOpenJDK\<package>
  8. See Verification section to verify that correct version of Java is installed



Zulu Open JDK

  1. Open https://www.azul.com/downloads/zulu-community/?version=java-8-lts&os=windows&architecture=x86-64-bit&package=jdk
  2. Select the Java Version (Java 8 LTS)
  3. Select the Operating System (Windows)
  4. Select the Architecture (x86 64-bit)
  5. Select the Java Package (JDK)
  6. Select the Installer/manual version of the JDK

  7. If selected the Installer version, run using the default options. If you selected the manual version see Manual Installation section.
  8. By default, the JDK will be installed to C:\Program Files\Zulu\<zulu-jdk>\
  9. See Verification section to verify that correct version of Java is installed



Oracle Open JDK

WARNING Can only download latest version of Java and requires manual installation

  1. Open http://jdk.java.net/
  2. Select the Ready to use JDK

  3. Download the file for the desired Operating System (Windows)

  4. See Manual Installation section.



Oracle JDK 8 Update 202

WARNING Requires the creation of an Oracle Account

  1. Open https://www.oracle.com/java/technologies/javase/javase8-archive-downloads.html
  2. Scroll down to the first section title “Java SE Development Kit 8u202”
  3. Download the installer for the desired Operating System (Windows x64)
  4. Accept the license and follow steps for creating or logging your Oracle Account
  5. Run the installer with the default options
  6. By default, the JDK will be installed to C:\Program Files\Java\<version>
  7. See Verification section to verify that correct version of Java is installed



Manual Installation

Installation

  1. Download the zipped JDK from one of the previous sections
  2. Create a folder for the JDK: Recommend C:\Program Files\Java
  3. Extract the contents of the zipped JDK
  4. Move the extracted contents to the folder created in Step 2
  5. Verify the following example structure: C:\Program Files\Java\<JDK>\bin\java.exe

Setting Environment Variables

WARNING Requires Administrative privileges

  1. Open System Environment variables (Instructions for Windows 10)
    1. Open the start menu (The windows icon on the bottom left of the screen)
    2. Type “env”
    3. Select “Edit the system environment variables”

  2. Click “Environment Variables”

  3. Create a New system environment variable

  4. Name it JAVA_HOME and set the value to your JDK path (e.g. C:\Program Files\Java\<JDK>)

  5. Edit the Path environment variable by selecting Path list entry and selecting Edit
  6. Add a new entry with a value of “%JAVA_HOME%\bin”

  7. See Verification section to verify that correct version of Java is installed



Verification and Troubleshooting

  1. Open a command prompt
    1. Open the start menu (The windows icon on the bottom left of the screen)
    2. Type “cmd”
    3. Select “Command Prompt”
  2. Type “java -version”
  3. If successful you will see Java version information

    If not successful you will see the following. If this occurs, try reinstalling if using a installer. Also see Setting Environment Variables section in Manual Installation section for more guidance

  4. Verify that the correct Java version is detected based on what version you were trying to install

    If the information is not correct, then please make sure to uninstall all other versions of Java.



Installing an Integrated Development Environment (IDE)


Recommend IDE: IntelliJ IDEA


IntelliJ IDEA

  1. Download the Community Edition: https://www.jetbrains.com/idea/download/
  2. Install using the default settings
  3. With IntelliJ open, select Configure > Structure for New Projects.

  4. Click SDKs, and Select “+”

  5. If the JDK is detected then select it, otherwise select add JDK and navigate to the folder where Java was installed
  6. Select OK and return the to the main menu
  7. Select Open or Import and navigate to the AgES repository that was downloaded



Netbeans 8.2

  1. Download the All version of Netbeans: https://netbeans.org/downloads/old/8.2/

  2. Install using the default settings
  3. Select File > Open Project
  4. Navigate and select the AgES repository that was downloaded