Keeping dependency versions up to date in Leiningen projects - clojure

Is there a simple way to find out what versions of dependencies are available using Leiningen?
E.g., if I have a web app which depends on Hiccup and Compojure, how can I be sure that I'm on the latest version of each without going to the github page for each?
NOTE: I use Ant and Ivy for building my Java projects, so I have limited knowledge of Maven - so please spell out (or provide Fine Links for me to read) any Maven concepts that Leiningen exposes to me which would help with this (I know that under the hood, Leiningen uses Maven for dependency resolution). Ta.

The Clojure ecosystem has evolved since the original answer was offered. At the present time, I would recommend using lein-ancient:
A Leiningen plugin to check your project for outdated dependencies and plugins. This plugin supersedes lein-outdated and uses metadata XML files in the different Maven repositories instead of a Lucene-based search index. Version comparison is done using version-clj.
Its precursor, lein-outdated, has this helpful message in its README: "lein-outdated is outdated". :)

The canonical way of doing this, at least for dependencies kept in clojars, is the lein-search plugin.
Update: See the highest-rated answer below for a more up-to-date response.

You should have a look at the answer to this question. Leiningen uses the same versioning mechanism as maven so, for example, if you want to use the latest version of a given library, you can substitute the word "LATEST" for the version number. You can also specify a release version or a version range. Again, look at the answer at that link.

Web service that provides this info, along with badges for readmes.
http://clj-deps.herokuapp.com
Disclaimer, by me.

Related

Leiningen and Ivy Repo

I have a large Ivy repo, and would like to use it with leiningen. I've added : :repositories {} to my project.clj file, but it complains that it cannot load the artifact. My normal ant script points to the full url of the repo with the ivy.setting.public.xml file, but am unsure what is the correct syntax for leiningen in this case.
Can leiningen use an Ivy repo?
It's a shame I didn't see this sooner.
At one time I had a branch of the Cake build tool that had almost full Ivy support. I again have a need for this, but since Cake is now deprecated I've had to branch leiningen. I only just started but it works for resolving (including configurations, exclusions, branches, etc).
Right now it's based of the lein2 preview release. I'm not sure how much more work I'll put into it though. I'd like to create a complementary lein-ivy plugin that could add the features of the old Cake version (publishing, dependency reports, multiple publications, etc).

Source code dependency manager for C++

