1

I have a Leiningen project that is dependent on another Leiningen project. Both are on Github. I cloned the project I am dependent on to the checkouts folder as a Git submodule, which works great in my development environment. I can use the classes from the dependency without even having to add it as a dependency in projects.clj (despite the fact that the documentation says "If you have a project in checkouts without putting it in :dependencies then its source will be visible but its dependencies will not be found").

The main problem is that when I push the project to Heroku, the submodules are cloned automatically but there is no checkouts directory under /app. I guess that Heroku ignores checkouts for some reason.

Presumably I am doing this wrong and there's a right way for me to work in parallel with two Git repos, one of which is dependent on the other. The main issue for me is that I need to be able to deploy my app easily to Heroku. What is the standard way to deal with this situation?

Update: I also noticed that my circle.yml file, which is in the repo, is not in the /app directory. I'm totally confused about what exactly is in the /app directory and where the other stuff disappeared to.

Matthew Gertner
  • 4,487
  • 2
  • 32
  • 54
  • Apparently it's nothing to do with `checkouts`. I moved the submodules to another directory and the behavior is still the same. I can see Heroku find and clone them, and yet they don't show up in `/app`. – Matthew Gertner Oct 21 '14 at 16:34
  • This is how git works. You have to checkout the submodules after the clone, unless you specified the right options while cloning. See http://stackoverflow.com/a/4438292/443992 – PRouleau Nov 10 '14 at 23:36

1 Answers1

1

The problem is that heroku runs lein with-profile production compile :all which ignores checkout dependencies (see https://github.com/technomancy/leiningen/issues/1263).

A possible solution is to add :checkout-deps-shares [:source-paths] to your production profile. It's discouraged (according to heroku engineers you really should use an uberjar in production) but it should do the trick.

Tomas Brambora
  • 1,056
  • 8
  • 17