begin
    require 'json'
    require 'rake/clean'
    require './rakelib/helpers.rb'
rescue LoadError => error
    puts "Import failed (#{error})"
    puts "Please run `bundle install` to bootstrap ruby dependencies"
    exit 1
end

# Build Constants
REPO_ROOT = File.dirname(__FILE__)
ENV_ROOT = File.dirname(REPO_ROOT)
REPORT_DIR = File.join(REPO_ROOT, "reports")

# Environment constants
SERVICE_VARIANT = ENV['SERVICE_VARIANT']
CONFIG_PREFIX = SERVICE_VARIANT ? SERVICE_VARIANT + "." : ""
ENV_FILE = File.join(ENV_ROOT, CONFIG_PREFIX + "env.json")
ENV_TOKENS = File.exists?(ENV_FILE) ? JSON.parse(File.read(ENV_FILE)) : {}

task :default => [:test, :pep8, :pylint]
