Skip to content

Commit

Permalink
- Added an option to skip conan when only refereshing the project
Browse files Browse the repository at this point in the history
- Added documentation for new features!
  • Loading branch information
Ohjurot committed Sep 2, 2024
1 parent d7505f6 commit 3608657
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
3 changes: 2 additions & 1 deletion BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ The above commands also fully work on windows (use `mox` or `mox.bat` instead of

## Actions
The project provides the following actions. You can run them with the mox tool (`mox` or `mox.bat` on Windows. `./mox.sh` on linux):
- **init**: This command will initialized the repository. On windows it will generate a solution, on linux Makefiles.
- **init**: This command will initialized the repository. On windows it will generate a solution, on linux Makefiles. Will acquire all external libs via conan (Can be skipped to only run premake5). Usage: `./mox.bat/sh init [skip_conan]`.
- **build**: This command will build the project. Usage: `./mox.bat/sh build [conf]`.
- **deploy**: This command will deploy a build. Usage: `./mox.bat/sh deploy [conf]`.
- **clean**: This command will remove all regenerateable files of a certain category. Usage `./mox.bat/sh clean [type]` Where type can be (`output`, `project`, `dependencies`, or `all`. Defaults to `output`).
- **run**: This will automatically run a specific executable in the correct working dir. Usage `./mox.bat/sh run [-c=Debug/Release/...] EXE [args...]`.
- **autogen**: Will automatically run `init`, `build` and `deploy`.
- **test**: Will run `init`, `build` (Release by default) and automatically invoke the `unittest` executable. The script will return the return code of the test application. Usage `./mox.bat/sh test [Debug/Release/...]`.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# MoxPP
C++ Template Repository with Conan2 and Premake5 for Windows and Linux.
C++ Template Repository with Conan2 and Premake5 for Windows and Linux. Out of the Box unit-testing and GitHub actions.

**Please make sure to read the WHOLE readme and follow all instructions!**

Expand All @@ -8,6 +8,7 @@ C++ Template Repository with Conan2 and Premake5 for Windows and Linux.
- `Windows` for `Windows`
- `Linux` for `Linux`
- The project only support `x64` builds
- The project uses GitHub Actions by default. Delete them if you don't want them. We will NOT cover any costs or results occurred because of actions or code shipped with this template! MIT Licenses also applies here!

## Dependencies
Before you are getting started make sure to install the following applications:
Expand All @@ -33,6 +34,8 @@ After you used this template for creating your new project please make sure to f
- [ ] In case you modified any of the build steps (Scripts themselves), make sure to change `BUILDING.md` so that it's still correct.
- [ ] Adding your own scripts: You can add your own python scripts by adding them to the `./scripts` folder. You can run the script with the mox tool `mox.bat <SCRIPT_NAME>` working dir is the repository root. Make sure to your script to the list of actions in `BUILDING.md`.
- [ ] Choosing your desired license. Make sure to add a license to the repository. All files that are copyright by us have already been marked with a license and thus are fine. This is no legal advice! Consult your lawyer!
- [ ] Disable unit-testing when required. By default we provide a dummy unit test, we encourage the use of unit-tests! If you don't want them you can disable them in `mox.lua` and delete the `test` directory. You can also modify the building of unit tests or the library. MoxPP is shipped with gtest but has no hard requirements on it.
- [ ] Verify the usage of GitHub actions. We provide GitHub actions that build and test the codebase. Please make sure to delete the workflow files or disable action, in case you don't want to uses them!
- [ ] Now you can shall remove this readme file and replace it with your description of your project.

**There is more information in** `BUILDING.md` **(That you should keep) on how to build the project.**
Expand Down
11 changes: 8 additions & 3 deletions scripts/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Project initialization script
This will initialize your VisualStudio solution / Your makefile
Copyright (c) 2023 Moxibyte GmbH
Copyright (c) 2024 Moxibyte GmbH
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -84,9 +84,14 @@ def ConanBuild(conf):
# Download tool applications
DownloadPremake()

skipConan = False
if len(sys.argv) > 1 and sys.argv[1] == 'skip_conan':
skipConan = True

# Generate conan project
subprocess.run(ConanBuild('Debug'))
subprocess.run(ConanBuild('Release'))
if not skipConan:
subprocess.run(ConanBuild('Debug'))
subprocess.run(ConanBuild('Release'))

# Run premake5
premakeGenerator = GetPremakeGenerator()
Expand Down

0 comments on commit 3608657

Please sign in to comment.