andytill / erlyberly

erlang tracing for the masses
https://twitter.com/erlyberlytips
GNU General Public License v3.0
694 stars 43 forks source link

We need an initial setup script #43

Closed andytill closed 9 years ago

andytill commented 9 years ago

Problem

Setting up all the dependencies to build erlyberly is a manual task with several steps, I doubt many of the people who clone it reach the end, and I don't blame them.

Solution

Write a shell (bash) script that automates the steps, this should suffice for most environments that erlyberly will be run in.

It should assume erlang, Java8u20 and Maven is installed, since this is platform specific e.g. apt-get, yum, homebrew.

It will need to perform the following tasks:

  1. git clone the floaty-field project, build it and install it to the local cache.
  2. git clone the jinterface directory only form the erlang/otp repo on github. I have investigated this briefly here. jinterface is a very small part of erlang/otp, it would be a much better experience if the entire repo didn't have to be pulled down.
  3. Build it and install the jar to the local Maven cache. The version required in the erlyberly pom.xml is needlessly specific, it can be a version range if this is easier.
  4. But the erlyberly.erl file using erlc.
  5. Build erlyberly including the assembly:single target to create a runnable.
  6. Update the README instructions
  7. Drink beer.

Many of the commands are documented in the README already.

It might be useful to break to break out building the erlyberly.erl file into a separate shell script so it can be run throughout dev, not just as a one-time setup task.

This has some overlap with #27 but doesn't obsolete it. Having Maven build erlyberly.erl can be done later, on top of this work.

hunterboerner commented 9 years ago

How about a build.gradle file to do this?

andytill commented 9 years ago

Yes, maybe. Would it be any better than a shell script?

hunterboerner commented 9 years ago

Yep. Gradle does a lot of things for you automatically. Just declare dependencies and it will install them all.

andytill commented 9 years ago

After thinking about this a lot, I still have a strong preference for a shell script.

The reason is that this script is intended to remove manual steps from the compile process, requiring gradle is adding a manual step. The situation is already pretty bad for the average beam dev who might not have java and maven installed.

hunterboerner commented 9 years ago

Gradle does not need to be installed. You use the gradlew script stored in the repo. It works on windows and unixes.

On Fri, Oct 23, 2015, 1:43 PM Andy Till notifications@github.com wrote:

After thinking about this a lot, I still have a strong preference for a shell script.

The reason is that this script is intended to remove manual steps from the compile process, requiring gradle is adding a manual step. The situation is already pretty bad for the average beam dev who might not have java and maven installed.

— Reply to this email directly or view it on GitHub https://github.com/andytill/erlyberly/issues/43#issuecomment-150659980.

andytill commented 9 years ago

This was desperately needed so I committed a shell script to do it, setup.sh.

I barely know anything about gradle (demonstrated above!) so don't think I can usefully maintain a build script using it, maven is doing an okay job as the build system and I would rather not add new tech if it isn't really required.