When you’re developing a NB Platform application you can use the “run.extra.args=-J-Xmx256m” pattern in your project or platform properties files, but when you’re building the Zip distribution those settings are lost, so you have to unpack the zip and add your changes manually. That’s a bit annoying when you do many small releases for testing.
One solution to this would be to change the template file in your build harness and add your settings there, but if you’re working in a team and don’t share the harness, that will only apply to your local machine, and it will affect all applications developed with this harness, which may be an unwanted side-effect.
A better way is to override the “build-launchers” ant target which is responsible for copying the app.conf from the harness dir:
1. In the project view navigate to your suite’s “important files” folder double-click the “build script” node to open your build.xml in the editor.
2. Expand the “build-script” node and locate the “build-launchers” target, right click and choose “open” from the menu. This will open up your suite.xml.
3. You can now copy the whole target and add it to your build.xml.
4. Right before the closing tag add this:
<replace file=”${build.launcher.dir}/etc/${app.name}.conf” token=”-Xmx64m” value=”-Xmx256m”></replace>
</target>
5. Now build your zip distribution, your applications .conf file (located in etc and named like your application with the .conf extension) will hold the updated value.
This is not the only way to do this, actually there are many alternatives:
you could e.g. copy your own conf template there instead of the one from the harness, or write a target that doesn’t override everything, but call the original to be more compatible with furture changes, or you could put your harness in svc and have a different one fore each app. Feel free to play around and let me know if you’ve found a nice trick…