簡體   English   中英

我可以使用JavaFX本機構建工具擁有多個可執行文件嗎?

[英]Can I have more than one executable file with JavaFX native building tool?

我正在使用JavaFX Gradle插件來構建我的JavaFX應用程序。 是否可以使用不同的主類構建多個可執行文件? 如果是這樣,怎么樣?

這是可能的,因為底層的javapackager支持這一點。

由於我理解你是正確的,你有一個項目,你有多個入口點,現在你想為每個入口點創建本機啟動器/二進制文件。 這在gradle插件中稱為“輔助啟動器”,甚至在javapackager內部。

要使用相同的包創建多個可執行文件,只需在構建文件中添加:

jfx {
    // ... normal configuration ...

    // your secondary entry points, each will create a native executable (and one .cfg-file for each)
    secondaryLaunchers = [
        // second executable
        [
            appName: 'somethingDifferent'
            // will create the same executable, just with a different name (so this is demo-purpose only)
        ],
        // third executable
        [
            appName: 'somethingDifferent2',
            // specify your different entry-point
            mainClass: 'your.different.entrypoint.MainApp'
            // other possible entries: "jfxMainAppJarName", "jvmProperties", "jvmArgs", "userJvmArgs", "nativeReleaseVersion", "needShortcut", "needMenu", "vendor", "identifier"
        ]
    ]
}

免責聲明:我是JavaFX Gradle插件的創建者;)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM