Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Build tool for mixed Clojure/Java projects
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 71 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Konrad Hinsen  
View profile  
 More options Jul 3 2011, 3:57 pm
From: Konrad Hinsen <konrad.hin...@fastmail.net>
Date: Sun, 3 Jul 2011 21:57:55 +0200
Local: Sun, Jul 3 2011 3:57 pm
Subject: Build tool for mixed Clojure/Java projects
I am looking for a build tool that fulfills the following requirements:

1) Must handle Clojure namespaces that are AOT-compiled.
2) Must handle Clojure namespaces that are not AOT-compiled.
3) Must handle Java source code files.
4) Must handle dependencies in the form of on-disk jar files (not in  
any repository)
5) No XML configuration files.

Candidates that I have tried and found insufficient include
- Leiningen (no dependencies without repositories)
- Cake (doesn't handle Java source files)
- Eclipse/Counterclockwise (doesn't handle AOT compilation)
- ant, maven: XML configuration files
- scons: incomplete Java support, no Clojure support

Is there anything else worth trying?

Thanks in advance,
   Konrad.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
B Smith-Mannschott  
View profile  
 More options Jul 3 2011, 4:36 pm
From: B Smith-Mannschott <bsmith.o...@gmail.com>
Date: Sun, 3 Jul 2011 22:36:45 +0200
Local: Sun, Jul 3 2011 4:36 pm
Subject: Re: Build tool for mixed Clojure/Java projects

Speaking for zero actual experience:
Have you tried Gradle?
http://www.gradle.org/

// ben


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Meikel Brandmeyer  
View profile  
 More options Jul 3 2011, 5:27 pm
From: Meikel Brandmeyer <m...@kotka.de>
Date: Sun, 3 Jul 2011 23:27:10 +0200
Local: Sun, Jul 3 2011 5:27 pm
Subject: Re: Build tool for mixed Clojure/Java projects
Hi,

Am 03.07.2011 um 22:36 schrieb B Smith-Mannschott:

Speaking with a bit of experience: gradle has a check for all of your points, although clojuresque doesn't handle mixed 1) and 2) points. At the moment it's “either or”. Since you are screwed anyway when you have to use AOT-compilation. But I'm open for arguments why one would want to mix points 1) and 2).

Sincerely
Meikel


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Phil Hagelberg  
View profile  
 More options Jul 3 2011, 6:06 pm
From: Phil Hagelberg <p...@hagelb.org>
Date: Sun, 03 Jul 2011 15:06:21 -0700
Local: Sun, Jul 3 2011 6:06 pm
Subject: Re: Build tool for mixed Clojure/Java projects

Konrad Hinsen <konrad.hin...@fastmail.net> writes:
> I am looking for a build tool that fulfills the following requirements:
> 4) Must handle dependencies in the form of on-disk jar files (not in
> any repository)

For the record, leiningen can do this by adding a repository with a
file:/// URL; it's just not documented because I think it's a bad idea.

-Phil


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Wilson MacGyver  
View profile  
 More options Jul 3 2011, 6:11 pm
From: Wilson MacGyver <wmacgy...@gmail.com>
Date: Sun, 3 Jul 2011 18:11:18 -0400
Local: Sun, Jul 3 2011 6:11 pm
Subject: Re: Build tool for mixed Clojure/Java projects
I recommend gradle clojuresque. Our clojure code deploys to WAR. so it's
always AOTed.

but we use features 2,3,4,5 on your list easily.  the project has
java, clojure and
groovy code. it just works.

On Sun, Jul 3, 2011 at 3:57 PM, Konrad Hinsen

--
Omnem crede diem tibi diluxisse supremum.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Anthony Grimes  
View profile  
 More options Jul 3 2011, 7:30 pm
From: Anthony Grimes <disciplera...@gmail.com>
Date: Sun, 3 Jul 2011 16:30:15 -0700 (PDT)
Local: Sun, Jul 3 2011 7:30 pm
Subject: Re: Build tool for mixed Clojure/Java projects

Cake can indeed handle Java source files. Throw them in src/jvm, I believe.
Leiningen and cake can both handle on-disk jar files, but (at least in cakes
case) they need to be installed in the local repository.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ken Wesson  
View profile  
 More options Jul 3 2011, 8:16 pm
From: Ken Wesson <kwess...@gmail.com>
Date: Sun, 3 Jul 2011 20:16:38 -0400
Local: Sun, Jul 3 2011 8:16 pm
Subject: Re: Build tool for mixed Clojure/Java projects

On Sun, Jul 3, 2011 at 6:06 PM, Phil Hagelberg <p...@hagelb.org> wrote:
> Konrad Hinsen <konrad.hin...@fastmail.net> writes:

>> I am looking for a build tool that fulfills the following requirements:

>> 4) Must handle dependencies in the form of on-disk jar files (not in
>> any repository)

