2019-03-05 11:09:15 -07:00
|
|
|
defmodule FarmbotCore.Project do
|
2017-12-13 10:59:50 -07:00
|
|
|
@moduledoc "Farmbot project config"
|
|
|
|
|
2018-07-25 16:08:53 -06:00
|
|
|
@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()
|
2019-03-07 14:30:19 -07:00
|
|
|
@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
|
|
|
|
|
2019-04-04 12:42:32 -06:00
|
|
|
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
|