views:

527

answers:

1

Hi there! I've got a problem which I couldn't solve for a few days, please help me.

I'd like to execute an ant-script within netbeans. the script needs a special classpath which a plugin/module made by myself puts into a "global-variable". The variable can be shown using the netbeans "Manage variables"-dialog. So it's working, I guess

Then I've tried to run the ant-script with: "run Target/advanced" and set the property to: enhanceClassPath=${MAG} (${MAG} contains the special classpah..)

Unfortunately the script contains in the property 'enhanceClassPath' still the value '${MAG}' instead the variable value..

I've got a working and simular example in eclipse, but hadn't any luck with netbeans, I guess the main problem is that netbeans doesn't support variables..

greez Chris

A: 

you can use your IDE variable MAG in your ant script via ${var.MAG}. don't assign it to a custom property (enhanceClassPath).

ax
Could you be more specific, please?I've set in NB a GlobalProperty called "var.MAG".Then I tried to access it in the ant script with<property name="cp" value="${var.MAG}">but the value of cp is still not resolved..
Chris
answer updated - hope this is more specific.
ax
Ok thanks.But it didn't work.. not as custom property neither directly in ant..Do you have any other ideas?
Chris
it works for me - when i debug my (netbeans managed) ant script, i can see var.MAG in the debugger variables window.http://wiki.netbeans.org/IDEVariables says: Variables are stored in build.properties in user directory and in properties file they are prefixed with "var."build.properties is automatically loaded in a netbeans managed ant script via <import file="nbproject/build-impl.xml"/>. if your ant script is *not* managed by nb, you have to include "${netbeans.user}/build.properties" yourself - look into nbproject/build-impl.xml for how to.
ax
Ah.. now I understand! Thanks a lot, I do really recognize your help!!
Chris
if you recognize my help, you could consider accepting my answer. thanks!
ax