> For the record, leiningen can do this by adding a repository with a
> file:/// URL; it's just not documented because I think it's a bad idea.

Why?

One pillar of Clojure philosophy is to get out of the way and let
programmers get the job done, with a minimum of fuss and ceremony.
Unlike Java.

Requiring any project that has dependencies, even if these are only
other local projects, have a repository adds gratuitous ceremony.

And this is especially true if the user has little or no prior
experience setting up and working with repositories, as they grow
their programming skillset. Ordinarily, they would gradually progress
from single-file projects to multi-file projects to projects with
common, locally-installed third-party libraries and/or other local
projects as dependencies, and eventually to projects that use and are
hosted on repositories of some sort. Your "I think it's a bad idea"
amounts to thinking that forcing the third and fourth steps in that
progression to be combined into one single giant leap is a *good*
idea, and I'm rather dubious of any such claim. One new source of
complexity should be mastered at a time, in my view, absent a *very*
good reason, and repositories are definitely a humongous source of
complexity, so an especially strong case can be made that that
*particular* new source of complexity should be tackled separately
from any other.

(Just consider: starting out using repositories requires mastering a
whole new client/server app type on a par with email, newsgroups, ftp,
and the web; then there's all these different hosting alternatives --
maven, github, sourceforge, google code, etc. and sometimes software
of the same name or closely related like maven and git, as well as
other software like rcs, cvs, and svn; then there's the associated
terminology: commits, pull requests, push requesus, branches, masters,
forks, checkouts and checkins, and so forth, not all of them
applicable to each individual variation on the theme; then there's
individual projects' often-partly-unwritten rules regarding forking,
commit access, pull/push requests, and what-have-you; and setting up a
local repository of one's own means installing a server, securing it,
installing a client, learning how to use it, and so on and so forth.

Indeed, a lot of people will never before have installed and secured a
server of any kind in their entire lives, I expect; that itself is
something whose learning I think should probably be tackled
separately, but if you haven't already done something like run your
own listserv or web server (not just site, you own httpd process which
if hacked means your own computer is violated), then starting to use
local version control means tackling that at the same time as a load
of other new and moderately complex things. To which your
recommendation adds a third group of complicated new things. So, it's
not even two *steps* combining into one giant leap; it's a step
followed by an already-fairly-large *leap* combining into one
*ridiculous* leap.)

--
Protege: What is this seething mass of parentheses?!
Master: Your father's Lisp REPL. This is the language of a true
hacker. Not as clumsy or random as C++; a language for a more
civilized age.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Derricutt  
View profile  
 More options Jul 3 2011, 9:29 pm
From: Mark Derricutt <m...@talios.com>
Date: Mon, 4 Jul 2011 13:29:44 +1200
Local: Sun, Jul 3 2011 9:29 pm
Subject: Re: Build tool for mixed Clojure/Java projects

The other option is Polyglot Maven, which hasn't really seen much movement
lately, but gives you maven power without the XML ( clojure source, yaml,
etc. )

http://polyglot.sonatype.org/clojure.html

I'm not sure what the current state is in, and I think since I last
committed to it the clojure support has been updated/rewritten ( I believe
the wiki docs are out of date now as well ).

--
"Great artists are extremely selfish and arrogant things" — Steven Wilson,
Porcupine Tree

On Mon, Jul 4, 2011 at 7:57 AM, Konrad Hinsen <konrad.hin...@fastmail.net>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Steve  
View profile  
 More options Jul 3 2011, 9:51 pm
From: Steve <stephen.a.lind...@gmail.com>
Date: Sun, 3 Jul 2011 18:51:21 -0700 (PDT)
Local: Sun, Jul 3 2011 9:51 pm
Subject: Re: Build tool for mixed Clojure/Java projects
On Jul 4, 10:16 am, Ken Wesson <kwess...@gmail.com> wrote:

