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="${user.properties.file}" tofile="${user.properties.file}.new"/ -->

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

    <propertyfile file="${basedir}/nbproject/private/platform-private.properties" comment="">

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

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

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

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

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

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

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

    </propertyfile>

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

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


It automatically creates the nbproject/private/platform-private.properties 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 build.properties 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.