|
1 | | -# Builder Tool, for building, testing, publishing, and deploying projects easily. |
| 1 | +# Builder Tool |
| 2 | + |
| 3 | +## Description |
| 4 | + |
| 5 | +Python script for simplify automatic build, tests, publish and deploy of projects. |
| 6 | +- only one file to create |
| 7 | +- based on python classes |
| 8 | +- easy to use |
| 9 | +- compatible with any language |
| 10 | +- usable in CI/CD pipelines |
| 11 | +- clear logs for debugging |
| 12 | +- build from a temporary directory, so the source code is not modified |
| 13 | +- choose the files you want to export from the build |
| 14 | + |
| 15 | +## Usage |
| 16 | +create a file named `pack.py` in the root of your project with the following content: |
| 17 | + |
| 18 | +```python |
| 19 | +from builderTool import BaseBuilder |
| 20 | + |
| 21 | +class Builder(BaseBuilder): |
| 22 | + def Setup(self): |
| 23 | + pass |
| 24 | + |
| 25 | + def Tests(self): |
| 26 | + pass |
| 27 | + |
| 28 | + def Docs(self): |
| 29 | + pass |
| 30 | + |
| 31 | + def Build(self): |
| 32 | + pass |
| 33 | + |
| 34 | + def BuildTests(self): |
| 35 | + pass |
| 36 | + |
| 37 | + def Publish(self): |
| 38 | + pass |
| 39 | + |
| 40 | +BaseBuilder.execute() |
| 41 | +``` |
| 42 | + |
| 43 | + |
| 44 | +> The `BaseBuilder.execute()` function must be called at the end of the file. |
| 45 | +
|
| 46 | +> You can rename the `Builder` class to any name you want. |
| 47 | +
|
| 48 | +> You can rename the file to any name you want. |
| 49 | +
|
| 50 | +> Remove the methods that you don't need (`Setup` and `Build` are the only required methods). |
| 51 | +
|
| 52 | +run the script with: |
| 53 | +```bash |
| 54 | +python pack.py |
| 55 | +``` |
| 56 | + |
| 57 | +### Options |
| 58 | +use ```python pack.py --help``` to see the available options: |
| 59 | + |
| 60 | +``` |
| 61 | +-h, --help show this help message and exit |
| 62 | + --debug Enable debug messages |
| 63 | + --deep-debug Enable deep debug messages |
| 64 | + --version, -v show program's version number and exit |
| 65 | +
|
| 66 | +Builder options: |
| 67 | + --no-tests Do not run tests |
| 68 | + --no-docs Do not generate documentation |
| 69 | + --publish Publish the package |
| 70 | + --no-clean Do not clean temporary files |
| 71 | + --temp-dir TEMP_DIR Temporary directory (used to generate the package) |
| 72 | + --dist-dir DIST_DIR Distribution directory (where to save the built files) |
| 73 | + -pv PACKAGE_VERSION, --package-version PACKAGE_VERSION |
| 74 | + set the version of the package you want to build |
| 75 | +``` |
| 76 | + |
| 77 | +## Installation |
| 78 | +```bash |
| 79 | +pip install https://github.com/GamuNetwork/devtools/releases/download/1.6.8/build_tool-1.6.8-py3-none-any.whl |
| 80 | +``` |
2 | 81 |
|
3 | | -Current version : {version} |
|
0 commit comments