farmbot_os/farmbot_core/lib/farmbot_core/project.ex

36 lines
881 B
Elixir
Raw Normal View History

2019-03-05 11:09:15 -07:00
defmodule FarmbotCore.Project do
2017-12-13 10:59:50 -07:00
@moduledoc "Farmbot project config"
@version Mix.Project.config[:version] || Mix.raise("Missing Project key version")
@commit Mix.Project.config[:commit] || Mix.raise("Missing Project key commit")
@branch Mix.Project.config[:branch] || Mix.raise("Missing Project key branch")
2019-01-25 10:49:52 -07:00
@target Mix.target()
2017-12-13 11:32:00 -07:00
@env Mix.env()
@target Mix.target()
2017-12-13 10:59:50 -07:00
2018-12-12 14:13:47 -07:00
@external_resource ".git"
2017-12-13 10:59:50 -07:00
@doc "*#{@version}*"
@compile {:inline, version: 0}
def version, do: @version
@doc "*#{@commit}*"
@compile {:inline, commit: 0}
def commit, do: @commit
2018-11-21 17:20:11 -07:00
@doc "*#{@branch}*"
@compile {:inline, branch: 0}
def branch, do: @branch
def arduino_commit, do: FarmbotFirmware.Project.arduino_commit()
2018-01-05 11:16:36 -07:00
2017-12-13 10:59:50 -07:00
@doc "*#{@target}*"
@compile {:inline, target: 0}
def target, do: @target
2017-12-13 11:32:00 -07:00
@doc "*#{@env}*"
@compile {:inline, env: 0}
def env, do: @env
2017-12-13 10:59:50 -07:00
end