Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to you build elixir based app ? #7

Open
slashformotion opened this issue Sep 8, 2022 · 4 comments
Open

how to you build elixir based app ? #7

slashformotion opened this issue Sep 8, 2022 · 4 comments

Comments

@slashformotion
Copy link

I want to create an archlinux package but i can't compile you app

@aerosol
Copy link
Owner

aerosol commented Sep 8, 2022

@slashformotion thanks for your interest!

The only dependency should be community/elixir if I'm not mistaken. To get an executable you'd do the following:

 (yharnam)  /tmp $ g clone git@github.com:aerosol/wb.git
Cloning into 'wb'...
remote: Enumerating objects: 649, done.
remote: Counting objects: 100% (126/126), done.
remote: Compressing objects: 100% (62/62), done.
remote: Total 649 (delta 81), reused 87 (delta 64), pack-reused 523
Receiving objects: 100% (649/649), 11.62 MiB | 5.86 MiB/s, done.
Resolving deltas: 100% (366/366), done.

 (yharnam)  /tmp $ cd wb && mix deps.get && mix escript.build && chmod +x ./wb
Resolving Hex dependencies...
Dependency resolution completed:
Unchanged:
  earmark 1.4.15
  earmark_parser 1.4.13
  ex_doc 0.24.2
  exexif 0.0.5
  exmoji 0.3.0
  file_info 0.0.4
  jason 1.2.2
  libgraph 0.13.3
  makeup 1.0.5
  makeup_elixir 0.15.1
  makeup_erlang 0.1.1
  mimetype_parser 0.1.3
  nimble_parsec 1.1.0
  yamerl 0.8.1
  yaml_elixir 2.7.0
* Getting libgraph (Hex package)
* Getting earmark (Hex package)
* Getting exmoji (Hex package)
* Getting exexif (Hex package)
* Getting file_info (Hex package)
* Getting ex_doc (Hex package)
* Getting yaml_elixir (Hex package)
* Getting yamerl (Hex package)
* Getting earmark_parser (Hex package)
* Getting makeup_elixir (Hex package)
* Getting makeup_erlang (Hex package)
* Getting makeup (Hex package)
* Getting nimble_parsec (Hex package)
* Getting mimetype_parser (Hex package)
* Getting jason (Hex package)
==> earmark_parser
Compiling 1 file (.yrl)
Compiling 2 files (.xrl)
Compiling 3 files (.erl)
Compiling 32 files (.ex)
Generated earmark_parser app
==> libgraph
Compiling 14 files (.ex)
Generated libgraph app
===> Analyzing applications...
===> Compiling yamerl
==> nimble_parsec
Compiling 4 files (.ex)
Generated nimble_parsec app
==> makeup
Compiling 44 files (.ex)
Generated makeup app
==> jason
Compiling 8 files (.ex)
Generated jason app
==> exmoji
Compiling 3 files (.ex)
warning: Jason.decode!/2 defined in application :jason is used by the current application but the current application does not depend on :jason. To fix this, you must do one of:

  1. If :jason is part of Erlang/Elixir, you must include it under :extra_applications inside "def application" in your mix.exs

  2. If :jason is a dependency, make sure it is listed under "def deps" in your mix.exs

  3. In case you don't want to add a requirement to :jason, you may optionally skip this warning by adding [xref: [exclude: [Jason]]] to your "def project" in mix.exs

  lib/exmoji.ex:23: Exmoji

Generated exmoji app
==> yaml_elixir
Compiling 6 files (.ex)
Generated yaml_elixir app
==> earmark
Compiling 9 files (.ex)
Generated earmark app
==> makeup_elixir
Compiling 6 files (.ex)
Generated makeup_elixir app
==> mimetype_parser
Compiling 1 file (.yrl)
Compiling 1 file (.xrl)
Compiling 3 files (.erl)
Compiling 1 file (.ex)
Generated mimetype_parser app
==> file_info
Compiling 2 files (.ex)
Generated file_info app
==> exexif
Compiling 6 files (.ex)
warning: variable "offset" is unused (if the variable is not meant to be used, prefix it with an underscore)
  lib/exexif/tag.ex:14: Exexif.Tag.value/4

Generated exexif app
==> makeup_erlang
Compiling 3 files (.ex)
Generated makeup_erlang app
==> ex_doc
Compiling 23 files (.ex)
Generated ex_doc app
==> wb
Compiling 14 files (.ex)
Generated wb app
Generated escript wb with MIX_ENV=dev
mode of './wb' retained as 0755 (rwxr-xr-x)

 (yharnam) develop* /tmp/wb $ ./wb
Writer's Block

Usage:

    wb [command]

Available commands:

    wb new [layout_root]
    wb gen [layout_root] [build_root] [target_domain]

Examples:

    wb new my-wiki
    wb gen my-wiki /tmp/my-wiki-dev # and navigate to file:///tmp/my-wiki-dev/index.html
    wb gen my-wiki /tmp/my-wiki-prod https://example.com

Let me know if you need any further assistance. Happy to include an AUR package in the docs ❤️

@slashformotion
Copy link
Author

It would be great if you would be so kind as to create releases and tags to make the process of building a PKGBUILD easy.

In the meantime, i just created a script streamline the build process https://gist.github.com/slashformotion/830e509239faeec153faf314ac27736a

@slashformotion
Copy link
Author

BTW: just wanted to say that I love how simple this soft is, I have to clue how the templating system works or how you achieved this in elixir but it works !

@aerosol
Copy link
Owner

aerosol commented Nov 27, 2022

@slashformotion thank you for your kind words. If there's anything missing from the docs I'm open to suggestions on how to make it more approachable. I've just tagged https://github.com/aerosol/wb/releases/tag/0.3.1 - let me know if that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants