Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using termcolor with tipi.build #68

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/tipi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Tipi

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
tipi-build-linux:
runs-on: ubuntu-latest
container: tipibuild/tipi-ubuntu

env:
HOME: /root

steps:
- uses: actions/checkout@v2
- run: mkdir -p ~/.tipi

# checking if the termcolor project itself builds and passes tests
- run: tipi . --dont-upgrade --verbose --test all -t linux-cxx17
- run: tipi . --dont-upgrade --verbose --test all -t linux-cxx20
- run: rm -r ./build

# trying if pulling the dependency with tipi works properly
- run: tipi ./examples/tipi-simple --dont-upgrade --verbose -t linux-cxx17
- run: ./examples/tipi-simple/build/linux-cxx17/bin/example
1 change: 1 addition & 0 deletions .tipi/deps
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
2 changes: 2 additions & 0 deletions .tipi/opts.vs-16-2019-win64-cxx17
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# As per README, probably a sane default
add_compile_definitions( NOMINMAX=1 )
2 changes: 2 additions & 0 deletions .tipi/opts.windows
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# As per README, probably a sane default
add_compile_definitions( NOMINMAX=1 )
14 changes: 14 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@ Installation
* Add ``termcolor.hpp`` (grab it from ``include/termcolor/termcolor.hpp``) to
the project and use stream manipulators from the ``termcolor`` namespace.


* You can also use tipi.build_ to use the library. Just add to your ``.tipi/deps``:

.. code:: json

{
"ikalnytskyi/termcolor": { "@": "v2.0.0" }
}

.. _tipi.build: https://tipi.build/

Replace the content of the ``@`` section to fetch another tag/branch/release or remove it completely to *live at HEAD*.
A sample project can be found in the ``/examples`` folder of this project.

* You can also use vcpkg_ to install the library:

.. code:: sh
Expand Down
3 changes: 3 additions & 0 deletions examples/tipi-simple/.tipi/deps
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ikalnytskyi/termcolor": { "@": "v2.0.0" }
}
22 changes: 22 additions & 0 deletions examples/tipi-simple/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Termcolor example with tipi.build
=================================

This example shows how Termcolor_ can be easily used with tipi.build_.

.. _Termcolor: https://github.com/ikalnytskyi/termcolor
.. _tipi.build: https://tipi.build/

Building the example
--------------------

You can build the example using one of the following commands (depending on your host OS):

.. code:: sh

$ tipi . -t linux
$ tipi . -t macos
$ tipi . -t windows
$ tipi . -t vs-16-2019-win64-cxx17


Use the command ``tipi build . -t <target>`` to execute remote builds for targets not supported by your host OS using tipi.
11 changes: 11 additions & 0 deletions examples/tipi-simple/example.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <iostream>
#include <termcolor/termcolor.hpp>

int main(int /* argc */, char** /* argv */) {
std::cout
<< termcolor::yellow << "Warm welcome to "
<< termcolor::blue << termcolor::underline << "TERMCOLOR"
<< termcolor::bold << termcolor::bright_red << "+tipi.build"
<< termcolor::reset << std::endl;
return 0;
}