• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

javafxports/javafxmobile-plugin: A gradle plugin for building mobile application ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

javafxports/javafxmobile-plugin

开源软件地址(OpenSource Url):

https://github.com/javafxports/javafxmobile-plugin

开源编程语言(OpenSource Language):

Java 65.7%

开源软件介绍(OpenSource Introduction):

javafxmobile-plugin Build Status Maven Central

The javafxmobile-plugin is a gradle plugin that unifies the building of Java and JavaFX applications for different target platforms:

  • desktop
  • android
  • ios

Before you start

javafxmobile-plugin version 1.x brought Java 8 to mobile development. Version 2.x is an upgrade of the plugin that enables Java 9 development by leveraging Gluon VM. Gluon VM is Gluon's custom developed Java virtual machine that specifically targets mobile devices.

Note! Gluon VM is still in active development and is at the moment only supported on iOS devices. If you want to develop an application for production, please use the stable 1.x version. If you want to experiment with Java 9 features, please use the new 2.x version.

Getting started

IDE plugin

The easiest way to get started is by using the Gluon IDE plugin for your IDE:

Once the IDE plugin is installed, you can create a new Gluon Mobile project.

Sample

A complete basic sample is also available from the Gluon samples repository:

https://github.com/gluonhq/gluon-samples/tree/master/singleview-gluonvm

Prerequisites

General

  1. JDK 9
  2. Gradle 4.2+

iOS

  1. A Mac with MacOS X 10.13.2 or superior

  2. Xcode 9.2 or superior, available from the Mac App Store

  3. To deploy on an iOS device, the usbmuxd library, a cross-platform software library that talks the protocols to support iOS devices. Install it with the use of Homebrew:

    brew install usbmuxd
    
  4. It is highly recommended to increase the Java stack size, by adding the following option to the ~/.gradle/gradle.properties file:

    org.gradle.jvmargs=-Xms256m -Xmx4096m -Xss2m
    

Be aware that the first time the plugin runs an iOS task, it will take a long time (more than 15 minutes) to ahead-of-time compile all the Java modules. After this finishes successfully, all these modules are cached locally (~/.gvm/aot), so the next runs will be shorter (just a few minutes).

Android

Note! Be aware that Java 9 APIs on Android are not supported. If you use version 2 of javafxmobile-plugin, you must make sure that you don't use any new Java 9 APIs.

  1. The Android SDK command line tools, available here

  2. Use the sdkmanager command line tool to install the following packages:

    ANDROID_SDK/tools/bin/sdkmanager "platform-tools" "build-tools;27.0.3" "platforms;android-25" "extras;android;m2repository" "extras;google;m2repository"
    

Note! You must run the sdkmanager using Java 8. Before running this command, set your JAVA_HOME variable to a Java 8 installation, e.g.

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/

Make sure to switch back to Java 9 for your mobile development.

  1. Define a global gradle property named ANDROID_HOME inside ~/.gradle/gradle.properties that points to the location of the Android SDK:

    ANDROID_HOME=/path/to/android-sdk-directory
    
  2. Make sure to set the source and target compatibility in build.gradle to Java 8 to make your applications deployable on Android.

    sourceCompatibility = 1.8
    targetCompatibility = 1.8
    

Usage

If you create your project without the use of the IDE plugins, add the following to your build.gradle:

buildscript {
    repositories {
        jcenter()
        google()
        maven {
            url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
        }
    }
    dependencies {
        classpath 'org.javafxports:jfxmobile-plugin:2.0.8'
    }
}

apply plugin: 'org.javafxports.jfxmobile'

repositories {
    jcenter()
}

License

This project is licensed under the 3-Clause BSD license.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
mgk/s3-plugin: Gradle S3 Plugin发布时间:2022-06-18
下一篇:
zasadnyy/unity-gradle-plugin: Gradle plugin to build Unity 3D projects发布时间:2022-06-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap