|
1 | 1 | # Java-the-Hutts |
2 | 2 |
|
3 | 3 | <a href="https://zenhub.com"><img src="https://raw.githubusercontent.com/ZenHubIO/support/master/zenhub-badge.png"></a> |
| 4 | +[](https://travis-ci.org/javaTheHutts/Java-the-Hutts) |
| 5 | + |
| 6 | +[]() |
4 | 7 |
|
5 | | -[](https://travis-ci.org/javaTheHutts/Java-the-Hutts) |
| 8 | +Repository for the Java the Hutts team for COS301. |
6 | 9 |
|
7 | | -[]() |
| 10 | +## Setup of development environment |
| 11 | +You will need to install the following pacakges: |
| 12 | + |
| 13 | +- `virtualenv` |
| 14 | +- `pip3.5` |
| 15 | +- `python3.5` |
| 16 | + |
| 17 | +To set up the development environment and be able to use `pybuilder`, execute the following commands: |
| 18 | + |
| 19 | +1. `cd` into this repository. |
| 20 | +2. `virtualenv -p python3.5 venv` (this creates a virtual environment to work in) |
| 21 | +3. `source venv/bin/activate` (this activates the virtual environment in order to use the commands available to it, specifically **PyBuilder**) |
| 22 | +4. `pip3.5 install pybuilder` (installs `pybuilder`). |
| 23 | +5. `pyb install_dependencies` (installs the necessary dependencies for pybuilder) |
| 24 | +6. `pyb` (builds the python project) |
| 25 | + |
| 26 | +When you are finished developing in this environment, simply call `deactivate` in order to exit the virtual environment. |
| 27 | + |
| 28 | +## Building and installing the project |
| 29 | +1. Execute `source venv/bin/activate` (you need only do this once in order to enter your virtual environment). |
| 30 | +2. Execute `make` in the root folder (the folder where `build.py` and `makefile` is located). This builds the project, runs the unit tests, runs the integration tests, lints the files and creates a portable distribution of the project ready for installation, and installs it in the Python environment. |
| 31 | + |
| 32 | +### Extra tasks |
| 33 | +- If you only want to lint the project, run `make lint`. |
| 34 | +- If you only want to run the unit tests, run `make utest`. |
| 35 | +- For only integration testing, run `make itest`. |
| 36 | +- To run both sets of tests only, run `make test`. |
| 37 | +- To skip the linting, run `make build`. This will build and run the tests without linting the files. |
| 38 | + |
| 39 | +Once you are finished, execute the command `deactivate` in order to exit your virtual environment. |
| 40 | + |
| 41 | +## Starting the server |
| 42 | +1. After building and installing the project, run the script `run.py` in the scripts directory to start the server hosting the API. |
| 43 | +2. Requests can then be sent to `http://127.0.0.1:5000/` to use the API. |
| 44 | +3. Refer to the User Manual under `documentation/user-manual` for detailed instructions regarding requests, parameters and return types. |
| 45 | + |
| 46 | +## Directory structure |
| 47 | +``` |
| 48 | +. |
| 49 | +├── documentation |
| 50 | +├── src |
| 51 | +│ ├── integrationtest |
| 52 | +│ │ └── python |
| 53 | +│ ├── main |
| 54 | +│ │ ├── python |
| 55 | +│ │ └── scripts |
| 56 | +│ └── unittest |
| 57 | +│ └── python |
| 58 | +├── target |
| 59 | +│ ├── dist |
| 60 | +│ └── reports |
| 61 | +└── venv |
| 62 | +``` |
| 63 | + |
| 64 | +- All the Python packages and commands necessary for the system can be found in `venv`. This directory and its contents is generated when you create your virtual environment. It should not be necessary for you to edit anything within this directory. |
| 65 | +- `documentation` contains the documentation of the system. This includes all the LateX and PDF files. |
| 66 | +- `target` is generated each time the `pyb` command executed. This directory contains all the generated source code in a structure that is generally used to distribute and install Python applications. Any changes you make here will not be saved when you rebuild the project. |
| 67 | + - `dist` contains the portable distribution and generated source code of the application. |
| 68 | + - `reports` contains all the different reports generated by the unit testing, integration testing and code coverage modules. |
| 69 | +- `src` is where all the source code and resources for the application is stored. This includes runnable scripts, classes, unit tests, integration tests, images, etc. |
| 70 | + - `integrationtest/python` is where all the integration tests can be found. Each file should start with the prefix `itest_` followed by the rest of the filename. |
| 71 | + - `unittest/python` is where all the unit tests can be found. Each file should start with the prefix `test_` followed by the rest of the filename. |
| 72 | + - `main/python` is where all the main source code for the application can be found, such as class and function definitions. |
| 73 | + - `main/scripts` contains all the runnable scripts for the application. This is where you will typically find the entry-point into the application. |
8 | 74 |
|
9 | | -Repository for the Java the Hutts team for COS301 |
| 75 | +## Important files |
| 76 | +- `build.py` contains the configuration used by PyBuilder to build the project. Any plugins and customized build settings are contained in this file. |
| 77 | +- `README.md`. This file explains how the entire system should be built and used. Refer to it before asking any questions about the build process. |
0 commit comments