Skip to content
Jamie Winsor edited this page Jun 5, 2019 · 2 revisions

Arcadia ships with a built-in package manager compatible with Leiningen.

Arcadia supports developing (and publishing, via Leiningen) multiple Clojure libraries in a single Unity project. Dependencies can be specified either in Assets/configuration.edn or in the project.clj file of any Leiningen project in Assets.

By default, Arcadia will automatically pull in any newly-specified dependencies from Maven when one of these files changes. This happens on a separate thread, and will not block the normal operation of Unity or Arcadia.

Specifying Dependencies

Dependencies may be specified in the user-supplied Assets/configuration.edn with a vector keyed to :dependencies, with the same vector-of-vectors format used by Leiningen.

Arcadia will merge the dependencies declared in Assets/configuration.edn with those declared in all Leiningen project.cljs to compute the final set of dependencies and pull them in from Maven.

Leiningen Projects

Leiningen projects should work correctly in Arcadia. Any directory in the Assets folder that contains a properly-formatted Leiningen project.clj will be considered a Leiningen project. Arcadia will treat the roots of these directories the same way Leiningen does, using :source-paths if it is defined and src otherwise.

For example, say one has a Leiningen project some_lein_project under Assets with the following structure:

Assets
|- some_lein_project
   |- project.clj
   |- src
      |- top_namespace
         |- inner_namespace
            |- core.clj
(require 'top-namespace.inner-namespace.core)

In this case, Arcadia would look in Assets/some_lein_project/src/top_namespace/inner_namespace/core.clj for the corresponding file (and find it).

Arcadia will extract the declared dependencies of a Leiningen project's project.clj and pull them in from Maven, just like running lein deps.

Arcadia libraries can be published the same way you would publish a Leiningen library. Once published, a Leiningen library can be declared as a dependency either in Assets/configuration.edn or the project.clj of a Leiningen project directly under Assets.

There is no guarantee, of course, that a Clojure library which works fine on the JVM will work in Arcadia. Porting JVM libraries to Arcadia is usually fairly easy, however. Libraries with no host interop can usually be ported directly, and C# is similar enough to Java that even porting libraries with heavy interop is often straightforward.

Other Projects

If you need to set the root of a project somewhere else, you can specify it in the Assets/configuration.edn file. Place all paths you wish to consider roots for Clojure namespaces in a vector keyed to :arcadia.compiler/source-paths.

This option is especially useful for cloning repositories into Arcadia that don't have a Leiningen-style structure, and that don't assume their containing directory should be their Clojure namespace root.