[buildout]
show-picked-versions = true
extensions =
    mr.developer

parts =
    instance
    test
# we use tox for testing and linting, by default
#    code-analysis
    coverage
    test-coverage
    createcoverage
    releaser
    i18ndude
    omelette
    robot
    plone-helper-scripts
{{% if vscode_support %}}
    vscode
{{% else %}}
#    vscode
{{% endif %}}

develop = .


[instance]
recipe = plone.recipe.zope2instance
user = admin:admin
http-address = 8080
environment-vars =
    zope_i18n_compile_mo_files true
eggs =
    Plone
    Pillow
    {{{ package.distributionname }}} [test]

[vscode]
recipe = collective.recipe.vscode
eggs = ${instance:eggs}
autocomplete-use-omelette = True

# [code-analysis]
# recipe = plone.recipe.codeanalysis
# directory = ${buildout:directory}/src/{{{ package.namespace }}}
# return-status-codes = False


[omelette]
recipe = collective.recipe.omelette
eggs = ${instance:eggs}


[test]
recipe = zc.recipe.testrunner
eggs = ${instance:eggs}
initialization =
    os.environ['TZ'] = 'UTC'
defaults = ['-s', '{{{ package.dottedname }}}', '--auto-color', '--auto-progress']


[coverage]
recipe = zc.recipe.egg
eggs = coverage


[test-coverage]
recipe = collective.recipe.template
input = inline:
    #!/bin/bash
    export TZ=UTC
    ${buildout:directory}/bin/coverage run bin/test $*
    ${buildout:directory}/bin/coverage html
    ${buildout:directory}/bin/coverage report -m --fail-under=90
    # Fail (exit status 1) if coverage returns exit status 2 (this happens
    # when test coverage is below 100%.
output = ${buildout:directory}/bin/test-coverage
mode = 755


[createcoverage]
recipe = zc.recipe.egg
eggs = createcoverage


[robot]
recipe = zc.recipe.egg
eggs =
    ${test:eggs}
    plone.app.robotframework[debug,reload]


[releaser]
recipe = zc.recipe.egg
eggs = zest.releaser


[i18ndude]
recipe = zc.recipe.egg
eggs = i18ndude

[plone-helper-scripts]
recipe = zc.recipe.egg
eggs =
    plone.staticresources
    ${instance:eggs}
interpreter = zopepy
scripts =
    zopepy
    plone-compile-resources

[versions]
# Don't use a released version of {{{ package.distributionname }}}
{{{ package.distributionname }}} =
