forked from faasm/faabric
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Simon Shillaker
committed
Sep 4, 2020
1 parent
4129c37
commit 24b1ea2
Showing
6 changed files
with
78 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from os.path import dirname, realpath, join, exists | ||
|
||
_PROJ_ROOT = dirname(realpath(__file__)) | ||
|
||
|
||
def Settings(**kwargs): | ||
venv_interpreter = join(_PROJ_ROOT, "venv", "bin", "python") | ||
|
||
if not exists(venv_interpreter): | ||
parent_root = dirname(dirname(_PROJ_ROOT)) | ||
venv_interpreter = join(parent_root, "venv", "bin", "python") | ||
|
||
return {"interpreter_path": venv_interpreter} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,4 +55,4 @@ namespace faabric::endpoint { | |
|
||
httpEndpoint.shutdown(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,11 @@ | |
|
||
from . import build | ||
from . import container | ||
from . import dev | ||
|
||
ns = Collection( | ||
build, | ||
container, | ||
dev, | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
from os import makedirs | ||
from shutil import rmtree | ||
from os.path import join, exists | ||
from subprocess import run | ||
|
||
from invoke import task | ||
|
||
from tasks.util.env import PROJ_ROOT | ||
|
||
|
||
_BUILD_DIR = join(PROJ_ROOT, "build", "cmake") | ||
_BIN_DIR = join(_BUILD_DIR, "bin") | ||
|
||
|
||
@task | ||
def cmake(ctx, clean=False): | ||
if clean and exists(_BUILD_DIR): | ||
rmtree(_BUILD_DIR) | ||
|
||
if not exists(_BUILD_DIR): | ||
makedirs(_BUILD_DIR) | ||
|
||
cmd = [ | ||
"cmake", | ||
"-GNinja", | ||
"-DCMAKE_BUILD_TYPE=Debug", | ||
"-DCMAKE_CXX_COMPILER=/usr/bin/clang++-10", | ||
"-DCMAKE_C_COMPILER=/usr/bin/clang-10", | ||
"../..", | ||
] | ||
|
||
run(" ".join(cmd), shell=True, cwd=_BUILD_DIR) | ||
|
||
|
||
@task | ||
def cc(ctx, target): | ||
run("cmake --build . --target {}".format(target), cwd=_BUILD_DIR, shell=True) | ||
|
||
|
||
@task | ||
def r(ctx, target): | ||
run( | ||
"./{}".format(target), | ||
cwd=_BIN_DIR, | ||
shell=True, | ||
) | ||
|
||
|
||
@task | ||
def test(ctx, name, debug=False): | ||
test_exe = join(_BUILD_DIR, "bin", "tests") | ||
|
||
cmd = [ | ||
test_exe, | ||
"-r console", | ||
name, | ||
] | ||
|
||
run(" ".join(cmd), shell=True, cwd=PROJ_ROOT) |