[Scons-dev] File-based build tools will never handle Java

Kenny, Jason L jason.l.kenny at intel.com
Thu Sep 6 10:37:07 EDT 2012


Thanks for the test,

We had been talking about this at work a little, and I was unclear ( since it was about 8 years since I last wrote Java code) what are the issues you are having. I know we had talked here at work how broken Eclipse is with Java build. It often messes up a building the code, so one often finds that they are not debugging the code they thought they write. It is to such a point that all the Java developer here just clean the project and rebuild. I know I want to go through the exercise in SCons myself at least as a learning exercise.

I keep asking myself what can build Java correctly.

Jason

-----Original Message-----
From: scons-dev-bounces at scons.org [mailto:scons-dev-bounces at scons.org] On Behalf Of Greg Ward
Sent: Wednesday, September 05, 2012 9:21 PM
To: scons-dev at scons.org
Subject: [Scons-dev] File-based build tools will never handle Java

OK, I finally sat down and did a little thought experiment, and have convinced myself that file-based buld tools will never handle Java.
The reason? Dependency cycles.

Short version: in Java, cycles between source files in the same package are commonplace and often impossible to avoid. Because interface and implementation are in the same file, that leads to DAG cycles, which any DAG-of-files-based build tool (make, SCons, tup, waf, ...) will reject. (Yes, I know that SCons nodes don't have to be files. But writing non-File Nodes is so painful that SCons might as well have that restriction.)

Why? Because packages (directories of source files) fill much the same role in Java that modules do in Python or C. We don't sneer at Python code where two functions in the same module call each other, so don't mock Java developers who put a cycle in one package. Save your mockery for the ones who put cycles *between* packages. ;-)

Concrete example:

hg clone http://hg.gerg.ca/sample-java

and just try to build the files in cycle/ using a file-based build tool *without* making fake nodes that represent the whole package, or a jar file, or what-have-you.

Disclaimer: I haven't tried this yet. I wrote the code and drew the graph, so I just *know* it won't work with make, SCons, or tup. I'm still going to try just to prove a point, but it won't work.

--
Greg Ward http://www.gerg.ca/
Never underestimate the power of human stupidity.
_______________________________________________
Scons-dev mailing list
Scons-dev at scons.org
http://two.pairlist.net/mailman/listinfo/scons-dev


More information about the Scons-dev mailing list