- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
using something like (GNU) Make to build scala projects
Fri, 2010-10-29, 08:55
Hi all,
Coming mostly form a C++ background,
I have been toying with Scala a bit lately.
I like the language but I wonder what people use to manage
their build process.
I noticed the relation between the .scala and the .class files
can be rather subtle, to say the least, since you can pretty
much put any class definition in any source file you like.
However, there appears to be no tool like "gcc -M" which
reads the sources and outputs the dependencies.
I tried to use "ant" but found it rather daunting, with the XML syntax
and the apparent lack of being able to specify a simple shell command
to do something (I also want to use the build process to generate a bunch
of other files, e.g. some image processing). Also, all the docs
are geared towards Java. The final nail is that it didn't seem to actually
handle the dependencies properly either. Oh yeah, and starting it up
took longer than a full compile, at least on my toy project.
For now, I have been using a simple shell script which does a full recompile
every time. However, that is far from ideal, as you may imagine.
So my questions are:
1. Is there any way to automatically generate the dependencies for make like "gcc -M"?
2. Failing that, is there any other build tool that can correctly handle the dependencies of scala
and that is more like "make" and less like "ant" in terms of flexibility and start-up times?
Thanks,
Stephan Houben
Fri, 2010-10-29, 09:37
#2
Re: using something like (GNU) Make to build scala projects
If you like to to something in your build process like the aforementioned image processing than I would recommend sbt (http://code.google.com/p/simple-build-tool/) because your build file is itself scala based so you can use scala's full power. Calling other processes works like a charm. Sbt has some very fancy support for this (see the documentation).
Maven (http://maven.apache.org/) is a mature tool which works really great, but setting up your build is much more verbose (commonly in XML, the new maven3 allows for languages like Groovy, etc though) and doing some stuff besides the normal build procedure requires you the implement a so-called Mojo which is a plugin to maven.
Dependency handling works fine with both of them. Sbt relies on Apache Ivy (http://ant.apache.org/ivy/) for that.
-Christoph
Am 29.10.2010 um 09:55 schrieb Stephan Houben:
Maven (http://maven.apache.org/) is a mature tool which works really great, but setting up your build is much more verbose (commonly in XML, the new maven3 allows for languages like Groovy, etc though) and doing some stuff besides the normal build procedure requires you the implement a so-called Mojo which is a plugin to maven.
Dependency handling works fine with both of them. Sbt relies on Apache Ivy (http://ant.apache.org/ivy/) for that.
-Christoph
Am 29.10.2010 um 09:55 schrieb Stephan Houben:
Hi all,
Coming mostly form a C++ background,
I have been toying with Scala a bit lately.
I like the language but I wonder what people use to manage
their build process.
I noticed the relation between the .scala and the .class files
can be rather subtle, to say the least, since you can pretty
much put any class definition in any source file you like.
However, there appears to be no tool like "gcc -M" which
reads the sources and outputs the dependencies.
I tried to use "ant" but found it rather daunting, with the XML syntax
and the apparent lack of being able to specify a simple shell command
to do something (I also want to use the build process to generate a bunch
of other files, e.g. some image processing). Also, all the docs
are geared towards Java. The final nail is that it didn't seem to actually
handle the dependencies properly either. Oh yeah, and starting it up
took longer than a full compile, at least on my toy project.
For now, I have been using a simple shell script which does a full recompile
every time. However, that is far from ideal, as you may imagine.
So my questions are:
1. Is there any way to automatically generate the dependencies for make like "gcc -M"?
2. Failing that, is there any other build tool that can correctly handle the dependencies of scala
and that is more like "make" and less like "ant" in terms of flexibility and start-up times?
Thanks,
Stephan Houben
Fri, 2010-10-29, 09:47
#3
Re: using something like (GNU) Make to build scala projects
Hi Tim,
Thanks for the advice.
Unfortunately sbt seems to want to download Scala 2.7.7 every time I want to build hello.scala .
A bit of Googling on this topic only showed a lot of frustrated users who wrestled with the same issue.
Greetings,
Stephan
On 10/29/2010 10:07 AM, Brigginshaw Tim wrote:
> Hi,
>
> Most Java programmers will use Ant for small projects and maven for larger ones (or they simply use their IDE). Maven handles library dependencies much better - but if you don't like Ant you won't like maven! There is a simple build tool (sbt) for Scala here http://code.google.com/p/simple-build-tool/ which may be more to your taste as it is more script-based.
> Tim
>
>
> -----Message d'origine-----
> De : Stephan Houben [mailto:stephanh@planet.nl]
> Envoyé : vendredi 29 octobre 2010 09:56
> À : scala-user@listes.epfl.ch
> Objet : [scala-user] using something like (GNU) Make to build scala projects
>
> Hi all,
>
> Coming mostly form a C++ background,
> I have been toying with Scala a bit lately.
>
> I like the language but I wonder what people use to manage
> their build process.
> I noticed the relation between the .scala and the .class files
> can be rather subtle, to say the least, since you can pretty
> much put any class definition in any source file you like.
> However, there appears to be no tool like "gcc -M" which
> reads the sources and outputs the dependencies.
>
> I tried to use "ant" but found it rather daunting, with the XML syntax
> and the apparent lack of being able to specify a simple shell command
> to do something (I also want to use the build process to generate a bunch
> of other files, e.g. some image processing). Also, all the docs
> are geared towards Java. The final nail is that it didn't seem to actually
> handle the dependencies properly either. Oh yeah, and starting it up
> took longer than a full compile, at least on my toy project.
>
> For now, I have been using a simple shell script which does a full recompile
> every time. However, that is far from ideal, as you may imagine.
>
> So my questions are:
> 1. Is there any way to automatically generate the dependencies for make like "gcc -M"?
> 2. Failing that, is there any other build tool that can correctly handle the dependencies of scala
> and that is more like "make" and less like "ant" in terms of flexibility and start-up times?
>
> Thanks,
>
> Stephan Houben
>
Fri, 2010-10-29, 09:47
#4
Re: using something like (GNU) Make to build scala projects
Try the continuous compilation feature.
[project-home/] $ sbt
> ~compile
BTW, if you're new to scala, you probably want to directly start off with scala 2.8.0 - it has significant improvements over 2.7.7.
Edit /project/build.properties for that.
-Christoph
Am 29.10.2010 um 10:29 schrieb Stephan Houben:
> Hi Tim,
>
> Thanks for the advice.
> Unfortunately sbt seems to want to download Scala 2.7.7 every time I want to build hello.scala .
> A bit of Googling on this topic only showed a lot of frustrated users who wrestled with the same issue.
>
> Greetings,
>
> Stephan
>
> On 10/29/2010 10:07 AM, Brigginshaw Tim wrote:
>> Hi,
>>
>> Most Java programmers will use Ant for small projects and maven for larger ones (or they simply use their IDE). Maven handles library dependencies much better - but if you don't like Ant you won't like maven! There is a simple build tool (sbt) for Scala here http://code.google.com/p/simple-build-tool/ which may be more to your taste as it is more script-based.
>> Tim
>>
>>
>> -----Message d'origine-----
>> De : Stephan Houben [mailto:stephanh@planet.nl]
>> Envoyé : vendredi 29 octobre 2010 09:56
>> À : scala-user@listes.epfl.ch
>> Objet : [scala-user] using something like (GNU) Make to build scala projects
>>
>> Hi all,
>>
>> Coming mostly form a C++ background,
>> I have been toying with Scala a bit lately.
>>
>> I like the language but I wonder what people use to manage
>> their build process.
>> I noticed the relation between the .scala and the .class files
>> can be rather subtle, to say the least, since you can pretty
>> much put any class definition in any source file you like.
>> However, there appears to be no tool like "gcc -M" which
>> reads the sources and outputs the dependencies.
>>
>> I tried to use "ant" but found it rather daunting, with the XML syntax
>> and the apparent lack of being able to specify a simple shell command
>> to do something (I also want to use the build process to generate a bunch
>> of other files, e.g. some image processing). Also, all the docs
>> are geared towards Java. The final nail is that it didn't seem to actually
>> handle the dependencies properly either. Oh yeah, and starting it up
>> took longer than a full compile, at least on my toy project.
>>
>> For now, I have been using a simple shell script which does a full recompile
>> every time. However, that is far from ideal, as you may imagine.
>>
>> So my questions are:
>> 1. Is there any way to automatically generate the dependencies for make like "gcc -M"?
>> 2. Failing that, is there any other build tool that can correctly handle the dependencies of scala
>> and that is more like "make" and less like "ant" in terms of flexibility and start-up times?
>>
>> Thanks,
>>
>> Stephan Houben
>>
Fri, 2010-10-29, 09:57
#5
Re: using something like (GNU) Make to build scala projects
SBT itself uses scala 2.7.7 *internally*, it is in no way forcing you to use 2.7.7 in your own compiled code!
On 29 October 2010 09:29, Stephan Houben <stephanh@planet.nl> wrote:
--
Kevin Wright
mail / gtalk / msn : kev.lee.wright@gmail.com
pulse / skype: kev.lee.wright
twitter: @thecoda
On 29 October 2010 09:29, Stephan Houben <stephanh@planet.nl> wrote:
Hi Tim,
Thanks for the advice.
Unfortunately sbt seems to want to download Scala 2.7.7 every time I want to build hello.scala .
A bit of Googling on this topic only showed a lot of frustrated users who wrestled with the same issue.
Greetings,
Stephan
On 10/29/2010 10:07 AM, Brigginshaw Tim wrote:
Hi,
Most Java programmers will use Ant for small projects and maven for larger ones (or they simply use their IDE). Maven handles library dependencies much better - but if you don't like Ant you won't like maven! There is a simple build tool (sbt) for Scala here http://code.google.com/p/simple-build-tool/ which may be more to your taste as it is more script-based.
Tim
-----Message d'origine-----
De : Stephan Houben [mailto:stephanh@planet.nl]
Envoyé : vendredi 29 octobre 2010 09:56
À : scala-user@listes.epfl.ch
Objet : [scala-user] using something like (GNU) Make to build scala projects
Hi all,
Coming mostly form a C++ background,
I have been toying with Scala a bit lately.
I like the language but I wonder what people use to manage
their build process.
I noticed the relation between the .scala and the .class files
can be rather subtle, to say the least, since you can pretty
much put any class definition in any source file you like.
However, there appears to be no tool like "gcc -M" which
reads the sources and outputs the dependencies.
I tried to use "ant" but found it rather daunting, with the XML syntax
and the apparent lack of being able to specify a simple shell command
to do something (I also want to use the build process to generate a bunch
of other files, e.g. some image processing). Also, all the docs
are geared towards Java. The final nail is that it didn't seem to actually
handle the dependencies properly either. Oh yeah, and starting it up
took longer than a full compile, at least on my toy project.
For now, I have been using a simple shell script which does a full recompile
every time. However, that is far from ideal, as you may imagine.
So my questions are:
1. Is there any way to automatically generate the dependencies for make like "gcc -M"?
2. Failing that, is there any other build tool that can correctly handle the dependencies of scala
and that is more like "make" and less like "ant" in terms of flexibility and start-up times?
Thanks,
Stephan Houben
--
Kevin Wright
mail / gtalk / msn : kev.lee.wright@gmail.com
pulse / skype: kev.lee.wright
twitter: @thecoda
Fri, 2010-10-29, 09:57
#6
Re: using something like (GNU) Make to build scala projects
On 29/10/2010 10:40, Kevin Wright wrote:
> SBT itself uses scala 2.7.7 *internally*, it is in no way forcing you to use 2.7.7 in your
> own compiled code!
Well, as I wrote, I found no way to stop it downloading Scala 2.7.7 on each project I
create. I doubt that's for running SBT itself. If there is a switch I haven't found in the
SBT wiki (to create a project without any downloading), I will be happy to learn it.
On 29/10/2010 10:42, Christoph Drießen wrote:
> BTW, if you're new to scala, you probably want to directly start off with scala 2.8.0 -
> it has significant improvements over 2.7.7. Edit/project/build.properties
> for that.
Same here. To edit this file, you have first to create the project, so go through the
download phase. What I am missing?
See http://code.google.com/p/simple-build-tool/wiki/Setup (comments) for a description of
my attempts...
Fri, 2010-10-29, 10:07
#7
Re: using something like (GNU) Make to build scala projects
On 29/10/2010 10:29, Stephan Houben wrote:
> Unfortunately sbt seems to want to download Scala 2.7.7 every time I want to build
> hello.scala .
> A bit of Googling on this topic only showed a lot of frustrated users who wrestled with
> the same issue.
Yes, I went there too, I hate that, and didn't found any way to disable that.
I don't want to download megabytes of something I won't use on each micro-project I want
to do... It might be futile in my case, but that's a question of principle, and I know
some people are limited by firewall or pay their Internet connection by downloaded MBs...
In a forum, somebody recommended Buildr. Looks nice, but it uses Ruby or JRuby, so that's
another couple of dozen of MB to install before using it...
So I searched various build tools. It is surprising to see how much there are... There is
an obvious need, and no universal satisfying solution (some builders are specialized, lot
for C/C++, lot use Python, etc.).
I finally tried Buildr, with JRuby, following their installation recommendations. Well, it
complained about unsatisfied dependency. Installed the dependencies, ended with installing
one newer than the required one, so I was kind of stuck. Gave up.
Currently, I am testing Gradle... Looks nice too. A 22MB download, but a good amount come
from the docs, which is good sign... :-) It has lot of jar dependencies, but at least they
come bundled with the application (hence the size).
Fri, 2010-10-29, 10:07
#8
Re: Re: using something like (GNU) Make to build scala projects
The 'download phase' will only download sbt the first time, afterwards
it will make use of your local ivy cache, so no real download takes
place. And yes, it is for sbt itself.
In fact, the download handling is much better than e.g. with mvn,
because after having installed sbt itself, it will only download
things if you force it to do so by changing dependencies or
configuration. And even then, you have to call `sbt update` yourself.
Aside from your per-user local ivy cache, it will also cache all of
your dependencies inside the project (boot, lib_managed), so once you
have initialized your project and downloaded the dependencies once,
you don't need any internet connection and don't rely on the ivy cache
in any way, so that your working directory is then completely working
stand-alone.
On Fri, Oct 29, 2010 at 10:55 AM, Philippe Lhoste wrote:
> On 29/10/2010 10:40, Kevin Wright wrote:
>>
>> SBT itself uses scala 2.7.7 *internally*, it is in no way forcing you to
>> use 2.7.7 in your
>> own compiled code!
>
> Well, as I wrote, I found no way to stop it downloading Scala 2.7.7 on each
> project I create. I doubt that's for running SBT itself. If there is a
> switch I haven't found in the SBT wiki (to create a project without any
> downloading), I will be happy to learn it.
>
> On 29/10/2010 10:42, Christoph Drießen wrote:
>> BTW, if you're new to scala, you probably want to directly start off with
>> scala 2.8.0 -
>> it has significant improvements over 2.7.7.
>> Edit/project/build.properties
>> for that.
>
> Same here. To edit this file, you have first to create the project, so go
> through the download phase. What I am missing?
>
> See http://code.google.com/p/simple-build-tool/wiki/Setup (comments) for a
> description of my attempts...
>
> --
> Philippe Lhoste
Fri, 2010-10-29, 10:17
#9
Re: using something like (GNU) Make to build scala projects
On 29/10/2010 11:02, Johannes Rudolph wrote:
> The 'download phase' will only download sbt the first time, afterwards
> it will make use of your local ivy cache, so no real download takes
> place. And yes, it is for sbt itself.
Aha, thanks for the information! The least I can say is that info isn't clear, neither
from the messages from SBT itself, or from the wiki (or I am just dumb).
I still find strange to have to download and install SBT after having downloaded it
already (at least the sbt-launch-0.7.4.jar file - but perhaps the name is a hint, after
all), but if that's a one time shot, I will give the tool another look.
Anybody can comment on Gradle vs. SBT for building Scala projects?
I am not fan of imposed project structure, even if it is logical - and I understand I can
change it later if I want. And SBT seems to do lot of stuff behind our back (putting in
place the caches, I suppose). But it might be smaller (or not, since I don't know what it
will install...) and at least it uses a language I am learning (even if the needed
knowledge of Groovy for Gradle seems minimal).
Fri, 2010-10-29, 10:27
#10
Re: Re: using something like (GNU) Make to build scala projects
Yep!
Apparently you first need to download 2.7.7, then edit the file,
then it goes ahead and downloads 2.8.0 .
In the end it works, but the way to get there is a somewhat
astonishing amount of wasted network bandwidth, not to mention the storage
requirements of two complete scala versions per little project.
Although I guess, now I have a complete (though empty) "build environment"
I can use "cp -R -l" to create a new build environment which shares the
files with the existing one. A quick test shows that this apparently works.
So I guess this is indeed a solution, although less simple than hoped for.
Stephan
On 10/29/2010 10:55 AM, Philippe Lhoste wrote:
> On 29/10/2010 10:40, Kevin Wright wrote:
>> SBT itself uses scala 2.7.7 *internally*, it is in no way forcing you
>> to use 2.7.7 in your
>> own compiled code!
>
> Well, as I wrote, I found no way to stop it downloading Scala 2.7.7 on
> each project I create. I doubt that's for running SBT itself. If there
> is a switch I haven't found in the SBT wiki (to create a project without
> any downloading), I will be happy to learn it.
>
> On 29/10/2010 10:42, Christoph Drießen wrote:
> > BTW, if you're new to scala, you probably want to directly start off
> with scala 2.8.0 -
> > it has significant improvements over 2.7.7.
> Edit/project/build.properties
> > for that.
>
> Same here. To edit this file, you have first to create the project, so
> go through the download phase. What I am missing?
>
> See http://code.google.com/p/simple-build-tool/wiki/Setup (comments) for
> a description of my attempts...
>
Fri, 2010-10-29, 10:37
#11
Re: Re: using something like (GNU) Make to build scala projects
Am 29.10.2010 um 10:55 schrieb Philippe Lhoste:
That was only for changing an already existing project. Setting up a new project sbt asks you which version of scala you want to use. Just enter 2.8.0 here. And as Johannes said, downloading only happens once because of your local cache, located under ~/.ivy2/
So basically if you want to create a 2.8.0 project with sbt for the very first time on your computer, sbt needs to download Scala 2.7.7 for its own purpose, then Scala 2.8.0 for your project and after that initialization of your Ivy cache, creating new projects just takes seconds.
-Christoph
On 29/10/2010 10:42, Christoph Drießen wrote:
> BTW, if you're new to scala, you probably want to directly start off with scala 2.8.0 -
> it has significant improvements over 2.7.7. Edit<project-home>/project/build.properties
> for that.
Same here. To edit this file, you have first to create the project, so go through the download phase. What I am missing?
That was only for changing an already existing project. Setting up a new project sbt asks you which version of scala you want to use. Just enter 2.8.0 here. And as Johannes said, downloading only happens once because of your local cache, located under ~/.ivy2/
So basically if you want to create a 2.8.0 project with sbt for the very first time on your computer, sbt needs to download Scala 2.7.7 for its own purpose, then Scala 2.8.0 for your project and after that initialization of your Ivy cache, creating new projects just takes seconds.
-Christoph
Fri, 2010-10-29, 10:47
#12
Re: Re: using something like (GNU) Make to build scala projects
Hi Christoph, Johannes, Philippe, Tim, Kevin,
I think I get it now.
The fact that it creates a download cache was missing
in my picture of the tool.
I guess that complaining about the fact that every project requires
29 megabytes of storage when empty will only mark me as a dinosaur ;-)
(I recall my first PC had a 20 MB harddisk, which was stunning for the time,
most people where running from floppies.)
Thanks everybody,
Stephan
On 10/29/2010 11:15 AM, Christoph Drießen wrote:
> Am 29.10.2010 um 10:55 schrieb Philippe Lhoste:
>>
>> On 29/10/2010 10:42, Christoph Drießen wrote:
>> > BTW, if you're new to scala, you probably want to directly start off
>> with scala 2.8.0 -
>> > it has significant improvements over 2.7.7.
>> Edit/project/build.properties
>> > for that.
>>
>> Same here. To edit this file, you have first to create the project, so
>> go through the download phase. What I am missing?
>
> That was only for changing an already existing project.
> Setting up a new project sbt asks you which version of scala you want to
> use. Just enter 2.8.0 here. And as Johannes said, downloading only
> happens once because of your local cache, located under ~/.ivy2/
>
> So basically if you want to create a 2.8.0 project with sbt for the very
> first time on your computer, sbt needs to download Scala 2.7.7 for its
> own purpose, then Scala 2.8.0 for your project and after that
> initialization of your Ivy cache, creating new projects just takes seconds.
>
> -Christoph
>
>
>
Fri, 2010-10-29, 11:17
#13
Re: Re: using something like (GNU) Make to build scala projects
Maybe it would be enlightening to ask Mark Harrah for his design decision to keep a separate copy of all artifacts inside the project. It's not only scala and the sbt classes that are copied, but also all dependend project artifacts. Maybe he wants a project to be self contained.
Maven on the other hand just accesses its local cache (repo) so all your projects use the same artifact files.
-Christoph
Am 29.10.2010 um 11:33 schrieb Stephan Houben:
> Hi Christoph, Johannes, Philippe, Tim, Kevin,
>
> I think I get it now.
> The fact that it creates a download cache was missing
> in my picture of the tool.
>
> I guess that complaining about the fact that every project requires
> 29 megabytes of storage when empty will only mark me as a dinosaur ;-)
> (I recall my first PC had a 20 MB harddisk, which was stunning for the time,
> most people where running from floppies.)
>
> Thanks everybody,
>
> Stephan
>
> On 10/29/2010 11:15 AM, Christoph Drießen wrote:
>> Am 29.10.2010 um 10:55 schrieb Philippe Lhoste:
>>>
>>> On 29/10/2010 10:42, Christoph Drießen wrote:
>>> > BTW, if you're new to scala, you probably want to directly start off
>>> with scala 2.8.0 -
>>> > it has significant improvements over 2.7.7.
>>> Edit/project/build.properties
>>> > for that.
>>>
>>> Same here. To edit this file, you have first to create the project, so
>>> go through the download phase. What I am missing?
>>
>> That was only for changing an already existing project.
>> Setting up a new project sbt asks you which version of scala you want to
>> use. Just enter 2.8.0 here. And as Johannes said, downloading only
>> happens once because of your local cache, located under ~/.ivy2/
>>
>> So basically if you want to create a 2.8.0 project with sbt for the very
>> first time on your computer, sbt needs to download Scala 2.7.7 for its
>> own purpose, then Scala 2.8.0 for your project and after that
>> initialization of your Ivy cache, creating new projects just takes seconds.
>>
>> -Christoph
>>
>>
>>
Fri, 2010-10-29, 12:27
#14
RE: using something like (GNU) Make to build scala projects
Tim,
On Fri, 2010-10-29 at 08:07 +0000, Brigginshaw Tim wrote:
> Hi,
>
> Most Java programmers will use Ant for small projects and maven for
> larger ones (or they simply use their IDE). Maven handles library
> dependencies much better - but if you don't like Ant you won't like
> maven! There is a simple build tool (sbt) for Scala here
> http://code.google.com/p/simple-build-tool/ which may be more to your
> taste as it is more script-based.
> Tim
Many people are switching to using Gradle (http://gradle.org) instead of
Ant or Maven. This uses Groovy scripts instead of XML documents as the
specification notation.
Of course Ant now has a Groovy front end (it was a fork of Gant), and
there is Polyglot Maven which admits Groovy coded POMs.
I haven't really tried SBT yet, but as the intro says "for Scala
projects" I suspect it's use is relatively limited since most JVM
targeted projects these days are combination of Java, Scala, Groovy and
possibly Clojure.
Fri, 2010-10-29, 12:27
#15
Re: Re: using something like (GNU) Make to build scala projects
I can't answer for Mark, but I like the fact that dependencies are copied in
each project, first it makes de dependencies more self explanatory and
project settings for IDEs are easyer to configure, since everything is relative
to a root directory. Yes it is a waste of space, but I find that developing nowdays
require big drives anyways...
Max
On Fri, Oct 29, 2010 at 6:08 AM, Christoph Drießen <ced@gmx.de> wrote:
Maybe it would be enlightening to ask Mark Harrah for his design decision to keep a separate copy of all artifacts inside the project. It's not only scala and the sbt classes that are copied, but also all dependend project artifacts. Maybe he wants a project to be self contained.
Maven on the other hand just accesses its local cache (repo) so all your projects use the same artifact files.
-Christoph
Am 29.10.2010 um 11:33 schrieb Stephan Houben:
> Hi Christoph, Johannes, Philippe, Tim, Kevin,
>
> I think I get it now.
> The fact that it creates a download cache was missing
> in my picture of the tool.
>
> I guess that complaining about the fact that every project requires
> 29 megabytes of storage when empty will only mark me as a dinosaur ;-)
> (I recall my first PC had a 20 MB harddisk, which was stunning for the time,
> most people where running from floppies.)
>
> Thanks everybody,
>
> Stephan
>
> On 10/29/2010 11:15 AM, Christoph Drießen wrote:
>> Am 29.10.2010 um 10:55 schrieb Philippe Lhoste:
>>>
>>> On 29/10/2010 10:42, Christoph Drießen wrote:
>>> > BTW, if you're new to scala, you probably want to directly start off
>>> with scala 2.8.0 -
>>> > it has significant improvements over 2.7.7.
>>> Edit<project-home>/project/build.properties
>>> > for that.
>>>
>>> Same here. To edit this file, you have first to create the project, so
>>> go through the download phase. What I am missing?
>>
>> That was only for changing an already existing project.
>> Setting up a new project sbt asks you which version of scala you want to
>> use. Just enter 2.8.0 here. And as Johannes said, downloading only
>> happens once because of your local cache, located under ~/.ivy2/
>>
>> So basically if you want to create a 2.8.0 project with sbt for the very
>> first time on your computer, sbt needs to download Scala 2.7.7 for its
>> own purpose, then Scala 2.8.0 for your project and after that
>> initialization of your Ivy cache, creating new projects just takes seconds.
>>
>> -Christoph
>>
>>
>>
Fri, 2010-10-29, 12:37
#16
RE: using something like (GNU) Make to build scala projects
Tim,
And if you need to do mixed Scala/C++ projects then there is always
SCons http://www.scons.org. The Java/Scala support is still a bit
unsophisticated (to say the least) but the C, C++, Fortran, LaTeX
support is exemplary.
Fri, 2010-10-29, 12:37
#17
Re: using something like (GNU) Make to build scala projects
On Fri, Oct 29, 2010 at 12:18:06PM +0100, Russel Winder wrote:
> I haven't really tried SBT yet, but as the intro says "for Scala
> projects" I suspect it's use is relatively limited since most JVM
> targeted projects these days are combination of Java, Scala, Groovy
> and possibly Clojure.
Apparently I missed quite the memo.
Fri, 2010-10-29, 12:47
#18
Re: Re: using something like (GNU) Make to build scala projects
Sure ;) The space consumption is not a big deal in practice.
-Christoph
Am 29.10.2010 um 13:21 schrieb Maxime Lévesque:
-Christoph
Am 29.10.2010 um 13:21 schrieb Maxime Lévesque:
I can't answer for Mark, but I like the fact that dependencies are copied in
each project, first it makes de dependencies more self explanatory and
project settings for IDEs are easyer to configure, since everything is relative
to a root directory. Yes it is a waste of space, but I find that developing nowdays
require big drives anyways...
Max
On Fri, Oct 29, 2010 at 6:08 AM, Christoph Drießen <ced@gmx.de> wrote:
Maybe it would be enlightening to ask Mark Harrah for his design decision to keep a separate copy of all artifacts inside the project. It's not only scala and the sbt classes that are copied, but also all dependend project artifacts. Maybe he wants a project to be self contained.
Maven on the other hand just accesses its local cache (repo) so all your projects use the same artifact files.
-Christoph
Am 29.10.2010 um 11:33 schrieb Stephan Houben:
> Hi Christoph, Johannes, Philippe, Tim, Kevin,
>
> I think I get it now.
> The fact that it creates a download cache was missing
> in my picture of the tool.
>
> I guess that complaining about the fact that every project requires
> 29 megabytes of storage when empty will only mark me as a dinosaur ;-)
> (I recall my first PC had a 20 MB harddisk, which was stunning for the time,
> most people where running from floppies.)
>
> Thanks everybody,
>
> Stephan
>
> On 10/29/2010 11:15 AM, Christoph Drießen wrote:
>> Am 29.10.2010 um 10:55 schrieb Philippe Lhoste:
>>>
>>> On 29/10/2010 10:42, Christoph Drießen wrote:
>>> > BTW, if you're new to scala, you probably want to directly start off
>>> with scala 2.8.0 -
>>> > it has significant improvements over 2.7.7.
>>> Edit<project-home>/project/build.properties
>>> > for that.
>>>
>>> Same here. To edit this file, you have first to create the project, so
>>> go through the download phase. What I am missing?
>>
>> That was only for changing an already existing project.
>> Setting up a new project sbt asks you which version of scala you want to
>> use. Just enter 2.8.0 here. And as Johannes said, downloading only
>> happens once because of your local cache, located under ~/.ivy2/
>>
>> So basically if you want to create a 2.8.0 project with sbt for the very
>> first time on your computer, sbt needs to download Scala 2.7.7 for its
>> own purpose, then Scala 2.8.0 for your project and after that
>> initialization of your Ivy cache, creating new projects just takes seconds.
>>
>> -Christoph
>>
>>
>>
Fri, 2010-10-29, 13:27
#19
Re: Re: using something like (GNU) Make to build scala projects
>>>>> "Philippe" == Philippe Lhoste writes:
>> On 29/10/2010 10:40, Kevin Wright wrote:
>> SBT itself uses scala 2.7.7 *internally*, it is in no way forcing
>> you to use 2.7.7 in your own compiled code!
Philippe> Well, as I wrote, I found no way to stop it downloading Scala
Philippe> 2.7.7 on each project I create. I doubt that's for running
Philippe> SBT itself.
Fish swim. Birds fly. 2.7.7 is for running SBT itself.
Fri, 2010-10-29, 13:37
#20
Re: Re: using something like (GNU) Make to build scala projects
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 29/10/10 22:26, Seth Tisue wrote:
>>>>>> "Philippe" == Philippe Lhoste writes:
>
>>> On 29/10/2010 10:40, Kevin Wright wrote: SBT itself uses scala
>>> 2.7.7 *internally*, it is in no way forcing you to use 2.7.7 in
>>> your own compiled code!
>
> Philippe> Well, as I wrote, I found no way to stop it downloading
> Scala Philippe> 2.7.7 on each project I create. I doubt that's for
> running Philippe> SBT itself.
>
> Fish swim. Birds fly. 2.7.7 is for running SBT itself.
>
FWIW, I haven't yet found a way to stop fish swimming and birds
flying. I will try again tomorrow.
Fri, 2010-10-29, 13:37
#21
Re: using something like (GNU) Make to build scala projects
On 29/10/2010 14:26, Seth Tisue wrote:
> Fish swim. Birds fly. 2.7.7 is for running SBT itself.
Sure, but I found the information missing from the site, it is disturbing, to say the least.
And I fail to understand why it needs to install SBT for each and every project it
creates. It is fine for big projects, overkill for small ones. Or you have to organize
these smaller projects under a bigger umbrella one, I suppose.
One difficulty with tools like that is that your have to adapt to its idiosyncrasies,
instead of having the tool to adapt to your needs.
Fri, 2010-10-29, 13:47
#22
Re: Re: using something like (GNU) Make to build scala projects
On Fri, Oct 29, 2010 at 2:28 PM, Tony Morris <tonymorris@gmail.com> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 29/10/10 22:26, Seth Tisue wrote:
>>>>>> "Philippe" == Philippe Lhoste <PhiLho@GMX.net> writes:
>
>>> On 29/10/2010 10:40, Kevin Wright wrote: SBT itself uses scala
>>> 2.7.7 *internally*, it is in no way forcing you to use 2.7.7 in
>>> your own compiled code!
>
> Philippe> Well, as I wrote, I found no way to stop it downloading
> Scala Philippe> 2.7.7 on each project I create. I doubt that's for
> running Philippe> SBT itself.
>
> Fish swim. Birds fly. 2.7.7 is for running SBT itself.
>
FWIW, I haven't yet found a way to stop fish swimming and birds
flying. I will try again tomorrow.
For birds: http://en.wikipedia.org/wiki/Wing_clipping
For fish: http://en.wikipedia.org/wiki/Desert
- --
Tony Morris
http://tmorris.net/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkzKvdcACgkQmnpgrYe6r61HTQCeIFyRQK004li62VgqSXXeo31b
SfwAn1birvWZ8RX4r9Ux88ez5jG5OMTG
=rvNQ
-----END PGP SIGNATURE-----
--
Viktor Klang,
Code Connoisseur
Work: www.akkasource.com
Code: github.com/viktorklang
Follow: twitter.com/viktorklang
Read: klangism.tumblr.com
Fri, 2010-10-29, 13:58
#23
Re: Re: using something like (GNU) Make to build scala projects
On Fri, Oct 29, 2010 at 2:32 PM, √iktor Klang <viktor.klang@gmail.com> wrote:
On Fri, Oct 29, 2010 at 2:28 PM, Tony Morris <tonymorris@gmail.com> wrote:-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 29/10/10 22:26, Seth Tisue wrote:
>>>>>> "Philippe" == Philippe Lhoste <PhiLho@GMX.net> writes:
>
>>> On 29/10/2010 10:40, Kevin Wright wrote: SBT itself uses scala
>>> 2.7.7 *internally*, it is in no way forcing you to use 2.7.7 in
>>> your own compiled code!
>
> Philippe> Well, as I wrote, I found no way to stop it downloading
> Scala Philippe> 2.7.7 on each project I create. I doubt that's for
> running Philippe> SBT itself.
>
> Fish swim. Birds fly. 2.7.7 is for running SBT itself.
>
FWIW, I haven't yet found a way to stop fish swimming and birds
flying. I will try again tomorrow.
For birds: http://en.wikipedia.org/wiki/Wing_clipping
For fish: http://en.wikipedia.org/wiki/Desert
Also worth noting is that the Australian legend Nick Cave says in "Tupelo" [http://www.lyricsfreak.com/n/nick+cave+and+the+bad+seeds/tupelo_20100096.html]
"Where no bird can fly no fish can swim
Where no bird can fly no fish can swim
No fish can swim
Until The King is born!
Until The King is born!
In Tupelo! Tupelo-o-o!"
- --
Tony Morris
http://tmorris.net/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkzKvdcACgkQmnpgrYe6r61HTQCeIFyRQK004li62VgqSXXeo31b
SfwAn1birvWZ8RX4r9Ux88ez5jG5OMTG
=rvNQ
-----END PGP SIGNATURE-----
--
Viktor Klang,
Code Connoisseur
Work: www.akkasource.com
Code: github.com/viktorklang
Follow: twitter.com/viktorklang
Read: klangism.tumblr.com
--
Viktor Klang,
Code Connoisseur
Work: www.akkasource.com
Code: github.com/viktorklang
Follow: twitter.com/viktorklang
Read: klangism.tumblr.com
Fri, 2010-10-29, 14:17
#24
RE: Re: using something like (GNU) Make to build scala projects
> FWIW, I haven't yet found a way to stop fish swimming and birds
> flying. I will try again tomorrow.
>
> For birds: http://en.wikipedia.org/wiki/Wing_clipping
> For fish: http://en.wikipedia.org/wiki/Desert
>
For both: http://en.wikipedia.org/wiki/Frying_pan
Fri, 2010-10-29, 14:27
#25
Re: Re: using something like (GNU) Make to build scala projects
On Fri, Oct 29, 2010 at 3:08 PM, Detering Dirk <Dirk.Detering@bitmarck.de> wrote:
> FWIW, I haven't yet found a way to stop fish swimming and birds
> flying. I will try again tomorrow.
>
> For birds: http://en.wikipedia.org/wiki/Wing_clipping
> For fish: http://en.wikipedia.org/wiki/Desert
>
For both: http://en.wikipedia.org/wiki/Frying_pan
Depending on usage (as blunt force weapon, or as food-preparation device) it could need to be combined with either:
http://en.wikipedia.org/wiki/Stove
or
http://en.wikipedia.org/wiki/Campfire
--
Viktor Klang,
Code Connoisseur
Work: www.akkasource.com
Code: github.com/viktorklang
Follow: twitter.com/viktorklang
Read: klangism.tumblr.com
Fri, 2010-10-29, 14:27
#26
Re: using something like (GNU) Make to build scala projects
On 29/10/2010 11:33, Stephan Houben wrote:
> I guess that complaining about the fact that every project requires
> 29 megabytes of storage when empty will only mark me as a dinosaur ;-)
> (I recall my first PC had a 20 MB harddisk, which was stunning for the time,
> most people where running from floppies.)
Yes, I am such a dinosaur too... :-)
The fact I only switched from a 2004 computer with WinXP where I struggled to keep some
free space on the disk to a modern computer with some room doesn't help to make me accept
such "waste"... ;-)
Decisions taken for me is what prevented myself to try/use Maven. I suppose that if I
tried, I would appreciate to be pampered, (and I might try), but being old school, I like
to keep control of what is done on my computer. :-D
Even if I reckon the taken decisions aren't bad, but I don't believe in one size fits all
designs.
And well, I find myself in situations where I want to develop on a computer not connected
to Internet (yes, it becomes a rare case). Installing SBT on such machine (eg. from an USB
stick) seems hard...
Fri, 2010-10-29, 14:57
#27
Re: using something like (GNU) Make to build scala projects
On Friday October 29 2010, Paul Phillips wrote:
> On Fri, Oct 29, 2010 at 12:18:06PM +0100, Russel Winder wrote:
> > I haven't really tried SBT yet, but as the intro says "for Scala
> > projects" I suspect it's use is relatively limited since most JVM
> > targeted projects these days are combination of Java, Scala, Groovy
> > and possibly Clojure.
>
> Apparently I missed quite the memo.
To: Programmers
From: God of Programmers
Subject: Tower of Programming Babel
It has come to GoP's attention that a grossly excessive number of
projects use fewer than three languages, despite the fact that these
languages generate bytecode for the venerable Java Virtual Machine. It
is hereby decreed by GoP that all projects using any language whose
deployment is made upon the magnificent JVM will hereafter use at least
three of the four Blessed Languages:
- Scala
- Clojure
- Java
- JRuby
Projects seen using Groovy will be disbanded and their participants'
first-born sons condemned to jobs in sales and marketing.
Thus Spake the God of Programming
Fri, 2010-10-29, 19:17
#28
Re: Re: using something like (GNU) Make to build scala projects
On Fri, Oct 29, 2010 at 5:35 AM, Philippe Lhoste wrote:
> On 29/10/2010 14:26, Seth Tisue wrote:
>> Fish swim. Birds fly. 2.7.7 is for running SBT itself.
> Sure, but I found the information missing from the site, it is disturbing,
> to say the least.
+42 to folks like Philippe who fight the good fight against
missing/bad usability.
Fri, 2010-10-29, 22:17
#29
Re: Re: using something like (GNU) Make to build scala projects
On Fri, Oct 29, 2010 at 11:07:08AM -0700, Raoul Duke wrote:
> +42 to folks like Philippe who fight the good fight against
> missing/bad usability.
Tail, meet dog. Your task is to wag this hairy thing.
Fri, 2010-10-29, 22:17
#30
Re: Re: using something like (GNU) Make to build scala projects
On Fri, Oct 29, 2010 at 11:02 PM, Paul Phillips <paulp@improving.org> wrote:
On Fri, Oct 29, 2010 at 11:07:08AM -0700, Raoul Duke wrote:
> +42 to folks like Philippe who fight the good fight against
> missing/bad usability.
Tail, meet dog. Your task is to wag this hairy thing.
Understanding is a three edged sword.
--
Paul Phillips | On two occasions, I have been asked, 'Mr. Babbage, if you
Moral Alien | put into the machine wrong figures, will the right answers
Empiricist | come out?' I am not able to rightly apprehend the kind of
pull his pi pal! | confusion of ideas that could provoke such a question.
--
Viktor Klang,
Code Connoisseur
Work: www.akkasource.com
Code: github.com/viktorklang
Follow: twitter.com/viktorklang
Read: klangism.tumblr.com
Sun, 2010-10-31, 16:57
#31
Re: using something like (GNU) Make to build scala projects
On Fri, 2010-10-29 at 06:45 -0700, Randall R Schulz wrote:
[ . . . ]
> is hereby decreed by GoP that all projects using any language whose
> deployment is made upon the magnificent JVM will hereafter use at least
> three of the four Blessed Languages:
>
> - Scala
> - Clojure
> - Java
> - JRuby
>
> Projects seen using Groovy will be disbanded and their participants'
> first-born sons condemned to jobs in sales and marketing.
So why are you prejudiced against Groovy but for Clojure and JRuby?
Sun, 2010-10-31, 17:17
#32
Re: using something like (GNU) Make to build scala projects
On Sunday October 31 2010, Russel Winder wrote:
> On Fri, 2010-10-29 at 06:45 -0700, Randall R Schulz wrote:
> [ . . . ]
>
> > is hereby decreed by GoP that all projects using any language whose
> > deployment is made upon the magnificent JVM will hereafter use at
> > least three of the four Blessed Languages:
> >
> > - Scala
> > - Clojure
> > - Java
> > - JRuby
> >
> > Projects seen using Groovy will be disbanded and their
> > participants' first-born sons condemned to jobs in sales and
> > marketing.
>
> So why are you prejudiced against Groovy but for Clojure and JRuby?
Seriously? You want to draw _meaning_ from a clearly humorous post??
Randall Schulz
Mon, 2010-11-01, 18:27
#33
Re: using something like (GNU) Make to build scala projects
For those that might be interested, I managed to compile a small Scala
project with Gradle, while using only local Scala install and local
libraries (outside of the project, as I plan to share them among various
of these micro-projects).
I grouped my thoughts at:
Building and running Scala programs with Gradle
http://phi.lho.free.fr/serendipity/index.php?/archives/27-Building-and-r...
http://bit.ly/dcygA9 for those with e-mail clients not liking wrapped
URLs...
I suppose my need is quite atypical in modern development environment,
but well, if somebody else has the same, they might have now a starting
point. :-)
Hi,
Most Java programmers will use Ant for small projects and maven for larger ones (or they simply use their IDE). Maven handles library dependencies much better - but if you don't like Ant you won't like maven! There is a simple build tool (sbt) for Scala here http://code.google.com/p/simple-build-tool/ which may be more to your taste as it is more script-based.
Tim
-----Message d'origine-----
De : Stephan Houben [mailto:stephanh@planet.nl]
Envoyé : vendredi 29 octobre 2010 09:56
À : scala-user@listes.epfl.ch
Objet : [scala-user] using something like (GNU) Make to build scala projects
Hi all,
Coming mostly form a C++ background,
I have been toying with Scala a bit lately.
I like the language but I wonder what people use to manage
their build process.
I noticed the relation between the .scala and the .class files
can be rather subtle, to say the least, since you can pretty
much put any class definition in any source file you like.
However, there appears to be no tool like "gcc -M" which
reads the sources and outputs the dependencies.
I tried to use "ant" but found it rather daunting, with the XML syntax
and the apparent lack of being able to specify a simple shell command
to do something (I also want to use the build process to generate a bunch
of other files, e.g. some image processing). Also, all the docs
are geared towards Java. The final nail is that it didn't seem to actually
handle the dependencies properly either. Oh yeah, and starting it up
took longer than a full compile, at least on my toy project.
For now, I have been using a simple shell script which does a full recompile
every time. However, that is far from ideal, as you may imagine.
So my questions are:
1. Is there any way to automatically generate the dependencies for make like "gcc -M"?
2. Failing that, is there any other build tool that can correctly handle the dependencies of scala
and that is more like "make" and less like "ant" in terms of flexibility and start-up times?
Thanks,
Stephan Houben