> Requiring any project that has dependencies, even if these are only
> other local projects, have a repository adds gratuitous ceremony.

I don't know what it is like with leiningen, but with maven a
"repository" doesn't necessarily mean you're running a client/server
app on a machine - there's a directory (~/.m2/repository) on your
machine that maven checks for artifacts that is considered a local
repository. When you run "mvn install" they get added to this
directory and then your other projects can depend on them.

So if you've already made the leap to using maven with one project,
using it for another is not a big deal.

- Steve


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ken Wesson  
View profile  
 More options Jul 3 2011, 10:01 pm
From: Ken Wesson <kwess...@gmail.com>
Date: Sun, 3 Jul 2011 22:01:49 -0400
Local: Sun, Jul 3 2011 10:01 pm
Subject: Re: Build tool for mixed Clojure/Java projects

OK...ridiculous leap reduced to merely huge leap then, if you only
have to learn 2 of these three things at once: big, interdependent
groups of projects, maven/etc. repository-accessing tools, and server
administration. :)

--
Protege: What is this seething mass of parentheses?!
Master: Your father's Lisp REPL. This is the language of a true
hacker. Not as clumsy or random as C++; a language for a more
civilized age.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Phil Hagelberg  
View profile  
 More options Jul 3 2011, 10:27 pm
From: Phil Hagelberg <p...@hagelb.org>
Date: Sun, 3 Jul 2011 19:27:20 -0700
Local: Sun, Jul 3 2011 10:27 pm
Subject: Re: Build tool for mixed Clojure/Java projects

Encouraging "works on my machine" builds is by definition antithetical to
the very idea of build automation. Leiningen is not a "yes tool".

-Phil
On Jul 3, 2011 5:16 PM, "Ken Wesson" <kwess...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ken Wesson  
View profile  
 More options Jul 3 2011, 10:44 pm
From: Ken Wesson <kwess...@gmail.com>
Date: Sun, 3 Jul 2011 22:44:26 -0400
Local: Sun, Jul 3 2011 10:44 pm
Subject: Re: Build tool for mixed Clojure/Java projects

On Sun, Jul 3, 2011 at 10:27 PM, Phil Hagelberg <p...@hagelb.org> wrote:
> Encouraging "works on my machine" builds is by definition antithetical to
> the very idea of build automation. Leiningen is not a "yes tool".

That presupposes that nobody will ever use leiningen for any case
that's intermediate between, or orthogonal to, "personal project,
single file, no unusual deps, just load in REPL in IDE and use" and
"publicly visible large open source project with many deps that
everyone and his great-aunt should be able to build". For example,
"personal project, many files and local/third party deps" is not
covered and neither is "closed-source project for
small-to-medium-sized company without own version control server". For
the former, and arguably the latter, anything involving the word
"repository" in any way shape or form strikes me as
potentially-unnecessary ceremony. (Larger businesses will presumably
have in-house version control and keep proprietary code bases in a
repository, so there's no issue there. Also, larger businesses can
generally just buy their way out of any problem, inconvenience, or
excess of ceremony by hiring an extra person or two to deal with it.
:) Meanwhile, large FOSS projects all seem these days to have public
version control repositories, either freely provided by sites like
github and sourceforge or, in the most high profile and especially
business-backed cases, their very own server farms with project web
sites and repository.)

--
Protege: What is this seething mass of parentheses?!
Master: Your father's Lisp REPL. This is the language of a true
hacker. Not as clumsy or random as C++; a language for a more
civilized age.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Shantanu Kumar  
View profile  
 More options Jul 4 2011, 1:16 am
From: Shantanu Kumar <kumar.shant...@gmail.com>
Date: Sun, 3 Jul 2011 22:16:40 -0700 (PDT)
Local: Mon, Jul 4 2011 1:16 am
Subject: Re: Build tool for mixed Clojure/Java projects

On Jul 4, 12:57 am, Konrad Hinsen <konrad.hin...@fastmail.net> wrote:

Maven works, but if you don't want XML why not just use Leiningen?
Split your code base into various modules (each module having its own
project.clj) and have a shell script (or PowerShell script if you're
on Windows) to take care of the dependencies while building across
modules.

For example, take this use-case of modules A, B, C and D:

