设为首页 加入收藏

TOP

elixir mix 简介(二)
2017-10-09 13:49:48 】 浏览:5572
Tags:elixir mix 简介
> 1.2"
, escript: escript, # 追加 escript 配置 build_embedded: Mix.env == :prod, start_permanent: Mix.env == :prod, deps: deps] end def escript do # 追加 escript 函数,其中设置 main_module [main_module: Sample] end

编译二进制:

$ mix escript.build
Compiled lib/sample.ex
Generated sample app
Consolidated List.Chars
Consolidated Collectable
Consolidated String.Chars
Consolidated Enumerable
Consolidated IEx.Info
Consolidated Inspect
Generated escript sample with MIX_ENV=dev

$ ls -l
total 4824
-rw-r--r--  1 xxxxxx  staff      399  2 17 22:08 README.md
drwxr-xr-x  4 xxxxxx  staff      136  2 17 23:08 _build
drwxr-xr-x  3 xxxxxx  staff      102  2 17 22:08 config
drwxr-xr-x  3 xxxxxx  staff      102  2 17 23:31 lib
-rw-r--r--  1 xxxxxx  staff      738  2 17 23:28 mix.exs
-rwxr-xr-x  1 xxxxxx  staff  2460249  2 17 23:28 sample          # 此为二进制文件
drwxr-xr-x  4 xxxxxx  staff      136  2 17 23:09 test

$ ./sample
hello

$ ./sample "Elixir"
hello
Elixir
首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇栈应用之将二进制转化为十进制,.. 下一篇elixir 入门笔记

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目