how to setup gradle for TornadoFx/JavaFx - javafx

I'm trying to create a TornadoFx project in IntelliJ ide..
on build it shows the error
Error: JavaFX runtime components are missing, and are required to run this application
here's the build.gradle file
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.3.40'
id 'org.openjfx.javafxplugin' version '0.0.7'
}
javafx {
version = "12"
modules = ['javafx.controls', 'javafx.base', 'javafx.fxml', 'javafx.graphics']
}
group 'tornado1'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
testCompile group: 'junit', name: 'junit', version: '4.12'
implementation 'no.tornado:tornadofx:1.7.19'
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
and a screenshot of the libraries in the project structure

Related

java.lang.ClassNotFoundException: com.google.apphosting.utils.remoteapi.RemoteApiServlet

I am getting this error while deploying a new version.
Build tool: gradle
Although the same code with a different version that was deployed some time back is working well. The exceptions are as below. On local env code is working fine.
org.eclipse.jetty.servlet.BaseHolder doStart: (BaseHolder.java:101)
java.lang.ClassNotFoundException: com.google.apphosting.utils.remoteapi.RemoteApiServlet
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at com.google.apphosting.runtime.ApplicationClassLoader.findClass(ApplicationClassLoader.java:135)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.eclipse.jetty.util.Loader.loadClass(Loader.java:86)
at org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:95)
at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:363)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:891)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:349)
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1406)
at com.google.apphosting.runtime.jetty9.AppEngineWebAppContext.startWebapp(AppEngineWebAppContext.java:175)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1368)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:778)
at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:262)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:522)
at com.google.apphosting.runtime.jetty9.AppEngineWebAppContext.doStart(AppEngineWebAppContext.java:120)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at com.google.apphosting.runtime.jetty9.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:240)
at com.google.apphosting.runtime.jetty9.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:178)
at com.google.apphosting.runtime.jetty9.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:120)
at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchServletRequest(JavaRuntime.java:747)
at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchRequest(JavaRuntime.java:710)
at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:680)
at com.google.apphosting.runtime.JavaRuntime$NullSandboxRequestRunnable.run(JavaRuntime.java:872)
at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:270)
at java.lang.Thread.run(Thread.java:748)
build.gradle file is as below: I am sharing the main module file. Other build.gradle file are just the supporting files.
/*
configurations {
compile.exclude group: 'com.google.http-client'
}
*/
configurations.runtime {
exclude group: 'com.ibm.websphere', module: 'uow'
exclude group: 'org.apache.geronimo.specs', module: 'geronimo-servlet_2.5_spec'
exclude group: 'javax.servlet', module: 'jsp-api'
exclude group: 'com.sun', module: 'tools'
exclude group: 'ant', module: 'ant'
exclude group: 'com.wadpam', module: 'docrest-doclet'
exclude group: 'com.wadpam', module: 'docrest-api'
}
dependencies {
compile ('com.goldengekko:user-service:1.0.5') {
transitive = true
}
compile ('com.goldengekko:security-support:1.0.2') {
transitive = true
}
compile 'javax.servlet:servlet-api:3.0'
compile("com.goldengekko:user-security-mgmt:2.1.112") {
//exclude module: 'appengine-gcs-client'
exclude module: 'docrest-doclet'
exclude module: 'commons-dbcp'
exclude module: 'spring-jdbc'
exclude module: 'log4j'
exclude group: 'javax.mail', module: 'mail'
exclude module: "geronimo-jpa_3.0_spec"
exclude group: "javax.activation", module: "activation"
exclude group: "javax.servlet", module: "servlet-api"
exclude group: 'com.google.http-client:google-http-client'
exclude group: 'com.google.http-client', module: 'google-http-client-jackson2'
exclude group: 'com.goldengekko', module: 'gae-support'
//changing = true //for snapshot
}
compile('com.goldengekko:gae-support:2.0.24') {
transitive = true
exclude group: 'com.goldengekko', module: 'core-server'
exclude group: 'com.google.http-client:google-http-client'
exclude group: 'com.google.http-client', module: 'google-http-client-jackson2'
exclude group: 'com.google.appengine.tools', module: 'appengine-gcs-client'
}
compile('com.google.appengine.tools:appengine-gcs-client:0.5') {
transitive = true
exclude group: 'com.google.http-client', module: 'google-http-client-jackson2'
exclude group: 'com.google.api-client', module: 'google-api-client-appengine'
}
compile('com.google.api-client:google-api-client-appengine:1.23.0')
compile ('com.google.http-client:google-http-client-jackson2:1.19.0')
compile ('com.google.http-client:google-http-client:1.19.0')
compile ('com.google.code.gson:gson:1.5')
compile('net.sf.mardao:mardao-gae:2.3.3') {
transitive = true
}
compile('com.goldengekko:core-server:1.0.57') {
transitive = true
}
runtime 'org.springframework.social:spring-social-facebook:1.1.0.M1'
compile ('com.goldengekko:crud-support:1.0.2') {
transitive = true
}
compile ('com.goldengekko.android:networking:1.9') {
transitive = true
}
compile('com.goldengekko:mobile-push-support:1.1.7') {
transitive = false
}
compile('com.wadpam.gaelic:gaelic-oauth2-provider:1.0.8') {
transitive = true
}
compile ('com.wadpam.gaelic:gaelic-domain:1.0.8') {
transitive = true
}a
compile ('com.wadpam.gaelic:gaelic-appengine:1.0.8') {
transitive = true
}
/*
compile ('com.fasterxml.jackson.core:jackson-annotations:2.5.4') {
transitive = true
}
compile ('com.fasterxml.jackson.core:jackson-databind:2.5.4') {
transitive = true
} */
runtime ('cglib:cglib:2.2.2') {
transitive = true
}
compile ('com.google.appengine:appengine-api-1.0-sdk:1.9.60') {
transitive = true
}
compile ('com.google.appengine:appengine-api-labs:1.9.60') {
transitive = true
}
compile group: 'commons-collections', name: 'commons-collections', version: '3.2.1'
//providedCompile('javax.servlet:servlet-api:2.5') { transitive=false}
compile('org.springframework:spring-core:4.0.9.RELEASE') {
force = true
transitive = true
}
compile ('org.springframework:spring-tx:4.0.9.RELEASE') {
force = true
transitive = false
}
compile ('commons-lang:commons-lang:2.6') {
force = true
transitive = false
}
compile ('org.springframework:spring-webmvc:4.0.9.RELEASE') {
force = true
transitive = true
}
compile ('com.ibm.websphere:com.springsource.com.ibm.websphere.uow:6.0.2.17') {
force = true
transitive = true
}
compile ('org.springframework:spring-oxm:4.0.9.RELEASE') {
transitive = true
}
compile ('org.apache.axis:axis:1.4') {
transitive = true
}
compile ('javax.xml:jaxrpc-api:1.1') {
transitive = true
}
compile ('commons-discovery:commons-discovery:0.4') {
transitive = true
}
compile ('wsdl4j:wsdl4j:1.6.2') {
transitive = true
}
compile ('net.sf.ehcache:ehcache:1.6.2') {
transitive = true
}
compile ('org.codehaus.groovy:groovy-all:1.7.2') {
transitive = true
}
compile ('commons-io:commons-io:2.4') {
transitive = true
}
compile ('commons-fileupload:commons-fileupload:1.3') {
transitive = true
}
compile 'org.osgeo:proj4j:0.1.0'
compile 'uk.co.jemos.podam:podam:3.3.2.RELEASE'
compile 'net.sf.opencsv:opencsv:2.2'
compile 'org.springframework.ws:spring-ws:1.5.9'
compile 'com.amazonaws:aws-java-sdk-sns:1.10.26'
compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.6.3'
runtime ('org.springframework.social:spring-social-twitter:1.1.0.M1') {
transitive = true
}
runtime('org.springframework.social:spring-social-salesforce:1.0') {
transitive = true
}
runtime('com.goldengekko.social:spring-social-gaelic:1.0')
runtime('com.goldengekko:core-domain:1.0.3')
runtime('org.springframework.social:spring-social-core:1.1.4.RELEASE') {
transitive = true
}
runtime('org.springframework.social:spring-social-facebook:1.1.1.RELEASE') {
transitive = true
}
runtime('org.springframework.social:spring-social-google:1.0.0.M2') {
transitive = true
exclude group: 'com.google.http-client', module: 'google-http-client'
exclude group: 'com.google.http-client', module: 'google-http-client-jackson2'
}
compileOnly 'com.goldengekko:docrest-doclet:3.0.7'
compile 'net.sf.opencsv:opencsv:2.0'
compile 'org.projectlombok:lombok:1.18.4'
}
This error is due to the old SDK,
here you can download the most updated version of it.