A --> B --> C
    `-> D

(A depends on B and D, B depends on C)

Write a shell script:

--------------------------------
#!/usr/bin/env bash
p_home=`dirname $0`

function mod {
    cd $p_home/modules/$1    # arg is module dir
    lein deps && lein jar && lein install

}

# To build A (all)
mod "C" && mod "B" && mod "D" && mod "A"
--------------------------------

If AOT gives you trouble, factor those source files out into a
dependency module and so on. IMHO this approach gives much more
flexibility than any constrained multi-module feature of a build tool.

Regards,
Shantanu


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ken Wesson  
View profile  
 More options Jul 4 2011, 1:20 am
From: Ken Wesson <kwess...@gmail.com>
Date: Mon, 4 Jul 2011 01:20:10 -0400
Local: Mon, Jul 4 2011 1:20 am
Subject: Re: Build tool for mixed Clojure/Java projects

And this is how leiningen making users jump through hoops to do fairly
simple builds with local dependencies *itself* can encourage "works on
my machine" builds. :) Which is preferable from that stand point,
after all: a leiningen build script or lots of idiosyncratic shell
scripts?

--
Protege: What is this seething mass of parentheses?!
Master: Your father's Lisp REPL. This is the language of a true
hacker. Not as clumsy or random as C++; a language for a more
civilized age.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Phil Hagelberg  
View profile  
 More options Jul 4 2011, 1:27 am
From: Phil Hagelberg <p...@hagelb.org>
Date: Sun, 03 Jul 2011 22:27:41 -0700
Local: Mon, Jul 4 2011 1:27 am
Subject: Re: Build tool for mixed Clojure/Java projects

Ken Wesson <kwess...@gmail.com> writes:
>> For example, take this use-case of modules A, B, C and D:

>> A --> B --> C
>>    `-> D

>> (A depends on B and D, B depends on C)

>> Write a shell script ...

> And this is how leiningen making users jump through hoops to do fairly
> simple builds with local dependencies *itself* can encourage "works on
> my machine" builds. :) Which is preferable from that stand point,
> after all: a leiningen build script or lots of idiosyncratic shell
> scripts?

Off the top of my head:

    (ns leiningen.sub
      (:use [leiningen.core :only [apply-task task-not-found]]))

    (defn sub [task-name & args]
      (doseq [project (projects-in-dir)]
        (apply-task task-name project args task-not-found)))

Implementation of projects-in-dir left as an exercise for the
reader. Shouldn't be more than four lines. Push the lein-subs plugin to
clojars: problem solved in a repeatable, maintainable way.

-Phil


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Konrad Hinsen  
View profile  
 More options Jul 4 2011, 3:14 am
From: Konrad Hinsen <konrad.hin...@fastmail.net>
Date: Mon, 4 Jul 2011 09:14:01 +0200
Local: Mon, Jul 4 2011 3:14 am
Subject: Re: Build tool for mixed Clojure/Java projects
On 3 Jul 2011, at 21:57, Konrad Hinsen wrote:

> I am looking for a build tool that fulfills the following  
> requirements:

> 1) Must handle Clojure namespaces that are AOT-compiled.
> 2) Must handle Clojure namespaces that are not AOT-compiled.
> 3) Must handle Java source code files.
> 4) Must handle dependencies in the form of on-disk jar files (not in  
> any repository)
> 5) No XML configuration files.

Thanks for everyone's suggestions and comments!

Some remarks:

Gradle/clojuresque: I never tried them, but it looks like I should!

AOT compilation: My case is probably a bit complex in this respect. I  
need AOT compilation only because I want to produce an executable jar,  
so there is at least one namespace that must be AOT compiled. For  
building that executable jar, it doesn't matter if everything else is  
AOT compiled as well. But I want to be able to build a standard  
library jar with just the Clojure code to make sure it works with  
future Clojure releases. One solution would be to have two completely  
different builds, one for the executable jar and one for the library  
version, but using the same set of source code files.

On 4 Jul 2011, at 00:06, Phil Hagelberg wrote:

>> 4) Must handle dependencies in the form of on-disk jar files (not in
>> any repository)

> For the record, leiningen can do this by adding a repository with a
> file:/// URL; it's just not documented because I think it's a bad  
> idea.

With absolute filenames in a URL, it's indeed a bad idea because the  
project becomes specific to a machine/installation. What I'd like to  
see instead is a project-local repository, e.g. a "deps" folder with  
jar files and source code directories.

