Skip to content

Instantly share code, notes, and snippets.

@isijara
Forked from abythell/configure.xml
Last active February 9, 2016 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isijara/48eb4b4ab772904495ef to your computer and use it in GitHub Desktop.
Save isijara/48eb4b4ab772904495ef to your computer and use it in GitHub Desktop.
Ant script to download and configure the Netbeans platform, which enables Netbeans platform applications to be built without the IDE
<!--
Netbeans Platform Download-and-Config
Copyright 2013, Andrew Bythell <abythell@ieee.org>
http://angryelectron.com/
This Ant script is used to download and configure the Netbeans platform,
allowing Netbeans platform applications to be built without the IDE.
-->
<project name="configure-platform" default="configure" basedir=".">
<!--
User-settings
-->
<property name="version" value="7.2.1"/>
<!--
These don't need to modified
-->
<path id="basedir.path"> <pathelement path="${basedir}" /> </path>
<pathconvert targetos="unix" property="basedir.unix" refid="basedir.path"/>
<property name="netbeans" value="${basedir.unix}/netbeans-${version}"/>
<property name="bootstrap.url" value="http://deadlock.netbeans.org/hudson/job/nbms-and-javadoc/lastStableBuild/artifact/nbbuild/netbeans/harness/tasks.jar"/>
<property name="netbeans.updatecenter.url" value="http://updates.netbeans.org/netbeans/updates/${version}/uc/final/distribution/catalog.xml.gz"/>
<!--
Download the Netbeans platform and build harness
-->
<target name="download">
<mkdir dir="${netbeans}/harness"/>
<get
src="${bootstrap.url}"
dest="${netbeans}/harness/tasks.jar"
usetimestamp="true"
verbose="true"
/>
<taskdef name="autoupdate"
classname="org.netbeans.nbbuild.AutoUpdate"
classpath="${netbeans}/harness/tasks.jar"
/>
<autoupdate installdir="${netbeans}" updatecenter="${netbeans.updatecenter.url}">
<modules includes=".*" clusters="harness[0-9]*"/>
<modules includes=".*" clusters="platform[0-9]*"/>
</autoupdate>
</target>
<!--
Configure the Netbeans build harness to use the downloaded platform
-->
<target name="configure" depends="download">
<mkdir dir="nbproject/private"/>
<echo file="nbproject/private/platform-private.properties">user.properties.file=${basedir.unix}/nbproject/private/build.properties${line.separator}</echo>
<echo file="nbproject/private/build.properties">nbplatform.default.harness.dir=${nbplatform.default.netbeans.dest.dir}/harness${line.separator}</echo>
<echo file="nbproject/private/build.properties" append="true">nbplatform.default.netbeans.dest.dir=${netbeans}${line.separator}</echo>
</target>
<!--
Remove the downloaded platform and build harness. This allows the Netbeans IDE to set the paths
to the stock values.
-->
<target name="clean">
<delete dir="nbproject/private" />
<delete dir="${netbeans}" />
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment