Breaking Version Inertia: Ant: import and macrodef
I've been using Ant since the very early days. ("Tomcat is built with Ant. What is Ant?" Remember those days?) Since my use of ant does not usually involve anything esoteric, I have fallen victim to version inertia. Ant 1.4, 1.5, 1.6, 1.7 came out over the years, and I didn't much glance at the release notes.
Meanwhile, some of my build.xml files has grown organically. Since the code is modularized with a nice "B depends on A, C depends on B, etc..." structure, the build.xml reflects that with targets like "compile-A", "compile-A-test", "run-A-test", "compile-B", "compile-B-test", "run-B-test", ..., each with their own classpath definition.
And as we added modules, we copy and pasted big chunks of Ant code, bloating the build file.
This become unbearable recently. And I looked for ways to make the build file manageable again. That's when I found the two new features of Ant: import and macrodef. Both are available in the latest Ant 1.7.0 release.
I won't bore you with the details of how these two tasks work. But it did allow me to break my build file into a
template-build.xmlwhich contains a set of macro definitions, and a bunch of
A-build.xml B-build.xml ...files each importing template-build.xml and instantiate the set of targets for a module. The build.xml then imports all the A-build.xml, ... files and use all the targets in a systematical way.
If you are using Ant, import and macrodef are your friends, just like if you are using C, #import and #define are your friends.
[DISCUSS] Open appropriate GUI from terminal?
This may be something that a casual GNOME user doesn't know.
A Sluug-discuss Thread (login is discuss/freely): On 06:56 Mon 14 Apr, Weiqi Gao wrote:
> Nathan Neff wrote:
> > I'm running GNOME/Ubuntu.
> >
> > Let's say I'm in a terminal, and want to open a PDF document, but don't
> > know the name of the PDF reading program.
> >
> > I can run "nautilus ." (don't forget the dot) and nautilus will start,
> > pointing at the current working directory in the terminal. You can then
> > just double-click the file you want to open.
> >
> > However, I'd like to avoid jumping to nautilus.
> >
> > Is there a command that I can issue that will find the type of the file,
> > and open it using the appropriate program?
> >
> > In Windows, you can use the 'start' command, and I think in OSX you can
> > use the 'open' command.
>
> In GNOME, you can use the 'gnome-open' command from the command line.
> It does the same thing that Nautilus does when you double click the file.
Cool! Is there an equivalent command for KDE?
-Jeff
I'd appreciate it if you can let me know what the corresponding command in KDE is.
(As I mentioned 609 days ago, in Cygwin the command is cygstart.)