I got this from my friend Bradley,
I have attached a build script which will take a module suite
project and compile it as a platform. The key thing to note is that it
allows you to install 3rd party modules into it. After you build and
use it as a platform, you will create your new application module
suites based off this platform, as opposed to the Netbeans platform.
Please note the build script is mostly documented. For further
information about the techniques used in the build script, you will
need to search Netbeans for "suite chaining" or the readme file in the
harness directory in the Netbeans installation path. Anyway, please
note the following properties in the build.xml file:
<property name="netbeans.platform.dir" value="nb6.1"/>
<property name="platform.home" value="${platform.dir}/platform8"/>
Those (2) properties are set to build based off Netbeans 6.1 Beta.
If you use Netbean 6.0 you will need to change them to nb6.0 and
platform7 respectively. If you need more information, please let me
know. I apologize if this is hard for you to digest. I am very busy
getting a project out the door...
Best of Luck,
On Sat, Mar 29, 2008 at 3:35 AM, Michael Bien <
mbien@...> wrote:
Thank you both for the answers,
cheating is ok for me ;)
it worked perfectly.
Tim Boudreau wrote:
>
>
> Tim Boudreau wrote:
>>
>>
>> Michael Bien wrote:
>>>
>>> is it possible to add a pre-packaged nbm to a suite? Or with other words
>>> how to add a dependency to a module which is no netbeans core module?
>>>
>>
>> - Either make a copy of NetBeans, or if there's a lot of stuff you don't
>> want, create an empty suite. Then build it and create a zip distribution
>> and unpack that.
>>
>
> I should have said here, create an empty suite, and then turn off
> everything you know you're not going to use before you do the zip trick.
>
> I do some similar tricks for the automated builds of the embryonic
> extended platform, to automatically make platform builds with a bunch of
> additional stuff in them. If you own the source for the other module,
> it's just from a different suite, you can just copy the suite's build
> products into the right place under the platform instance, and you've
> de-facto added a cluster with some additional modules; then just make
> sure the paths are appended to the cluster list in $PLATFORM_HOME/etc.
>
> Like I said, it ain't pretty.
>
> -Tim
>
>
--
View this message in context: http://www.nabble.com/adding-a-nbm-to-a-suite---possible--tp16361056p16363101.html
Sent from the Netbeans - Open API mailing list archive at
Nabble.com.
--
Anuradha G
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
<!-- for some information on what you could do (e.g. targets to override). -->
<!-- If you delete this file and reopen the project it will be recreated. -->
<!-- =======================================================================
Description: Module Suite Build with NBM Example
Author: Bradley Longstreth
Contact:
longstrb@...
Date: 09-07-2007
Sample build script for creating a custom module suite (platform) with
'extra' NBMs using Netbeans 6.0 (platform7).
The source code used in this Ant script was derived from the following blog:
http://blogs.sun.com/Chreston/Specifically, the following build script:
http://blogs.sun.com/Chreston/resource/build.xmlHOW TO USE:
1. Create a Module Suite Project.
2. Copy the contents from this build.xml into the Module Suite's build.xml, starting from
Build properties section to the end of the file.
3. Create a subdirectory off of the root project folder called extra (i.e. ProjectFolder/extra )
4. Place any NBM that you want to be installed into the platform into the extra folder.
5. Clean and Build Project.
6. Execute Ant target 'create-platform'.
7. The platform codebase will be built and NBMs installed into the following
directory (relative the the project's path): ../../lib/platform/ProjectName
NOTES:
I threw this Ant script together fairly quickly and with limited knowledge of
Ant. I basically learned by example and usage. Fortunately for
us Netbeans fans, Ant appears to be very powerful and fairly easy to use,
especially with good examples like the Chreston blog. As I learn more about
Netbeans and Ant, I can really see why Netbeans was developed using Ant. Anyway,
I was thinking of possibly enhancing the script by changing how it works a bit
by trying to make the NBMs be part of the Module Suite prior to building and
zipping the platform. I was thinking about doing this by installing the modoles
temporarly into the Suite's plaform prior to executing the build-zip script. Once
the Suite ZIP distribution is created, I would remove the temporary modules from the
source platform. Again, I am still new to this system so I need to research
if this will actually work. Anyway, please try out this script and let me know
how it works or if it needs to be tweaked.
======================================================================== -->
<project name="MyProjectSuite" basedir=".">
<description>Builds the module suite MyProjectSuite.</description>
<import file="nbproject/build-impl.xml"/>
<!-- =======================================================================
Build properties
======================================================================== -->
<!-- get app.name -->
<property file="nbproject/project.properties"/>
<property name="netbeans.platform.dir" value="nb6.1"/>
<property name="netbeans.dest.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir"/>
<property name="platform.dir" value="../../lib/${app.name}"/>
<property name="platform.home" value="${platform.dir}/platform8"/>
<property name="platform.launcher.path" location="${platform.dir}/bin"/>
<property name="platform.dirs" value="${platform.dir}/${netbeans.platform.dir}${path.separator}${platform.dir}/extra"/>
<property name="platform.lib" value="${platform.dir}/${app.name}/modules/platform-lib"/>
<property name="source.nbms" value="./extra"/>
<!-- =======================================================================
Create platform
======================================================================== -->
<target name="create-platform" depends="build-zip">
<delete dir="${platform.dir}"/>
<mkdir dir="${platform.dir}"/>
<unzip src="dist/${app.name}.zip" dest="${platform.dir}/.."/>
<!-- remove branding since we are creating a platform build -->
<delete dir="${platform.dir}/branding"/>
<!-- move all applicable libaries from the /modules/platform-lib dir to ../platformX/lib -->
<!-- <antcall target="move-platform-libs"/> -->
<!-- install downloaded NBMs -->
<antcall target="install-nbms"/>
<!-- replace distribution ZIP with new platform ZIP which includes NBMs -->
<delete file="dist/${app.name}.zip"/>
<zip destfile="dist/${app.name}.zip">
<zipfileset dir="${platform.dir}/" filemode="755" prefix="${app.name}"/>
</zip>
</target>
<target name="-platform.lib">
<condition property="has.platform.lib">
<available file="${platform.lib}"/>
</condition>
</target>
<target name="move-platform-libs" depends="-platform.lib" if="has.platform.lib">
<move todir="${platform.home}/lib">
<fileset dir="${platform.lib}">
<include name="*.*"/>
</fileset>
</move>
<!-- remove platform.lib since it is no longer used -->
<delete dir="${platform.lib}"/>
</target>
<!-- =======================================================================
Fetch downloaded NMBs and install into platform.
======================================================================== -->
<target name="install-nbms" depends="get-nbms">
<!-- copy source NBMs to location where updater expects them -->
<copy todir="${platform.dir}/extra/update/download">
<fileset dir="${source.nbms}">
<include name="*.nbm"/>
</fileset>
</copy>
<!-- run updater to install downloaded NBMs -->
<antcall target="run-updater"/>
</target>
<target name="run-updater">
<!-- run updater to install downloaded NBMs -->
<java classname="org.netbeans.updater.UpdaterFrame"
fork="yes"
failonerror="true"
maxmemory="128m">
<classpath>
<pathelement location="${platform.home}/lib/boot.jar"/>
<pathelement location="${jdkhome}/lib/dt.jar"/>
<pathelement location="${jdkhome}/lib/tools.jar"/>
<pathelement location="${platform.home}/modules/ext/updater.jar"/>
</classpath>
<sysproperty key="netbeans.importclass" value="org.netbeans.upgrade.AutoUpgrade"/>
<sysproperty key="netbeans.home" value="${platform.home}"/>
<sysproperty key="netbeans.user" value="${basedir}"/>
<sysproperty key="netbeans.dirs" value="${platform.dirs}"/>
<jvmarg value="-Xms32m"/>
<jvmarg value="-XX:MaxPermSize=96m"/>
<jvmarg value="-Xverify:none"/>
</java>
</target>
<target name="get-nbms">
<!-- Example NBM download -->
<!--
<get src="
http://www.netbeans.org/download/nbms/50/beta/Libraries/org-netbeans-libs-xmlbeans.nbm"
dest="${source.nbms}/org-netbeans-libs-xmlbeans.nbm"
usetimestamp="true"/>
-->
</target>
<target name="check">
<echo message="app.name=${app.name}"/>
</target>
<!-- =======================================================================
Runs the application skipping source checks.
======================================================================== -->
<target name="fastrun" depends="-init,branding,-jdk-init">
<ant antfile="${harness.dir}/run.xml" target="run"/>
</target>
</project>