Cannot Change Strategy of Configuration SQLite

In my Gradle project, I have a dependency for SQLite.
Here is my build.gradle:
import groovy.sql.Sql
buildscript {
ext{
osPackageVersion = "3.4.0"
kotlin_version = '1.2.41'
requery_version = '1.5.1'
sqlite_jdbc = '3.7.2'
rxkotlin_version = '2.2.0'
sqlDirPath = "src" + File.separator + "main" + File.separator + "Resources" + File.separator + "TestAppDbInit.sql"
}
repositories {
mavenCentral()
jcenter()
maven{
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "edu.sc.seis.gradle:launch4j:2.4.4"
classpath group: 'org.jooq', name: 'jooq-meta-extensions', version: '3.11.2'
classpath 'org.jooq:jooq-codegen:3.11.2'
classpath 'org.xerial:sqlite-jdbc:3.7.2'
}
}
plugins {
id 'java'
id 'nu.studer.jooq' version '3.0.1'
}
group 'org.wycliffeassociates.translationrecorder'
apply plugin: 'kotlin'
apply plugin: 'kotlin-kapt'
apply plugin: 'edu.sc.seis.launch4j'
sourceCompatibility = 1.8
configurations {
sqllite
}
repositories {
mavenCentral()
jcenter()
maven { url 'https://jitpack.io'}
maven { url "https://plugins.gradle.org/m2/" }
maven { url 'https://mvnrepository.com/artifac/'}
maven { url "https://dl.bintray.com/kotlin/exposed" }
maven { url "https://dl.bintray.com/dua3/public" }
}
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
dependencies {
compile "no.tornado:tornadofx:1.7.16"
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compile "com.github.thomasnield:rxkotlinfx:2.2.2"
compile "io.reactivex.rxjava2:rxkotlin:$rxkotlin_version"
compile 'org.jooq:jooq:3.11.2'
compile group: 'org.xerial', name: 'sqlite-jdbc', version: "$sqlite_jdbc"
jooqRuntime group: 'org.jooq', name: 'jooq-meta-extensions', version: '3.11.2'
jooqRuntime 'org.xerial:sqlite-jdbc:3.7.2'
sqllite 'org.xerial:sqlite-jdbc:3.7.2'
kapt "io.requery:requery-processor:$requery_version"
compile "com.squareup.retrofit2:retrofit:2.0.0"
compile "com.squareup.retrofit2:converter-moshi:2.0.0"
compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
compile 'com.google.dagger:dagger:2.16'
kapt 'com.google.dagger:dagger-compiler:2.16'
implementation 'com.github.WycliffeAssociates:8woc2018-common:dev-SNAPSHOT'
compile 'com.github.WycliffeAssociates:jdenticon-kotlin:-SNAPSHOT'
compile 'de.jensd:fontawesomefx-commons:9.1.2-jpms'
compile 'de.jensd:fontawesomefx-materialicons:2.2.0-9.1.2-jpms'
compile 'de.jensd:fontawesomefx-icons525:4.2.0-9.1.2-jpms'
compile 'com.github.afester.FranzXaver:Examples:0.1'
compile 'com.jfoenix:jfoenix:8.0.5' // Java 8
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile "org.mockito:mockito-core:2.+"
testCompile "org.mockito:mockito-core:2.+"
testCompile 'org.powermock:powermock-module-junit4:2.+'
testCompile 'org.powermock:powermock-module-junit4-rule:2.+'
testCompile 'org.powermock:powermock-api-mockito2:2.+'
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
URLClassLoader loader = GroovyObject.class.classLoader
configurations.sqllite.each { File file ->
loader.addURL(file.toURL())
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
I try to run the build for the project, and I get the following error:
Caused by: org.gradle.api.InvalidUserDataException: Cannot change strategy of configuration ':sqllite' after it has been resolved.
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.preventIllegalMutation(DefaultConfiguration.java:896)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.validateMutation(DefaultConfiguration.java:867)
at org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.DefaultCachePolicy.eachModule(DefaultCachePolicy.java:161)
at org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.DefaultCachePolicy.cacheChangingModulesFor(DefaultCachePolicy.java:121)
at org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.DefaultResolutionStrategy.cacheChangingModulesFor(DefaultResolutionStrategy.java:190)
at org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.DefaultResolutionStrategy.cacheChangingModulesFor(DefaultResolutionStrategy.java:186)
at org.gradle.api.artifacts.ResolutionStrategy$cacheChangingModulesFor.call(Unknown Source)
at build_2rl70kyg6ax354v7xbsnpa8n1$_run_closure8.doCall(C:\Users\dipinton\8woc2018-jvm\build.gradle:114)
at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:71)
at org.gradle.util.ConfigureUtil.configureTarget(ConfigureUtil.java:155)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:106)
at org.gradle.util.ConfigureUtil$WrappedConfigureAction.execute(ConfigureUtil.java:167)
at org.gradle.api.internal.DefaultDomainObjectCollection.all(DefaultDomainObjectCollection.java:158)
at org.gradle.api.internal.DefaultDomainObjectCollection.all(DefaultDomainObjectCollection.java:174)
at org.gradle.api.DomainObjectCollection$all.call(Unknown Source)
at build_2rl70kyg6ax354v7xbsnpa8n1.run(C:\Users\dipinton\8woc2018-jvm\build.gradle:113)
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:90)
... 99 more
It's my impression that this error I'm receiving has to do with the fact that I have 2 configurations blocks. One for configuring my SQLite module, and another for handling the resolution strategy of all modules. These two closures seem to be conflicting with one another.
Does anyone have any suggestions on how to remove the conflict between these two closures?
This working with addUrl on the copy of configuration:
def sqliteCopy = configurations.sqlite.copy()
sqliteCopy.each {File file ->
loader.addURL(file.toURI().toURL())
}
instead of:
configurations.sqllite.each { File file ->
loader.addURL(file.toURL())
}
or downgrade com.android.tools.build:gradle to 3.1.4 version.

