host - dev works. fixing target build

pull/259/head
connor rigby 2017-03-02 05:24:13 -08:00
parent 484eb2e9a8
commit cf2cf6cf92
265 changed files with 246 additions and 326 deletions

View File

@ -1 +0,0 @@
apps/farmbot/VERSION

1
VERSION 100644
View File

@ -0,0 +1 @@
3.0.7-staging.1

View File

@ -1,18 +0,0 @@
# App artifacts
/_build
/db
/deps
/*.ez
# Nerves images
/_images
# Generate on crash by the VM
erl_crash.dump
npm-debug.log
ttb_last_config
cover
doc
cache
node_modules

View File

@ -1 +0,0 @@
3.0.7-staging.1

View File

@ -1,40 +0,0 @@
use Mix.Config
target = Mix.Project.config[:target]
env = Mix.env()
mqtt_transport = Farmbot.Transport.GenMqtt
redis_transport = Farmbot.Transport.Redis
config :logger, utc_log: true
# I force colors because they are important.
config :logger, :console, colors: [enabled: true, info: :cyan]
# Iex needs colors too.
config :iex, :colors, enabled: true
# send a message to these modules when we successfully log in.
config :farmbot, auth_callbacks: [mqtt_transport]
# frontend <-> bot transports.
config :farmbot, transports: [mqtt_transport, redis_transport]
# give the ability to start a redis server instance in dev mode.
config :farmbot, :redis,
server: System.get_env("REDIS_SERVER") || false,
port: System.get_env("REDIS_SERVER_PORT") || 6379
# This is usually in the `priv` dir of :tzdata, but our fs is read only.
config :tzdata, :data_dir, "/tmp"
config :tzdata, :autoupdate, :disabled
config :fs, path: "/tmp/images"
# Import configuration specific to out environment.
import_config "#{env}.exs"
# import config specific to our nerves_target
IO.puts "using #{target} - #{env} configuration."
import_config "hardware/#{target}/hardware.exs"
config :nerves, :firmware,
rootfs_additions: "config/hardware/#{target}/rootfs-additions-#{env}"

View File

@ -1,195 +0,0 @@
defmodule Farmbot.Mixfile do
use Mix.Project
@target System.get_env("MIX_TARGET") || "host"
@version Path.join(__DIR__, "VERSION") |> File.read! |> String.strip
@compat_version Path.join(__DIR__, "COMPAT")
|> File.read!
|> String.strip
|> String.to_integer
defp commit() do
{t,_} = System.cmd("git", ["log", "--pretty=format:%h", "-1"])
t
end
def project do
[app: :farmbot,
description: "The Brains of the Farmbot Project",
package: package(),
test_coverage: [tool: ExCoveralls],
version: @version,
target: @target,
archives: [nerves_bootstrap: "~> 0.2.0"],
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
build_path: "../../_build/#{@target}",
deps_path: "../../deps/#{@target}",
images_path: "../../images/#{@target}",
config_path: "../../config/config.exs",
compilers: Mix.compilers ++ maybe_use_webpack(),
lockfile: "../../mix.lock",
aliases: aliases(@target),
deps: deps() ++ system(@target),
preferred_cli_env: [
vcr: :test, "vcr.delete": :test, "vcr.check": :test, "vcr.show": :test,
"all_test": :test,
"coveralls": :test, "coveralls.detail": :test, "coveralls.post": :test, "coveralls.html": :test, "coveralls.travis": :test
],
webpack_watch: Mix.env == :dev,
webpack_cd: ".",
source_url: "https://github.com/Farmbot/farmbot_os",
homepage_url: "http://farmbot.io",
docs: [main: "Farmbot",
logo: "../../docs/farmbot_logo.png",
extras: ["../../docs/BUILDING.md",
"../../docs/FAQ.md",
"../../docs/ENVIRONMENT.md",
"../../README.md"]]
]
end
def package do
[name: "Farmbot OS",
maintainers: "Farmbot.io",
licenses: "MIT"]
end
def application do
[mod:
{Farmbot,
[%{target: @target,
compat_version: @compat_version,
version: @version,
commit: commit()}]},
applications: applications() ++ applications(@target),
included_applications: [:gen_mqtt, :ex_json_schema, :fs] ++ included_apps(Mix.env)]
end
defp included_apps(:prod), do: [:ex_syslogger]
defp included_apps(_), do: []
# common for test, prod, and dev
defp applications do
[
:logger,
:nerves_uart,
:poison,
:rsa,
:httpoison,
:nerves_lib,
:runtime_tools,
:mustache,
:vmq_commons,
:amnesia,
:gen_stage,
:plug,
:cors_plug,
:cowboy,
:quantum, # Quantum needs to start AFTER farmbot, so we can set up its dirs
:timex, # Timex needs to start AFTER farmbot, so we can set up its dirs,
]
end
defp applications("host"), do: []
defp applications(_system), do: [
:nerves_interim_wifi,
:nerves_firmware_http,
:nerves_ssdp_server
]
defp deps do
[
# Hardware stuff
{:nerves_uart, "0.1.1"}, # uart handling
{:nerves_lib, github: "nerves-project/nerves_lib"}, # this has a good uuid
# http stuff
{:poison, "~> 3.0"},
{:ex_json_schema, "~> 0.5.3"},
{:httpoison, github: "edgurgel/httpoison", override: true},
{:rsa, "~> 0.0.1"},
# MQTT stuff
{:gen_mqtt, "~> 0.3.1"}, # for rpc transport
{:vmq_commons, "1.0.0", manager: :rebar3}, # This is for mqtt to work.
# string templating
{:mustache, "~> 0.0.2"},
# Time stuff
{:timex, "~> 3.0"}, # managing time. for the scheduler mostly.
{:quantum, ">= 1.8.1"}, # cron jobs
# Database
{:amnesia, github: "meh/amnesia"}, # database implementation
# Log to syslog
{:ex_syslogger, "~> 1.3.3", only: :prod},
# Other stuff
{:gen_stage, "0.11.0"},
# Test/Dev only
{:credo, "0.6.0-rc1", only: [:dev, :test]},
{:ex_doc, "~> 0.14", only: :dev},
{:dialyxir, "~> 0.4", only: [:dev], runtime: false},
{:faker, "~> 0.7", only: :test},
{:excoveralls, "~> 0.6", only: :test},
{:exvcr, "~> 0.8", only: :test},
{:mock, "~> 0.2.0", only: :test},
# Web stuff
{:plug, "~> 1.0"},
{:cors_plug, "~> 1.1"},
{:cowboy, "~> 1.0.0"},
{:ex_webpack, "~> 0.1.1", runtime: false, warn_missing: false},
{:tzdata, "~> 0.1.201601", override: true},
{:fs, "~> 0.9.1"}
]
end
# TODO(connor): Build this into `:ex_webpack`
defp maybe_use_webpack() do
case System.get_env("NO_WEBPACK") do
"true" -> []
_ -> [:ex_webpack]
end
end
# this is for cross compilation to work
# New version of nerves might not need this?
defp aliases("host"), do: [
"firmware": ["compile"],
"firmware.push": ["farmbot.warning"],
"credo": ["credo list --only readability,warning,todo,inspect,refactor --ignore-checks todo,spec"],
"all_test": ["credo", "coveralls"],
"travis_test": ["credo", "coveralls.travis"]
]
# TODO(Connor) Maybe warn if building firmware in dev mode?
defp aliases(_system) do
["deps.precompile": ["nerves.precompile", "deps.precompile"],
"deps.loadpaths": ["deps.loadpaths", "nerves.loadpaths"],
"firmware.upload": ["farmbot.upload"]]
end
# the nerves_system_* dir to use for this build.
defp system("host"), do: []
defp system(sys) do
if File.exists?("../NERVES_SYSTEM_#{sys}"),
do: System.put_env("NERVES_SYSTEM", "../NERVES_SYSTEM_#{sys}")
# if the system is local (because we have changes to it) use that
if File.exists?("../nerves_system_#{sys}"),
do: [
{:"nerves_system_#{sys}", in_umbrella: true, warn_missing: false},
{:nerves_interim_wifi, "~> 0.1.1"},
{:nerves_firmware_http, github: "nerves-project/nerves_firmware_http"},
{:nerves_ssdp_server, "~> 0.2.1"},
],
else: Mix.raise("There is no existing system package for #{sys}")
end
end

View File

@ -1,13 +0,0 @@
{
"nouns" : [
{"fav_song_link": "https://www.youtube.com/watch?v=d4nbfPZa9Ws"},
{"fav_activity": "gardening"}
],
"verbs" : [
"is listening to :musical_score: {{fav_song_link}}",
"is jamming out to {{fav_song_link}} :musical_score:",
"is doing my favorite activity {{fav_activity}}",
"wants to know when it should water it's plants? :sweat_drops: :sweat_drops:",
"is getting kind of bored... :clock830: :zzz:"
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

View File

@ -1,2 +1,40 @@
use Mix.Config
import_config "../apps/*/config/config.exs"
target = Mix.Project.config[:target]
env = Mix.env()
mqtt_transport = Farmbot.Transport.GenMqtt
redis_transport = Farmbot.Transport.Redis
config :logger, utc_log: true
# I force colors because they are important.
config :logger, :console, colors: [enabled: true, info: :cyan]
# Iex needs colors too.
config :iex, :colors, enabled: true
# send a message to these modules when we successfully log in.
config :farmbot, auth_callbacks: [mqtt_transport]
# frontend <-> bot transports.
config :farmbot, transports: [mqtt_transport, redis_transport]
# give the ability to start a redis server instance in dev mode.
config :farmbot, :redis,
server: System.get_env("REDIS_SERVER") || false,
port: System.get_env("REDIS_SERVER_PORT") || 6379
# This is usually in the `priv` dir of :tzdata, but our fs is read only.
config :tzdata, :data_dir, "/tmp"
config :tzdata, :autoupdate, :disabled
config :fs, path: "/tmp/images"
# Import configuration specific to out environment.
import_config "#{env}.exs"
# import config specific to our nerves_target
IO.puts "using #{target} - #{env} configuration."
import_config "hardware/#{target}/hardware.exs"
config :nerves, :firmware,
rootfs_additions: "config/hardware/#{target}/rootfs-additions-#{env}"

View File

@ -26,6 +26,7 @@ clean:
\trm -rf apps/farmbot/node_modules
\trm -rf apps/farmbot/cache
\trm -rf apps/nerves_system_br
\trm -rf apps/farmbot/cover
\trm -rf deps
\trm -rf _build
\trm -rf images

Some files were not shown because too many files have changed in this diff Show More