[Scons-users] Questions about building Java code

Russel Winder russel at winder.org.uk
Sat Apr 27 05:40:56 EDT 2013


On Fri, 2013-04-26 at 12:08 +0200, Dirk Heinrichs wrote:

> Hi,

>

> I'm doing a little evaluation of Scons as a possible replacement for

> Ant. I've setup a small test build containing two .java files and did a

> typical build, edit, build cycle. This is what I got:


Whilst I would love to be able to recommend SCons for Java work I
cannot. The way SCons works and the way Java and it's compiler work are
at odds. For small projects this isn't a problem, but for anything
sizable it is.

I am glad to see more and more people leaving Ant behind for building
projects, it is a 1990s technology that is now past its use by date.
The main tool that people migrating Java projects from Ant should be
looking at is Gradle, http://www.gradle.org


> % scons -Q

> /usr/bin/javac -d classes -sourcepath src src/ExtraClass.java src/MainClass.java

> % vim src/MainClass.java

> % scons -Q

> Retrieved `classes/ExtraClass.class' from cache

> /usr/bin/javac -d classes -sourcepath src src/ExtraClass.java src/MainClass.java

>

> Two things look strange here:

>

> 1) Why is classes/ExtraClass.class retrieved from the cache although its

> source file didn't change?


Almost certainly to do with the time stamp and hash checking.


> 2) Why is anything retrieved from the cache at all when javac

> recompiles all the files afterwards?


This is always going to happen, see comment above.

In the LaTeX, C++, Fortran, C build spaces, SCons is the number 1 "go
to" build tool for me. In the JVM build arena SCons just doesn't compare
with Gradle.
--
Russel.
=============================================================================
Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder at ekiga.net
41 Buckmaster Road m: +44 7770 465 077 xmpp: russel at winder.org.uk
London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : <http://four.pairlist.net/pipermail/scons-users/attachments/20130427/088c7550/attachment.pgp>


More information about the Scons-users mailing list