Find Demi Moore in NetBeans IDE 4.1!

In Save Demi Moore in NetBeans IDE 4.1!, you saved the Demi Moore macro by using an Ant script that you integrated into NetBeans IDE 4.1:

  <target name="save-demi-moore" description="Save Demi Moore">
     <copy  todir="c:\\DemiMoore\\config">
           <fileset dir="C:\\Documents and Settings\\${}\\.netbeans\\${release.number}\\config"/>

But notice how clumsy the fileset is! You need to define the ${} and ${release.number} in a file first, and then import it into your build.xml file, otherwise the save-demi-moore target doesn't work. To be more correct, in fact, you'd need to define the whole path to the config directory in a file. After all, what happens when the path to the user directory changes? Therefore, the fileset should probably be like this:

<fileset dir="${}\\config"/>

However, when you run the Ant script introduced in yesterday's blog entry, something really cool happens. Try it. Put this Ant script in your build.xml and then run it:

<target name = "echoprops" description = "echoprops">
  <echoproperties destfile="nbproject/"/>

Now go to the nbproject folder in the Files window and notice that there is a file. Expand the node in the Files window and then expand it again. You'll see a long list of properties. Keep scrolling down and you'll find these:

These could be quite useful in an Ant script, right? If, for example, you double-click netbeans.user, you'll see this in the Source Editor:

netbeans.user=C\\:\\\\Documents and Settings\\\\Administrator\\\\.netbeans\\\\dev

Now, correct me if I'm wrong, but isn't that where the Demi Moore macro lives? So, you don't even need to create a property for the user directory, because it's already there. And without the echoprops target, you would never have known about the netbeans.user property! So, now you can change the save-demi-moore target so that it is as follows:

  <target name="save-demi-moore" description="Save Demi Moore">
     <copy  todir="c:\\DemiMoore\\config">
           <fileset dir="${netbeans.user}\\config"/>

And another cool thing is that the IDE knows about all of these properties automatically, so you don't need to import the file in your build.xml file. You can just run the target as if you knew where Demi Moore lived all along.


Geertjan, I think your obsession with Demi Moore is getting out of hand. Ashton Kutcher called me and said that if you build any more Ant scripts with his girlfriend in them, he's gonna kick yer butt!!!

Posted by john.c on June 09, 2005 at 09:03 PM PDT #

I'll be ready for him. I've got a very efficient little "delete-ashton" Ant script that's got his name all over it.

Posted by Geertjan on June 09, 2005 at 09:12 PM PDT #

NetBeans as an IDE rocks. This is the first and only one that supports Demi Moore plugins... Talk about RICH client platform! Ludo

Posted by Ludo on June 10, 2005 at 12:10 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.


« June 2016