Skip to main content

Simplifying blueMarine build process

Posted by fabriziogiudici on March 22, 2009 at 9:19 AM PDT

This is a pretty intense period about blueMarine - crossing fingers, 0.9.RC3 should see the light on March 30 - there are just a dozen issues to fix, all of them are 50% to 66% completed.

But three years after the switch to NetBeans Platform, at last I've been able to simplifying the build process, back to the most simple approach: you just checkout sources and run Ant. Previously you had to open the project at least once with the NetBeans IDE - an obvious thing if you are a blueMarine developer, but I've received a few complaints by people that wanted just to try the build to see the project structure and didn't want to download the NetBeans IDE for that. Furthermore, needing the NetBeans IDE runtime made things a bit more complex when deploying with Hudson, especially if you go with a Hudson instance that you don't own (in fact it was Felipe's offer that pushed me to finish this thing).

The solution was not complex. indeed you just need to check out a copy of the harness (a set of Ant scripts and extensions) together with the project (I did under tools/harness); then you put this code to be executed at the start of the Ant script:

    <!-- copy file="${}" tofile="${}.new"/ -->

    <mkdir dir="${basedir}/nbproject/private"/>

    <propertyfile file="${basedir}/nbproject/private/" comment="">

    <!-- propertyfile file="${}.new" comment=""-->

        <!-- entry key="nbplatform.${}.harness.dir" value="$${nbplatform.default.harness.dir}"/-->

        <entry key="nbplatform.${}.harness.dir" value="${basedir}/tools/harness"/>

        <entry key="nbplatform.${}.label" value="${}"/>

        <entry key="nbplatform.${}.netbeans.dest.dir" value="${basedir}/${platform.dir}"/>

        <entry key="nbplatform.${}.sources" value="${tmp.platform.source.path}"/>

        <entry key="nbplatform.${}.javadoc" value="${tmp.platform.javadoc.path}"/>


    <!-- move file="${}" tofile="${}.bak"/-->

    <!-- move file="${}.new" tofile="${}"/-->

It automatically creates the nbproject/private/ file that is normally generate by NetBeans the first time you open a project; and puts inside it the definitions o a few properties that make up a custom platform, pointing to the private harness.

PS The commented out lines should also put a copy of the definitions inside the configuration file of the NetBeans IDE, but I've still to test them with care. This further step is needed if you want the IDE to be aware of the sources and the JavaDoc of the modules in the custom platform.