There are several reasons why I want dependencies outside of  
repositories:

1) Simplicity. I want to distribute a single tar file to collaborators  
(who are new to Clojure and the JVM world) containing all dependencies  
and build scripts. I want to tell them "install <name of build tool>,  
take this file, play with the source code, and just type <build-
command> to build an executable". They will struggle with a new  
language and a new environment already, there's no need to add the  
complexities of repositories. To make it worse, we all live behind  
proxies that require messy configuration for tools like Maven.

2) Network independence. I often work without Internet access, and I  
don't want to be blocked at some point because some build tool wants  
to access some repository to see if my version is still current.

3) Confidentiality. Sometimes I work with unpublished code that I  
promised not to give to anyone else. I can't keep that promise if the  
code leaves my machine in any way. For that case, the file:///  
repository would of course be fine.

> On 4 Jul 2011, at 01:30, Anthony Grimes wrote:

>> Cake can indeed handle Java source files. Throw them in src/jvm, I  
>> believe. Leiningen and cake can both handle on-disk jar files, but  
>> (at least in cakes case) they need to be installed in the local  
>> repository.

Having used cake in the past for simpler projects, I know that it can  
handle project-local dependencies. Just add a classpath setting  
to .cake/config (I'd have to look up the exact name of that variable).  
If cake can indeed handle Java code, then it might be just fine for my  
needs.

On 4 Jul 2011, at 03:29, Mark Derricutt wrote:

> The other option is Polyglot Maven, which hasn't really seen much  
> movement lately, but gives you maven power without the XML ( clojure  
> source, yaml, etc. )

> http://polyglot.sonatype.org/clojure.html

Being Maven, this would still require repositories, right? Even a  
local Maven repository is more than I'd like to impose on my  
collaborators.

On 4 Jul 2011, at 07:16, Shantanu Kumar wrote:

> Maven works, but if you don't want XML why not just use Leiningen?
> Split your code base into various modules (each module having its own
> project.clj) and have a shell script (or PowerShell script if you're
> on Windows) to take care of the dependencies while building across
> modules.

I'd prefer one build system to two separate layers, one of which I'd  
write myself. Moreover, most of my dependencies are not projects, but  
simply jar files picked up from various sources.

Thanks again to everyone! I'll look at Java with cake, and also at  
Gradle.

Konrad.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Wilson MacGyver  
View profile  
 More options Jul 4 2011, 3:22 am
From: Wilson MacGyver <wmacgy...@gmail.com>
Date: Mon, 4 Jul 2011 03:22:08 -0400
Local: Mon, Jul 4 2011 3:22 am
Subject: Re: Build tool for mixed Clojure/Java projects
FYI, here is how to add jar deps in gradle for local files, either as
a file or a dir of files

http://stackoverflow.com/questions/2572811/gradle-make-a-3rd-party-ja...

and getting started is at https://bitbucket.org/kotarak/clojuresque/wiki/Home

while the tutorial is written for gradle 1.0.x milestone releases. I
use gradle 0.9.2,
and it works fine for me.

On Mon, Jul 4, 2011 at 3:14 AM, Konrad Hinsen

<konrad.hin...@fastmail.net> wrote:
> 1) Simplicity. I want to distribute a single tar file to collaborators (who
> are new to Clojure and the JVM world) containing all dependencies and build
> scripts. I want to tell them "install <name of build tool>, take this file,
> play with the source code, and just type <build-command> to build an
> executable". They will struggle with a new language and a new environment
> already, there's no need to add the complexities of repositories. To make it
> worse, we all live behind proxies that require messy configuration for tools
> like Maven.

--
Omnem crede diem tibi diluxisse supremum.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Meikel Brandmeyer  
View profile  
 More options Jul 4 2011, 3:53 am
From: Meikel Brandmeyer <m...@kotka.de>
Date: Mon, 4 Jul 2011 00:53:12 -0700 (PDT)
Local: Mon, Jul 4 2011 3:53 am
Subject: Re: Build tool for mixed Clojure/Java projects

Hi,

Am Montag, 4. Juli 2011 09:14:01 UTC+2 schrieb konrad...@laposte.net:

> Thanks for everyone's suggestions and comments!

> Some remarks:

