GithubHelp home page GithubHelp logo

maxt / gluonfx-gradle-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gluonhq/gluonfx-gradle-plugin

0.0 0.0 0.0 279 KB

Plugin that simplifies using Gluon Client for Java/JavaFX gradle projects

License: BSD 3-Clause "New" or "Revised" License

Java 100.00%

gluonfx-gradle-plugin's Introduction

GluonFX plugin for Gradle

Plugin Portal Build BSD-3 license

GluonFX plugin for gradle projects leverages GraalVM, OpenJDK and JavaFX 11+, by compiling into native code the Java Client application and all its required dependencies, so it can directly be executed as a native application on the target platform.

Important Notice

Gluon releases the GluonFX plugin for Maven, and this plugin is maintained and kept up to date by the community.

Use at your own risk.

Getting started

To use the plugin, apply the following steps:

1. Apply the plugin

Using the plugins DSL, add:

plugins {
    id 'com.gluonhq.gluonfx-gradle-plugin' version '1.0.15'
}

This requires adding the plugin repository to the settings.gradle file:

pluginManagement {
    repositories {
        gradlePluginPortal()
    }
}
rootProject.name = ...

Alternatively, you can use the buildscript DSL:

buildscript {
    repositories {
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }
    dependencies {
        classpath 'com.gluonhq:gluonfx-gradle-plugin:1.0.15'
    }
}
apply plugin: 'com.gluonhq.gluonfx-gradle-plugin'

2. Tasks

You can run the regular tasks to build and run your project as a regular VM project:

./gradlew clean build
./gradlew run

Once the project is ready, the plugin has these main tasks:

nativeRunAgent

This task can be run to use a tracing agent and generate the required config files for native-image.

Run:

./gradlew nativeRunAgent

nativeCompile

This tasks does the AOT compilation. It is a very intensive and lengthy task (several minutes, depending on your project and CPU), so it should be called only when the project is ready and runs fine on a VM.

Run:

./gradlew build nativeCompile

The results will be available at $buildDir/client/gvm.

nativeLink

When the object is created, this task will generate the native executable for the target platform.

Run:

./gradlew nativeLink

The results will be available at $buildDir/client/$hostPlatform/$AppName.

nativeBuild

This task simply combines nativeCompile and nativeLink.

nativeRun

Runs the executable in the target platform

Run:

./gradlew nativeRun

Or run the three tasks combined:

./gradlew build nativeBuild nativeRun

Or run directly the application from command line:

build/gluonfx/$hostPlatform/$AppName/$AppName    

It will create a distributable native application.

nativePackage

On mobile only, create a package of the executable in the target platform

Run:

./gradlew nativePackage

On iOS, this can be used to create an IPA, on Android it will create an APK.

nativeInstall

Installs the generated package or the binary.

Run:

./gradlew nativeInstall

Note: At the moment, this task is only intended for Android and Linux-AArch64.

Configuration

The plugin allows some configuration to modify the default settings:

gluonfx {
    target = "$target"
    attachConfig {
        version = "$version"
        configuration = "implementation";
        services "lifecycle", ...
    }

    bundlesList = []
    resourcesList = []
    reflectionList = []
    jniList = []

    compilerArgs = []
    linkerArgs = []
    runtimeArgs = []

    javaStaticSdkVersion = ""
    javafxStaticSdkVersion = ""
    graalvmHome = ""

    verbose = false
    enableSwRendering = false

    remoteHostName = ""
    remoteDir = ""
    
    release {
        // Android
        appLabel = ""
        versionCode = "1"
        versionName = "1.0"
        providedKeyStorePath = ""
        providedKeyStorePassword = ""
        providedKeyAlias = ""
        providedKeyAliasPassword = ""
        // iOS
        bundleName = ""
        bundleVersion = ""
        bundleShortVersion = ""
        providedSigningIdentity = ""
        providedProvisioningProfile = ""
        skipSigning = false
    }
}

Check the maven counterpart section for more details.

Requirements

Check the requirements for the target platform before you get started.

Issues and Contributions

Issues can be reported to the Issue tracker

Contributions can be submitted via Pull requests, providing you have signed the Gluon Individual Contributor License Agreement (CLA).

gluonfx-gradle-plugin's People

Contributors

abhinayagarwal avatar almasb avatar gluon-bot avatar johanvos avatar jperedadnr avatar jskov avatar kristofdho avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.