Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: Steven Simpson Newsgroups: comp.lang.java.programmer Subject: Re: How to develop without an IDE? Date: Sun, 22 Apr 2012 23:32:08 +0100 Organization: Aioe.org NNTP Server Lines: 40 Message-ID: <9gde69-uha.ln1@s.simpson148.btinternet.com> References: NNTP-Posting-Host: 0qdAXuojAaWA+S+fgrGpqA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.java.programmer:13807 On 22/04/12 16:15, Rui Maciel wrote: > Is it possible to set up a Java project so that it can be built without > relying on an IDE? If it is, where can I find any information on how to set > up this sort of project? > > Bonus points if it's possible to pull this off by writing a single makefile. Though I use Eclipse for any project of more than a few source files, I don't use it for building. The projects include the necessary scripts to be built stand-alone. I did explore trying to get 'make' to handle per-file dependencies, and I haven't totally given up yet, but for now I've settled for per-jar dependencies. I have a pre-packaged 'make' include file, and tell it that jar foo depends upon the 'API' of jar bar, and it works out rules that allow compilation of foo to be necessary only if any of foo's sources have changed (of course), or the API of bar has changed - so bar can change internally without necessarily triggering recompilation of foo. Within a jar, nothing special is going on - it's a clean build. A jar's API is derived from the class files immediately after compilation. I originally used javap and gawk for this, but javap's text output is not a consistent format from one vendor to the next, and the gawk processing is slow, so I eventually wrote a Java program to parse the class files directly. It's a little faster, and should be more broadly compatible. However, I think it's still substantially slower than simply doing clean builds on all jars unconditionally. Details here: Cheers, Steven -- ss at comp dot lancs dot ac dot uk