变量是否有可能从NBI(安装项目)的ant脚本访问在platform.properties定义文件中的变量,如nbjdk.active
这是设置好的,当一个项目Java平台改变了吗?访问platform.properties从NBI ant脚本
目标是从ant脚本中选择一个打包的jre(32或64)作为这个变量的函数。
在此先感谢。
编辑: 这是当我尝试访问该变量的构建脚本片断:
<target name="-generate-bundles">
<for-each property="platform" list="${target.platforms}" separator=" ">
<condition property="bundle.extention.${platform}" value="exe">
<contains string="${platform}" substring="windows"/>
</condition>
<condition property="bundle.extention.${platform}" value="sh">
<or>
<contains string="${platform}" substring="linux"/>
<contains string="${platform}" substring="solaris"/>
</or>
</condition>
<condition property="bundle.extention.${platform}" value="zip">
<contains string="${platform}" substring="macosx"/>
</condition>
<set property="bundle.extention" source="bundle.extention.${platform}"/>
<create-bundle root="${output.dir}/registry-temp"
platform="${platform}"
target="${bundles.release.dir}/${bundle.files.prefix}-${platform}.${bundle.extention}">
<component uid="${main.product.uid}" version="1.0.0.0.0"/>
<!-- HERE I WANT TO CHECK THE VARIABLE AND SELECT ONE OF THE PACKED JRE -->
<!--<property name="nbi.bundled.jvm.file" value="D:\packed\jre1.8.0_65_32bits\jre.exe"/>-->
<property name="nbi.bundled.jvm.file" value="D:\packed\jre1.8.0_25_64bits\jre.exe"/>
</create-bundle>
<echo>************************</echo>
<echo>********* OS: ${platform}</echo>
<echo>********* Arch: ${os.arch}</echo>
<echo>********* JDK in NB: ${jdk.home}</echo>
<echo>********* JDK in platform.properties: HERE I TRY TO ACCESS VARIABLE</echo>
<echo>************************</echo>
<if property="bundle.extention" value="zip">
<antcall target="zip-to-tgz">
<param name="input.file" value="${bundles.release.dir}/${bundle.files.prefix}-${platform}.zip"/>
<param name="output.file" value="${bundles.release.dir}/${bundle.files.prefix}-${platform}.tgz"/>
</antcall>
<delete file="${bundles.release.dir}/${bundle.files.prefix}-${platform}.zip"/>
</if>
</for-each>
<echo>Installer(s) for [${target.platforms}] are available at ${bundles.release.dir}</echo>
</target>
,这是platform.properties文件中的变量:
nbjdk.active=JDK_1.8.0_65-32bits
你可以请你展示你当前的构建脚本和正在面临的确切问题吗? – Rao
有没有解决这个问题的提示? – pacobm
至少我想如果这是可能实现的,有人可以告诉我这个吗? – pacobm