几种语言原生开发环境构建之--Elm语言
2016-08-07 13:23
429 查看
elm安装
$ npm install elm -g $ elm $ elm-repl #repl命令行 $ elm-reactor #浏览器在线调试 $ elm-package #包管理 $ elm-make --help 编译
项目构建
初始化$ mkdir src && mkdir src/Test #源码目录,源代码文件都已大写开头 $ elm-package install #初始化以及安装依赖
配置文件elm-package.json
{ "version": "1.0.0", "summary": "helpful summary of your project, less than 80 characters", "repository": "https://github.com/user/project.git", "license": "MIT", "source-directories": [ "src" ], "exposed-modules": ["First"], "native-modules": true, "dependencies": { "elm-lang/core": "4.0.4 <= v < 5.0.0", "elm-lang/html": "1.1.0 <= v < 2.0.0" }, "elm-version": "0.17.1 <= v < 0.18.0" }
集成测试
配置依赖#elm-package.json 安装依赖 "dependencies": { "elm-lang/core": "4.0.4 <= v < 5.0.0", "elm-lang/html": "1.1.0 <= v < 2.0.0" ,"evancz/elm-markdown":"3.0.0 <= v < 5.0.0" ,"elm-community/elm-test":"1.1.0 <= v < 5.0.0" #测试依赖 ,"evancz/elm-graphics":"1.0.0 <= v < 5.0.0" }
安装依赖
$ elm-package install
测试代码 src/Test/Example.elm
import List import ElmTest exposing (..) tests : List Test tests = [ 0 `equals` 1 , test "pass" <| assert True , test "fail" <| assertNotEqual True False ] ++ (List.map defaultTest <| assertionList [1..10] [1..10]) consoleTests : Test consoleTests = suite "All Tests" tests main = runSuiteHtml consoleTests
开始测试
$ elm-reactor $ firefox http://localhost:8000/src/Test/Example.elm
项目代码
相关文章推荐
- 几种语言原生开发环境构建之--Lua语言
- 几种语言原生开发环境构建之--Typescript语言
- 几种语言原生开发环境构建之--Haskell语言
- 几种语言原生开发环境构建之--Go语言
- 几种语言原生开发环境构建之--Python语言
- 在ubuntu下构建go语言开发环境的方法
- Idea基于scala语言构建spark开发环境搭建
- 配置EditPlus与NAnt构建轻型的.NET开发环境
- 让PHP支持大型项目-构建JSP、PHP与JAVA融为一体的开发环境[转载]
- 几种主流网页开发语言的思考(下)
- 开发国际化程序,在不同语言环境中显示对应的语言
- 在Windows下构建Qt4开发环境(Qt4+Vim)
- [经验]实际构建Symbian开发环境
- 配置EditPlus与NAnt构建轻型的.NET开发环境
- 构建自己的.NET Framework3.0开发环境
- 在多语言环境中构建基于MOSS2007的解决方案
- Asp,PHP,JSP,.Net几种网站开发语言比较
- [转载]让PHP支持大型项目-构建JSP、PHP与JAVA融为一体的开发环境
- 敏捷软件开发基础: 持续集成环境的构建
- 构建Python的桌面开发环境 于2005年07月26日