Everything,
I have a NetBeans platform project (not just a project that I wrote in NetBeans, but using the rich client environment provided by NetBeans ). I can start the project using the ant run command. Now I want to pass an argument that will work through ant to be accessible using the System.getProperty method.
I understand that I need to use the <sysproperty> node to actually enter the key / value pair into the runtime, but for life I canβt figure out how to make this work with the minimized assembly that NetBeans creates for you (build.xml depends on build -impl.xml, which in turn depends on $ {harness.dir} /suite.xml, which, in turn, depends on $ {harness.dir} /run.xml)
A simple example I found
<target name="run" depends="compile"> <java classname="prop" fork="true"> <sysproperty key="test.property" value="blue" /> </java> </target>
but the problem is that none of my xml files has an easily accessible <java> node. I think I managed to trace the thread of execution in which something is actually being called (in ${harness.dir}/run.xml )
<target name="run" depends="-prepare-as-app,-prepare-as-platform"> <touch file="${cluster}/.lastModified"/> <property name="run.args" value=""/> <property name="run.args.ide" value=""/> <property name="run.args.extra" value=""/> <condition property="run.args.mac" value="-J-Xdock:name=${app.name}" else=""> <os family="mac"/> </condition> <exec osfamily="windows" executable="${run.exe}" failonerror="no" resultproperty="result.prop"> <arg value="--jdkhome"/> <arg file="${run.jdkhome}"/> <arg line="${run.args.common}"/> <arg line="${run.args.prepared}"/> <arg line="${run.args}"/> <arg line="${run.args.ide}"/> <arg line="${run.args.extra}"/> </exec> <exec osfamily="unix" dir="." executable="sh" failonerror="no" resultproperty="result.prop"> <arg value="${run.sh}"/> <arg value="--jdkhome"/> <arg file="${run.jdkhome}"/> <arg line="${run.args.common}"/> <arg line="${run.args.prepared}"/> <arg line="${run.args}"/> <arg line="${run.args.ide}"/> <arg line="${run.args.extra}"/> <arg line="${run.args.mac}"/> </exec> <fail> The application is already running within the test user directory. You must shut it down before trying to run it again. <condition> <and> <isset property="result.prop" /> <or> <equals arg1="${result.prop}" arg2="50346" /> <equals arg1="${result.prop}" arg2="2" /> </or> </and> </condition> </fail> </target>
As you can see, there is no under <java> node, under which I can put my own sysproperty. Also, it seems very wrong to do this to spoof the xml bundle files in order to implement a property that affects only one of my projects and not all of them. So, what is the right way to ensure that the command-line property that I pass to ant to execute ends in a NetBeans platform project?
source share