Cannot add task ':jettyRun' as a task with that name already exists

I am using gretty as my container for building my spring project . But when i issue the command gradle clean or gradle jettyRun ,i am getting the following problem
Cannot add task ':jettyRun' as a task with that name already exists.
PFB my build.gradle file
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'eclipse-wtp'
apply plugin: 'jetty' //too old, Jetty6, use gretty
apply plugin: 'org.akhikhl.gretty'
apply plugin: 'idea'
apply plugin: 'jacoco' //code coverage
def springVersion = "4.2.4.RELEASE"
def jdkVersion = 1.8
def junitVersion = "4.12"
def logbackVersion = "1.1.3"
def jclOverSlf4jVersion = "1.7.14"
def jstlVersion = "1.2"
def hamcrestVersion = "1.3"
def servletApiVersion = "3.1"
sourceCompatibility = jdkVersion
targetCompatibility = jdkVersion
repositories {
mavenLocal()
mavenCentral()
}
task wrapper(type: Wrapper) {
gradleVersion = '2.10'
}
configurations.all {
exclude group: "commons-logging", module: "commons-logging"
}
dependencies {
compile 'org.slf4j:jcl-over-slf4j:' + jclOverSlf4jVersion
compile 'ch.qos.logback:logback-classic:' + logbackVersion
compile 'org.springframework:spring-webmvc:' +springVersion
compile 'javax.servlet:jstl:' + jstlVersion
compile 'org.springframework:spring-test:' + springVersion
//exclude the build in hamcrest
testCompile('junit:junit:' + junitVersion) {
exclude group: 'org.hamcrest'
}
testCompile 'org.hamcrest:hamcrest-library:' + hamcrestVersion
//include in compile only, exclude in the war
providedCompile 'javax.servlet:javax.servlet-api:' + servletApiVersion
}
//Gretty
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.akhikhl.gretty:gretty:+'
}
}
gretty {
//port = 9000
contextPath = 'loanSharks'
servletContainer = 'jetty9'
}
//For Eclipse IDE only
eclipse {
wtp {
component {
//define context path, default to project folder name
contextPath = 'loanSharks'
}
}
}
jacoco {
toolVersion = "0.7.5+"
reportsDir = file("$buildDir/reports/jacoco")
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}
Even removes plugin: 'jetty', but I am being still with the error:
Execution failed for task ':jettyRun'.
Cannot call TaskInputs.property(String, Object) on task ':jettyRun' after task has started execution.