> Gradle/clojuresque: I never tried them, but it looks like I should!

> AOT compilation: My case is probably a bit complex in this respect. I
> need AOT compilation only because I want to produce an executable jar,
> so there is at least one namespace that must be AOT compiled. For
> building that executable jar, it doesn't matter if everything else is
> AOT compiled as well. But I want to be able to build a standard
> library jar with just the Clojure code to make sure it works with
> future Clojure releases. One solution would be to have two completely
> different builds, one for the executable jar and one for the library
> version, but using the same set of source code files.

I would do it like this:

Split the source in two parts: the library part and the application
part. This would help to maintain a clean library API, because you
could use your application as “real” customer. You could build both
parts independently if desired and so on.

On the other hand this is not a requirement. You could just as well
have everything in one tree and create two jars from it. But my
gradle-fu is too limited to suggest a quick solution for that way.

First the former way the source layout would be something like this:

root directory of the project
 │
 ├─ build.gradle (see below)
 │
 ├─ lib
 │   │
 │   ├─ build (clojuresque, other stuff needed for buildscript)
 │   │
 │   └─ runtime (your dependencies go here)
 │
 ├─ library (library subproject)
 │
 └─ app (application subproject)

You need only the following central build.gradle. It will build a
normal library jar for the library subproject and a AOT-compiled
jar for the application.

buildscript {
    repositories { flatDir dirs: project.file('lib/build') }
    dependencies { classpath "clojuresque:clojuresque:1.4.1" }

}

subprojects {
    apply plugin: "java"
    apply plugin: "clojure"

    group = "yourGroupGoesHere"
    version = "some.version.number"

    repositories {
        flatDir dirs: project(':').file('lib/runtime').absoluteFile
    }

    dependencies {
        compile "org.clojure:clojure:1.2.1"
    }

}

project(':library') {
    dependencies {
        compile "some.other:library:1.2.3"
        compile "and.another:one:3.2.1"
    }

}

project(':app') {
    aotCompile = true

    // If you want a fat jar with all dependencies included...
    uberjar.enabled = true
    configurations.compile.transitive = true

    dependencies {
        compile project(':library')
    }

    // more stuff here for main class definition etc.

}

Although not completely working out of the box this should give
you a feeling of how things would look like with gradle. So you
can hopefully quickly evaluate whether it is worth a look at all.

I'm open for any support request to get you going with clojuresque.
Mail me or put the discussions on the newly created google
group: http://groups.google.com/group/clojuresque.

Sincerely
Meikel


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ken Wesson  
View profile  
 More options Jul 4 2011, 4:36 am
From: Ken Wesson <kwess...@gmail.com>
Date: Mon, 4 Jul 2011 04:36:18 -0400
Local: Mon, Jul 4 2011 4:36 am
Subject: Re: Build tool for mixed Clojure/Java projects
On Mon, Jul 4, 2011 at 3:14 AM, Konrad Hinsen

<konrad.hin...@fastmail.net> wrote:
> AOT compilation: My case is probably a bit complex in this respect. I need
> AOT compilation only because I want to produce an executable jar, so there
> is at least one namespace that must be AOT compiled. For building that
> executable jar, it doesn't matter if everything else is AOT compiled as
> well. But I want to be able to build a standard library jar with just the
> Clojure code to make sure it works with future Clojure releases. One
> solution would be to have two completely different builds, one for the
> executable jar and one for the library version, but using the same set of
> source code files.

You seem to want to make two things: a library and an application. For
that, I think it's only proper if you have two build scripts, since
you have two build artifacts. Indeed, the application may be better
off depending on the library than directly incorporating its source
code as some of its own.

This is what I meant about avoiding unnecessary ceremony.

> To make it worse, we all live behind proxies that require messy configuration
> for tools like Maven.

> 2) Network independence. I often work without Internet access, and I don't
> want to be blocked at some point because some build tool wants to access
> some repository to see if my version is still current.

The above provide some reasons why the build process should not
*require* an internet connection if all dependencies are already
available locally. I don't have a problem if some build tool checks
for updates, so long as it treats a failed check the same as finding
there's no update, give or take a non-fatal warning or two.

On the other hand, the result on actually finding an update should
probably be a user prompt in interactive mode and a build without the
update in batch mode. Otherwise the update, if it breaks backward
compatibility, could break the build. A build that worked yesterday
and breaks today without one having changed any local files, neither
the build script nor the sources nor anything else, is going to be a
head-scratcher to deal with, and in many contexts time is money.

