O'Reilly logo

Functional Web Development with Elixir, OTP, and Phoenix by Lance Halvorsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding a New Dependency

Now that we have a new Application to act as the web interface, we need to bring the game engine in as a dependency. The interface needs to have access to all the game logic we wrote in the first two parts of the book. In particular, it must be able to see all the public functions in the IslandsEngine.Game module.

This works just like any other dependency in Elixir, and it is about as easy as it can possibly be. Only two steps are involved.

We’ll need to compile IslandsEngine in with the rest of the project as well as start it when we start the IslandsInterface Application.

To make :islands_engine a compile-time dependency, we’ll add it to the deps/0 function in islands_interface/mix.exs:

 defp​ deps ​do
  [
  {​

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required