2013-04-23 74 views
0

我们正在开发一个netbeans平台,我们将其用作其他netbeans平台的基础。有一个Ant目标可以安装在当前的NetBeans环境中作为一个平台,这将是非常好的。用蚂蚁注册netbeans平台

Atm我们不得不做的工具 - > NetBeans平台 - >添加平台等等,当我们手动进行。

在构建服务器(詹金斯),我们必须有一个批处理脚本,修改build.properties。这是相当凌乱......

在理想的世界,我可以用蚂蚁做到,但我根本不认识蚂蚁,所以我想知道......有没有办法?

回答

0

一旦我看着蚂蚁,这很容易!

当我构建“基础平台”时,我将它作为最终的蚂蚁目标;

<target name ="install-as-platform-into-netbeans" depends="build-zip"> 
     <unzip src="${basedir}/dist/${ant.project.name}.zip" dest="${basedir}/dist"/> 
     <propertyfile file="${user.properties.file}"> 
      <entry key="nbplatform.${ant.project.name}.harness.dir" value="${nbplatform.default.harness.dir}"/> 
      <entry key="nbplatform.${ant.project.name}.label" value="${ant.project.name}"/> 
      <entry key="nbplatform.${ant.project.name}.netbeans.dest.dir" value="${basedir}/dist/${ant.project.name}"/> 
      <entry key="nbplatform.${ant.project.name}.sources" value="${basedir}"/> 
     </propertyfile> 

然后,我必须设置该平台在第二内建的“活跃平台”;

<target name="set-as-active-platform"> 
     <propertyfile file="${basedir}/nbproject/platform.properties"> 
       <entry key="nbplatform.active" value="NAME-OF-PREVIOUS-PLATFORM"/> 
     </propertyfile> 
    </target> 

一个明显的缺点是,我必须有前面的平台编码成NAME-OF-上一个平台的名字,但这个名字犯规经常变化,因此没什么大不了的。