buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:2.4.0-alpha7'
}
}
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
这是否支持Gluon Mobile?
答案 0 :(得分:0)
我已经安装了构建工具25.0.3,并且没有对Gluon插件在Single View项目上生成的所有build.gradle
文件进行任何修改:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.3.8'
}
}
apply plugin: 'org.javafxports.jfxmobile'
repositories {
jcenter()
maven {
url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
}
}
mainClassName = 'com.gluonandroid24.GluonAndroid24'
dependencies {
compile 'com.gluonhq:charm:4.3.7'
}
jfxmobile {
downConfig {
version = '3.6.0'
// Do not edit the line below. Use Gluon Mobile Settings in your project context menu instead
plugins 'display', 'lifecycle', 'statusbar', 'storage'
}
android {
manifest = 'src/android/AndroidManifest.xml'
}
ios {
infoPList = file('src/ios/Default-Info.plist')
forceLinkClasses = [
'com.gluonhq.**.*',
'javax.annotations.**.*',
'javax.inject.**.*',
'javax.json.**.*',
'org.glassfish.json.**.*'
]
}
}
我可以包含Java 8流:
public BasicView(String name) {
super(name);
Label label = new Label("Hello JavaFX World!");
Button button = new Button("Change the World!");
button.setGraphic(new Icon(MaterialDesignIcon.LANGUAGE));
button.setOnAction(e -> label.setText("Sum: " + Stream.of("1", "2", "5")
.mapToInt(Integer::parseInt)
.sum()));
VBox controls = new VBox(15.0, label, button);
controls.setAlignment(Pos.CENTER);
controls.getChildren().stream()
.filter(Label.class::isInstance)
.forEach(System.out::println);
setCenter(controls);
}
在桌面上运行项目并部署它并在Android上成功运行(至少在我的Android 7.1.1设备上)。显然不在iOS上。
jfxmobile插件已经在$ AndroidSdk / build-tools中查找已安装的最新build-tools版本。如果您想设置一些选项,可以设置:
jfxmobile {
...
android {
manifest = 'src/android/AndroidManifest.xml'
buildToolsVersion = '25.0.3'
compileSdkVersion = '25'
minSdkVersion = '25'
targetSdkVersion = '25'
}
}