How do I tell rebar3 to use werl on Windows? - erlang

This may apply to any rebar commands but it is mostly about rebar shell.
By default rebar uses erl and this might be clunky on Windows shells.

According to this source
You can run rebar3 (and any other escript) with werl by specifying the
ESCRIPT_EMULATOR environment variable. In a Git bash that would be:
ESCRIPT_EMULATOR=werl rebar3 shell

Related

Does Bazel actually require Python?

The Bazel install instructions say that Python is required. However, I used the Linux installer without Python and it seems to work.
Does Bazel actually require Python for non-Python builds, such as C++ and Go?
I believe it doesn't, and your success to build without Python proves that.

Load test directory into the rebar3 shell

When I boot up a rebar3 shell I can't access any of the modules in my test/ directory. I would like to try out some of the helper functions I've written there, how can I do it?
With rebar3 tests are run under the test profile, so run your shell with that profile:
rebar3 as test shell

How to run cassandra erlang client through command line?

I could not build and test following cassandra erlang client in ubuntu. https://github.com/matehat/cqerl#connecting.How to do it?
Can you do the following:
git clone https://github.com/dieswaytoofast/erlang_cassandra.git
cd erlang_cassandra
rebar get-deps
rebar compile
Note: I am new to Erlang and Cassandra

Easy way of loading project's Rebar dependencies in Erlang shell

I've got a project that uses Rebar as build tool. When developing, I would like all my app dependencies that are specified in Rebar.config be compiled & loaded in the shell as easy as possible. I'm using the Erlang shell in Emacs. What's a quick way to do this?
I'm not using Emacs so I may miss the Emacs-specific side of your question, but when I want an Erlang shell with all my rebar dependencies loaded, I use:
erl -pa ebin deps/*/ebin
./rebar shell
should load all your dependencies.

Installing Ant on Cygwin

I'm having some trouble figuring out how to install Ant on Cygwin. I want to use Ant to build Nutch. I've looked through a bunch of tutorials but I can't find anything that is low level enough for me to understand. I need something like...
Download ant, put it here
Open Cygwin
type "export ANT_HOME=..."
...
Can anyone help me out here?
Assuming you have a JDK already installed, you can do this:
$ export ANT_HOME=/cygdrive/c/apache-ant-1.7.1
which assumes you've unzipped Ant into C:\apache-ant-1.7.1. Then:
$ export PATH=$ANT_HOME/bin:$PATH
$ ant -version
Apache Ant version 1.7.1 compiled on June 27 2008
In Windows, add the path to your ant /bin directory to the Path system variable. This can easily be done by right clicking on Computer > Properties > Advanced System Settings > Environment Variables, click on Path in the System Variables, click on Edit and add ; followed by the path to your ant bin directory to the end of the Variable value.
Start or restart Cygwin.
Type ant -version The version should be displayed.
Here's a step-by-step guide:
simply download and unzip ANT binaries say into c:\apache-ant-1.8.1
download and unzip NUTCH sources say into: c:\apache-nutch-1.2
open the command prompt and run the following:
cd c:\apache-nutch-1.2
c:\apache-ant-1.8.1\bin\ant
the same would work from the Bash shell, just use Cygwin-style paths:
cd /cygdrive/c/apache-nutch-1.2
./cygdrive/c/apache-ant-1.8.1/bin/ant
That's it, you will find a new directory build containing the output.
For convenience, you might want to add the Ant bin directory to the PATH environment variable so that you don't have to give the full path each time, but that's optional.
BTW I just did those exact steps, and all went fine.
Finally, follow this tutorial to get started.

Resources