From 9a12f4129d5043944f62809db8863482eeed9888 Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Tue, 18 Jul 2017 22:13:27 -0400 Subject: [PATCH] Add a basic Elm front-end --- Makefile | 7 +++++++ priv/.gitignore | 2 ++ priv/Makefile | 7 +++++++ priv/elm-package.json | 15 +++++++++++++++ priv/index.html | 8 -------- priv/src/Riichi.elm | 37 +++++++++++++++++++++++++++++++++++++ rebar.config | 10 ++++++++++ 7 files changed, 78 insertions(+), 8 deletions(-) create mode 100644 Makefile create mode 100644 priv/.gitignore create mode 100644 priv/Makefile create mode 100644 priv/elm-package.json delete mode 100644 priv/index.html create mode 100644 priv/src/Riichi.elm diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3f3c256 --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +all: elm + +elm: + $(MAKE) $(MAKE_FLAGS) --directory priv + +clean: + $(MAKE) clean $(MAKE_FLAGS) --directory priv diff --git a/priv/.gitignore b/priv/.gitignore new file mode 100644 index 0000000..79ba1e1 --- /dev/null +++ b/priv/.gitignore @@ -0,0 +1,2 @@ +index.html +elm-stuff diff --git a/priv/Makefile b/priv/Makefile new file mode 100644 index 0000000..d313c3f --- /dev/null +++ b/priv/Makefile @@ -0,0 +1,7 @@ +all: index.html + +index.html: + elm-make --yes src/Riichi.elm --output=index.html --warn + +clean: + rm -rf elm-stuff index.html diff --git a/priv/elm-package.json b/priv/elm-package.json new file mode 100644 index 0000000..2467e86 --- /dev/null +++ b/priv/elm-package.json @@ -0,0 +1,15 @@ +{ + "version": "1.0.0", + "summary": "helpful summary of your project, less than 80 characters", + "repository": "https://github.com/user/project.git", + "license": "BSD3", + "source-directories": [ + "src" + ], + "exposed-modules": [], + "dependencies": { + "elm-lang/core": "5.0.0 <= v < 6.0.0", + "elm-lang/html": "2.0.0 <= v < 3.0.0" + }, + "elm-version": "0.18.0 <= v < 0.19.0" +} diff --git a/priv/index.html b/priv/index.html deleted file mode 100644 index 7d2fa40..0000000 --- a/priv/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - Riichi Mahjong - - -

Riichi Mahjong

- - diff --git a/priv/src/Riichi.elm b/priv/src/Riichi.elm new file mode 100644 index 0000000..adc9cd0 --- /dev/null +++ b/priv/src/Riichi.elm @@ -0,0 +1,37 @@ +module Riichi exposing (..) + +import Html exposing (..) + + +type alias Model = + {} + + +type Msg + = Noop + + +init : ( Model, Cmd Msg ) +init = + ( {}, Cmd.none ) + + +update : Msg -> Model -> ( Model, Cmd Msg ) +update msg model = + ( model, Cmd.none ) + + +main : Program Never Model Msg +main = + program + { init = init + , update = update + , view = view + , subscriptions = \_ -> Sub.none + } + + +view : Model -> Html Msg +view model = + div [] + [ h1 [] [ text "Riichi Mahjong" ] ] diff --git a/rebar.config b/rebar.config index 2e229e5..7580fd8 100644 --- a/rebar.config +++ b/rebar.config @@ -1,5 +1,15 @@ %% -*- mode: erlang -*- +{pre_hooks, + [{"(linux|darwin|solaris)", compile,"make elm"}, + {"(freebsd|netbsd|openbsd)",compile,"gmake elm"}, + {"win32", compile,"make elm"}, + {"(linux|darwin|solaris)", eunit, "make elm-test"}, + {"(freebsd|netbsd|openbsd)",eunit, "gmake elm-test"}, + {"win32", eunit, "make elm-test"}, + {"(linux|darwin|solaris)", clean, "make clean"} + ]}. + {relx, [{release, {riichi, "0.0.1"}, [riichi]}, {dev_mode, true},