# Package

bin           = @["strawboss"]
version       = "0.4.0"
author        = "Jonathan Bernard"
description   = "My personal continious integration worker."
license       = "MIT"
srcDir        = "src/main/nim"

# Dependencies

requires @["nim >= 0.16.1", "docopt >= 0.6.5", "isaac >= 0.1.2", "tempfile", "jester", "bcrypt",
           "untar", "uuids"]

# Hacky to point to a specific hash. But there is some bug building in the
# docker image we use to build the project with the next version. It adds an
# ifdef branch to support libssl 1.1 but for some reason that ifdef is set
# wrong and it tries to build against the 1.1 API even though the image only
# has the 1.0 API. I'm crossing my fingers and hoping that our base image
# supports libssl 1.1 before I need to update this library.
requires "https://github.com/yglukhov/nim-jwt#549aa1eb13b8ddc0c6861d15cc2cc5b52bcbef01"

requires "https://git.jdb-labs.com/jdb/nim-lang-utils.git >= 0.3.0"
requires "https://git.jdb-labs.com/jdb/nim-cli-utils.git >= 0.3.1"

# Tasks
task functest, "Runs the functional test suite.":
  exec "nimble build"
  exec "nim c -r src/test/nim/run_functional_tests.nim"

task unittest, "Runs the unit test suite.":
  exec "nimble build"
  exec "nim c -r src/test/nim/run_unit_tests.nim"

task test, "Runs both the unit and functional test suites.":
  exec "nimble build"
  echo "Building test suites..."
  exec "nim c src/test/nim/run_unit_tests.nim"
  exec "nim c src/test/nim/run_functional_tests.nim"
  echo "\nRunning unit tests."
  echo "-------------------"
  exec "src/test/nim/run_unit_tests"
  echo "\nRunning functional tests."
  echo "-------------------------"
  exec "src/test/nim/run_functional_tests"