Browser Service don't work on android device

I have uses the Browser Service for Gluon charm down. But It not work. Someone can help me please? I don't have any Error . That is my Build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.3.1'
}
}
apply plugin: 'org.javafxports.jfxmobile'
repositories {
jcenter()
maven {
url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
}
}
mainClassName = 'com.gluonapplication.GluonApplication'
dependencies {
compile 'com.gluonhq:charm:4.2.0'
androidRuntime 'org.sqldroid:sqldroid:1.0.3'
androidCompile 'org.glassfish:javax.json:1.0.4'
androidRuntime 'com.google.zxing:core:3.2.1'
compile group: 'org.xerial', name: 'sqlite-jdbc', version: '3.15.1'
compile group: 'org.sqldroid', name: 'sqldroid', version: '1.0.3'
compile group: 'com.gluonhq', name: 'charm-down-desktop', version: '0.0.2'
compile group: 'com.gluonhq', name: 'charm-down-common', version: '0.0.1'
compile group: 'com.gluonhq', name: 'charm-down-android', version: '0.0.1'
compileNoRetrolambda 'com.airhacks:afterburner.mfx:1.6.2'
compile group: 'com.gluonhq', name: 'charm-down-plugin-browser', version: '3.2.0'
compile group: 'com.gluonhq', name: 'charm-down-plugin-barcode-scan-android', version: '3.2.0'
compile group: 'com.gluonhq', name: 'charm-down-plugin-battery', version: '3.2.0'
compile group: 'com.gluonhq', name: 'charm-down-plugin-dialer-android', version: '3.2.0'
compile group: 'com.gluonhq', name: 'charm-down-plugin-pictures', version: '3.2.0'
compile group: 'com.gluonhq', name: 'charm-down-plugin-position', version: '3.2.0'
}
jfxmobile {
downConfig {
version = '3.1.0'
plugins 'cache','display', 'lifecycle', 'statusbar', 'storage'
}
android {
manifest = 'src/android/AndroidManifest.xml'
applicationPackage = 'org.javafxports.ensemble'
}
ios {
infoPList = file('src/ios/Default-Info.plist')
forceLinkClasses = [
'com.gluonapplication.**.*',
'com.gluonhq.**.*',
'javax.annotations.**.*',
'javax.inject.**.*',
'javax.json.**.*',
'org.glassfish.json.**.*',
'ensemble.**.*'
]
}
}
and i have implemented the Service like so
public void browser() {
Services.get(BrowserService.class).ifPresent(service -> {
try {
service.launchExternalBrowser("www.google.com");
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
});
}
After i add it in a Button to the Scene Builder
The Position and Barcode-Scan Plugin do not works also fine
Here is how i have implemented it.
public void position() {
Services.get(PositionService.class).ifPresent(service -> {
Position position = service.getPosition();
System.out.printf("Current position: %.5f, %.5f", position.getLatitude(), position.getLongitude());
LS4.setText(position.getLatitude() + " /" + position.getLongitude() + "");
});
}
public void barCode() {
Services.get(BarcodeScanService.class).ifPresent(service -> {
BarcodeScanService barcodeScanService = (BarcodeScanService) new BarcodeScanServiceFactory();
Optional<String> barcode = barcodeScanService.scan();
barcode.ifPresent(barcodeValue -> LS4.setText(barcodeValue));
});
}
and that is my androidmanifest
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.gluonapplication" android:versionCode="1" android:versionName="1.0">
<supports-screens android:xlargeScreens="true"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="21"/>
<application android:label="MultiViewProjectFXML" android:name="android.support.multidex.MultiDexApplication" android:icon="#mipmap/ic_launcher">
<activity android:name="javafxports.android.FXActivity" android:labe
l="MultiViewProjectFXML" android:configChanges="orientation|screenSize">
Your build contains wrong dependencies, and the plugins should be managed by the downConfig configuration.
It will take care of adding the proper plugins and for the proper platform.
Modify your dependencies and plugins like this:
dependencies {
compile 'com.gluonhq:charm:4.3.0'
androidRuntime 'org.sqldroid:sqldroid:1.0.3'
androidCompile 'org.glassfish:javax.json:1.0.4'
androidRuntime 'com.google.zxing:core:3.2.1'
desktopCompile group: 'org.xerial', name: 'sqlite-jdbc', version: '3.15.1'
desktopCompile group: 'org.sqldroid', name: 'sqldroid', version: '1.0.3'
compile 'com.airhacks:afterburner.mfx:1.6.3'
}
jfxmobile {
downConfig {
version = '3.2.0'
plugins 'barcode-scan', 'battery', 'browser', 'cache', 'dialer', 'display', 'lifecycle', 'picture', 'position', 'statusbar', 'storage'
}
}
As for the Browser service, you'll need to include http://.

How can a Qbs build Rule use a product

I want to use Qbs to compile an existing project. This project already contains a code-transformation-tool (my_tool) that is used heavily in this project.
So far I have (simplified):
import qbs 1.0
Project {
Application {
name: "my_tool"
files: "my_tool/main.cpp"
Depends { name: "cpp" }
}
Application {
name: "my_app"
Group {
files: 'main.cpp.in'
fileTags: ['cpp_in']
}
Depends { name: "cpp" }
Rule {
inputs: ["cpp_in"]
Artifact {
fileName: input.baseName
fileTags: "cpp"
}
prepare: {
var mytool = /* Reference to my_tool */;
var cmd = new Command(mytool, input.fileName, output.fileName);
cmd.description = "Generate\t" + input.baseName;
cmd.highlight = "codegen";
return cmd;
}
}
}
}
How can I get the reference to my_tool for the command?
This answer is based on an email from Qbs author Joerg Bornemann who allowed me to cite it here.
The property usings of Rule allows to add artifacts from products dependencies to the inputs.
In this case we are interested in "application" artifacts.
The list of applications could then be accessed as input.application.
Application {
name: "my_app"
Group {
files: 'main.cpp.in'
fileTags: ['cpp_in']
}
Depends { name: "cpp" }
// we need this dependency to make sure that my_tool exists before building my_app
Depends { name: "my_tool" }
Rule {
inputs: ["cpp_in"]
usings: ["application"] // dependent "application" products appear in inputs
Artifact {
fileName: input.completeBaseName
fileTags: "cpp"
}
prepare: {
// inputs["application"] is a list of "application" products
var mytool = inputs["application"][0].fileName;
var cmd = new Command(mytool, [inputs["cpp_in"][0].fileName, output.fileName]);
cmd.description = "Generate\t" + input.baseName;
cmd.highlight = "codegen";
return cmd;
}
}
}
Unfortunately the usings property in a Rule is deprecated since QBS 1.5.0. At the moment I have the same requirement. Using a product artifact in a non multiplex Rule.
The problem with a multiplex Rule is, if a single file in the input set changes, all input artifacts will be re-processed. Which is rather time consuming in my case.

Resources