> 3) Confidentiality. Sometimes I work with unpublished code that I promised
> not to give to anyone else. I can't keep that promise if the code leaves my
> machine in any way. For that case, the file:/// repository would of course
> be fine.

Presumably also for network-independence and avoiding annoying
proxies. But if it needs an absolute path, that may* break the "just
tar up the source tree and mail it to someone" capability and forces
even small collaborative projects to set up and use some kind of code
repository instead. As I've argued elsewhere, repository use scales
poorly at the small-project end, unsurprisingly since repositories
were specifically invented as a tool to make large-scale projects with
huge numbers of collaborators and vast reams of code manageable. Using
a high-falutin' version control system for 12kloc and three developers
is like using a bazooka to swat a fly, a top-of-the-line Oracle
database product on expensive iron to track your personal expenses and
balance your checkbook, or hashmaps instead of arraymaps to store
little three-key objects that number in the tens of thousands. :)

* Unix filesystems seem to be standardized enough in layout that using
absolute paths of \usr\src\whatever and suchlike may be viable.
Except that it won't work for a collaborator whose machine runs
Windows, and, worse, it requires working as root or else letting
unprivileged users create executables in world-readable places -- ick.

> I'd prefer one build system to two separate layers, one of which I'd write
> myself. Moreover, most of my dependencies are not projects, but simply jar
> files picked up from various sources.

Indeed, Maven-based stuff seems oriented around the assumption that
any third-party dependencies you will have, in particular, will
generally be publicly hosted on Maven repositories themselves rather
than just a ten-cent web site or Blogspot article or Facebook page
with a .jar download link. Another case of not scaling well at the
low-size end of things, or at the shallow end of the skill pool or the
low end of the budget scale for that matter. (Setting up a Facebook
profile or a blog on an existing service: free and easy. Uploading a
jar file you built to Rapidshare or some other such site and posting
the link: free and easy. Setting up some kind of publicly-visible code
repository: expensive and complex. Using an existing repository
service site: perhaps free and perhaps less complex, but still fairly
complex.) But this time biting the small-time library's users rather
than its small-time developer...

--
Protege: What is this seething mass of parentheses?!
Master: Your father's Lisp REPL. This is the language of a true
hacker. Not as clumsy or random as C++; a language for a more
civilized age.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Steve  
View profile  
 More options Jul 4 2011, 6:29 am
From: Steve <stephen.a.lind...@gmail.com>
Date: Mon, 4 Jul 2011 03:29:00 -0700 (PDT)
Subject: Re: Build tool for mixed Clojure/Java projects
On Jul 3, 10:01 pm, Ken Wesson <kwess...@gmail.com> wrote:

> OK...ridiculous leap reduced to merely huge leap then, if you only
> have to learn 2 of these three things at once: big, interdependent
> groups of projects, maven/etc. repository-accessing tools, and server
> administration. :)

It's really not that hard. If you use Enclojure/Netbeans there are
wizards for creating maven clojure projects (I assume so for other
IDEs as well). You create one project, write some code, mvn install.
Create another one, right click on the dependency folder, add the
details for the first project and it's ready for you to use. No
repositories to create or manage, maven handles all that stuff for
you.

I wouldn't normally defend maven, but there are some things it does
well and for this sort of simple "local Project A depends on local
Project B" stuff it's a no-brainer (esp. when the IDEs do most of the
config creation work).

- Steve


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ken Wesson  
View profile  
 More options Jul 4 2011, 7:08 am
From: Ken Wesson <kwess...@gmail.com>
Date: Mon, 4 Jul 2011 07:08:53 -0400
Local: Mon, Jul 4 2011 7:08 am
Subject: Re: Build tool for mixed Clojure/Java projects

That's actually a bit worrying. I'm not sure I want a potential
security hole into my computer, such as a repository, being "handled
for me" without having *some* input into the matter. For example if I
intend to use it purely locally I'd want to firewall the port it's
using to make sure it's unreachable from any address other than
127.0.0.1.

On the one hand, manually managing stuff like that is hard, and it's
complex to learn the first time.

On the other, making it *too* simple, at least when it has
implications for the machine's security, is not generally a good
thing.

