开发者

Changing dafault Netbeans Platform

Im developing application on top o开发者_运维百科f Netbeans Platform.

In NetBeans IDE it is possible to choose different Netbeans Platform (it can be added under NetBeans Platform Manager), but i cant find option/property to change default selection. Is this even supported on Netbeans IDE?


I can't see a way to do this using the default ant based system. However if you use the maven based approach then it is a simple as editing the pom.xml


Solution for ANT based Nb Platform application is to modify ant build file to create custom properties before building application (separate modules). In this solution I create new properties file and fix the pointer in platform properties file to point to it. This file is later imported before building each module.

1) Create/Modify platform-private.properties to set user.properties.file to your custom one (i.e nbproject/private/build.properties). This file is later used to configure properties when building separate modules.

2) Create new user.properties.file (build.properties) and set nbplatform.default.harness.dir and nbplatform.default.netbeans.dest.dir to correct values (those parameters points to folder where nb platform is located - in my case it is located in project basedir under ./nbrc folder)

<project name="..." basedir=".">

<!-- Basedir property must be converted to use forward slashes (for windows machines) -->
<path id="basedir.path">
    <pathelement path="${basedir}" />
</path>
<pathconvert targetos="unix" property="basedir.unix" refid="basedir.path"/>

<!-- Initialize path to netbeans platform [located in nbrc folder in project root directory -->
<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=${basedir.unix}/nbrc${line.separator}  </echo>


<!-- .. -->

</project>  `   
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