对所有平台使用通用构建文件

要为运行应用程序的每个平台生成独立的应用程序 Binding 包,必须在每个平台上运行打包工具。您可以选择使用特定于平台的构建文件,也可以设置一个可以在所有平台上运行的构建文件。特定于平台的文件可以更容易设置,但是随后您必须维护多个文件。

使用文件关联中描述的文件关联演示使用了一个可在所有平台上运行的构建文件。

构建文件的以下元素支持其在所有平台上的使用:

<condition property="main.class" 
           value="sample.fa.ScriptRunnerApplication"
           else="sample.fa.ScriptRunnerApplicationMac">
    <not><os family="mac"/></not>
</condition>
<condition property="excludes" value="**/*Mac.java">
    <not><os family="mac"/></not>
</condition>
<fx:bundleArgument arg="classpath" value="FileAssociationsDemo.jar lib/groovy-all-2.3.8.jar"/>

<fx:bundleArgument arg="win.exe.systemWide" value="true"/>

<fx:bundleArgument arg="linux.bundleName" value="file-association-demo"/>
<fx:bundleArgument arg="email" value="maintainer@example.com"/>
<fx:bundleArgument arg="mac.CFBundleName" value="File Assoc Demo"/>
<fx:bundleArgument arg="win.menuGroup" value="Java Demos"/>

有关完整的构建代码,请参见build.xml

您可以从自包含的应用示例下载文件关联演示的源文件。

首页