> I wouldn't normally defend maven, but there are some things it does
> well and for this sort of simple "local Project A depends on local
> Project B" stuff it's a no-brainer (esp. when the IDEs do most of the
> config creation work).

There's also the fact that everything remains simple (maybe too
simple; see above) only so long as you remain inside the cushioned box
of the particular IDE. As soon as you try to do anything else -- tweak
something from vi or Notepad, significantly refactor and rename and
restructure stuff in a manner that changes some file paths, move to or
sync with another machine, share with a collaborator, even just find
the source files to back them up somewhere safe -- you're in the deep
woods, possibly without a good map. :)

--
Protege: What is this seething mass of parentheses?!
Master: Your father's Lisp REPL. This is the language of a true
hacker. Not as clumsy or random as C++; a language for a more
civilized age.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Shantanu Kumar  
View profile  
 More options Jul 4 2011, 7:25 am
From: Shantanu Kumar <kumar.shant...@gmail.com>
Date: Mon, 4 Jul 2011 04:25:31 -0700 (PDT)
Local: Mon, Jul 4 2011 7:25 am
Subject: Re: Build tool for mixed Clojure/Java projects

>     (ns leiningen.sub
>       (:use [leiningen.core :only [apply-task task-not-found]]))

>     (defn sub [task-name & args]
>       (doseq [project (projects-in-dir)]
>         (apply-task task-name project args task-not-found)))

> Implementation of projects-in-dir left as an exercise for the
> reader. Shouldn't be more than four lines. Push the lein-subs plugin to
> clojars: problem solved in a repeatable, maintainable way.

IMHO such a thing can be added to Lein proper as a feature. It's very
useful. Maybe with a :sub key in project.clj:

:sub ["module/dep-B" "module/dep-D"]

Regards,
Shantanu


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Wood  
View profile  
 More options Jul 4 2011, 7:52 am
From: Michael Wood <esiot...@gmail.com>
Date: Mon, 4 Jul 2011 13:52:34 +0200
Local: Mon, Jul 4 2011 7:52 am
Subject: Re: Build tool for mixed Clojure/Java projects
Hi

On 4 July 2011 13:08, Ken Wesson <kwess...@gmail.com> wrote:

"Repository" need not imply anything to do with networking.  I'm sure
someone will correct me if I'm wrong, but I am pretty sure that the
repository Steve is talking about above is just a hierarchy of files
in your home directory.

--
Michael Wood <esiot...@gmail.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Janus  
View profile  
 More options Jul 4 2011, 8:10 am
From: Daniel Janus <nath...@gmail.com>
Date: Mon, 4 Jul 2011 05:10:01 -0700 (PDT)
Local: Mon, Jul 4 2011 8:10 am
Subject: Re: Build tool for mixed Clojure/Java projects

> 2) Network independence. I often work without Internet access, and I  
> don't want to be blocked at some point because some build tool wants  
> to access some repository to see if my version is still current.

For the record, this is easily doable with both Leiningen and Cake
(which both use Maven under the hood). One just has to create
a ~/.m2/settings.xml with the following content:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
   <offline>true</offline>
</settings>

Best,
- Daniel


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hugo Duncan  
View profile  
 More options Jul 4 2011, 9:40 am
From: "Hugo Duncan" <duncan.h...@gmail.com>
Date: Mon, 04 Jul 2011 09:40:35 -0400
Local: Mon, Jul 4 2011 9:40 am
Subject: Re: Build tool for mixed Clojure/Java projects
On Mon, 04 Jul 2011 03:14:01 -0400, Konrad Hinsen  

<konrad.hin...@fastmail.net> wrote:
> AOT compilation: My case is probably a bit complex in this respect. I  
> need AOT compilation only because I want to produce an executable jar,  
> so there is at least one namespace that must be AOT compiled. For  
> building that executable jar, it doesn't matter if everything else is  
> AOT compiled as well. But I want to be able to build a standard library  
> jar with just the Clojure code to make sure it works with future Clojure  
> releases. One solution would be to have two completely different builds,  
> one for the executable jar and one for the library version, but using  
> the same set of source code files.

You might be able to use the :impl-ns option in gen-class to limit the  
extent of AOT compilation.

--
Hugo Duncan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 1 - 25 of 71   Newer >
« Back to Discussions « Newer topic     Older topic »