There are already some questions about dependency managers here, but it seems to me that they are mostly about build systems, while I am looking for something targeted purely at making dependency tracking and resolution simpler (and I'm not necessarily interested in learning a new build system).
So, typically we have a project and some common code with another project. This common code is organized as a library, so when I want to get the latest code version for a project, I should also go get all the libraries from the source control. To do this, I need a list of dependencies. Then, to build the project I can reuse this list too.
I've looked at Maven and Ivy, but I'm not sure if they would be appropriate for C++, as they look quite heavily java-targeted (even though there might be plugins for C++, I haven't found people recommending them).
I see it as a GUI tool producing some standardized dependency list which can then be parsed by different scripts etc. It would be nice if it could integrate with source control (tag, get a tagged version with dependencies etc), but that's optional.
Would you have any suggestions? Maybe I'm just missing something, and usually it's done some other way with no need for such a tool? Thanks.
You can use Maven in relationship with C++ in two ways. First you can use it for dependency management of components between each other. Second you can use Maven-nar-plugin for creating shared libraries and unit tests in relationship with boost library (my experience). In the end you can create RPM's (maven-rpm-plugin) out of it to have adequate installation medium. Furthermore i have created the installation for CI environment via Maven (RPM's for Hudson, Nexus installation in RPM's).
I'm not sure if you would see an version control system (VCS) as build tool but Mercurial and Git support sub-repositories. In your case a sub-repository would be your dependencies:
Join multiple subrepos into one and preserve history in Mercurial
Multiple git repo in one project
Use your VCS to archive the build results -- needed anyway for maintenance -- and refer to the libs and header files in your build environment.
If you are looking for a reference take a look at https://android.googlesource.com/platform/manifest.

Is there any Maven like tool that works for many languages?

I'm trying to find a tool like Maven (standardized build & packaging, artifact repo, etc) that supports more than Java (and C/C++), specifically Python and .NET (C#) as well. Especially good dependency management is desired.
We're running a mixed shop of languages at our place, and the current homegrown python-based "über-buildsystem" should probably go away. Note that it doesn't attempt to do detailed builds, just handles dependencies between modules/projects, downloads compiled artifacts (a few hundred megs per library in the C++ case) and invokes msbuild/easy_install/etc on the existing .sln/.vcproj/etc files to get the real build done.
It works, but mostly because I built it and know what it can and cannot do, and I extend it when I need new stuff. It's not really helping the other developers getting in to it, and I feel more and more that we shouldn't focus on that. (Even though it's not that much work and there doesn't seem to be a compelling alternative.)
So:
Python's setuptools only seem to be for Python (and some c++ -> .pyd compilation).
Maven mostly does Java, and some C/C++, mostly for JNI.
For C/C++ there is... nothing? (qmake/cmake for building)
For .NET there are some stuffs, but do they work well outside Visual Studio and the MSFT toolchain?
Building another Maven (but with more flexible support) on top of Ant (using Beanshell mostly) is something I've done already. The current Python-stuff is an offshoot of that.
Update:
Ant+Ivy would require building quite a bit on top, as I indicated above, but it's probably a better foundation than what we have today, since we get more build tasks and an artifact repo out of the box. (See Maven Like dependency management for C++)
All help warmly appreciated!
Try waf.

Release management system for Linux

What we need in our firm is a sort of release management tool for Linux/C++. Our products consist of multiple libraries and config files. Here I will list the basic features we want such system to have:
Ability to track dependencies, easily increase major versions of libraries whose dependencies got their major version increased. It should build some sort of dependency graph internally so it can know who is affected by an update.
Know how to build the products it handle. Either a specific build file or even better - ability to read and understand makefiles.
Work with SVN so it can check for new releases from there and does the build.
Generate some installers - in rpm or tar.gz format. For that purpose it should be able to understand the rpm spec file format.
Currently we are working on such tool which is already pretty usable. However I believe that our task is not unique and there should be some tool out there which does the job.
You should look into using a mix between Hudson, Maven (for build management), Ivy (for dependencies management) and Archiva (for artifacts archival).
Also, if you are looking into cross.compilation, take a look at Make Project Creator (MPC) and Bakefile.
Have fun!!
In the project I'm currently working on we use cmake and other Kitware tools to handle most of this issues for native code (C++). Answering point by point:
The cmake scripts handle the dependencies for our different projects. We have a dependency graph but I don't know if is a home-made script or it is a functionality that cmake provides.
Well cmake generates the makefiles regarding the platform. I generates projects for eclipse cdt and visual studio if it is asked to do so in case of developing.
Cmake has a couple of tools, ctest and cdash that we use to do the daily build and see how the test are doing.
In order to create the installer cmake has cpack. From just one script it can generate tar.gz, deb or rpm files in Linux or an automatically generated NSIS script to generate installers in windows.
For Java code we use maven and hudson that have been already mentioned here.
Take a look at this article from DDJ, in which a more robust build system concept (than make) is presented and implemented. Not sure it will fit well to your requirements, but it's the closest I've ever seen. I was looking for the same thing months ago, and then I discovered the article.
http://www.drdobbs.com/architect/218400678
Maven has a native code plugin. I don't think it'll do everything you want, but it's good at tracking version numbers of dependencies, will build artefacts and it'll work with your VCS.
No idea
cmake/scons: I have used cmake but I don't exactly love it, but I have heard really good things about scons. But scons is python-based, so you need to have python installed on the build/dev machines.
I use Hudson, which has a plugin to fetch from svn. It performs intelligently in general, and in particular builds only if some file has changed in an svn update. Hudson is easy to get started with. Hudson is java-based and is pretty popular with the Java community. This means it is quite cross-platform, but you need to have JRE installed on the build machine.
Probably can call some rpm tool within hudson.

building Debian and Redhat packages with leiningen

Moving my project from Ant to Leiningen went so smoothly that I am looking at new things to include in the build process. one of which would be to automatically create a .deb and .rpm file in the build. What is the easiest way to do this?
I think your best bet would be to write your own Leiningen plugin for this (which I hear is pretty easy), or use the lein-scripts plugin and write a script/task for it.
It would be really great to have a lein plugin to help with this. Since it already uses maven under the hood, you could look into using the maven-unix-plugin (http://mojo.codehaus.org/unix/) which can build .deb and .rpm files. Otherwise if that looks annoying I don't think either package format is especially complex. You could probably do it by hand in Clojure, in which case maybe looking at some example Ruby Rake tasks would help. (http://rubyforge.org/projects/pallet/)
I've come across the same problem. I followed rosejn's suggestion and created a Leiningen plugin that uses the RPM Maven Plugin to create an RPM. I've put it here.