edvin / fxlauncher-gradle-plugin Goto Github PK
View Code? Open in Web Editor NEWGradle plugin for FXLauncher
License: Apache License 2.0
Gradle plugin for FXLauncher
License: Apache License 2.0
It seems dependencies in the build.gradle
that use the compile files()
command do not copy over to the deployment.
dependencies {
compile files('U:/NP/Operational Planning/People/Thomas/maven_local/terajdbc4.jar')
compile files('U:/NP/Operational Planning/People/Thomas/maven_local/tdgssconfig.jar')
compile files('U:/NP/Operational Planning/People/Thomas/maven_local/ojdbc6.jar')
}
Can you create a new release with the latest changes? Currently I'm using a locally built SNAPSHOT (which works fine) but this breaks the build on my cloud CI server ;)
First, another thanks for the people who have tried to make this plugin great.
I'm using it for something at work—hence all the activity recently—so I'm willing to help where I can.
The ideal work-flow when launching with FXLauncher is thus:
Fix a bug.
Plugin copies over just the fixed dependency.
Clients will automatically pull down just the updated dependency.
However, the way things currently stand, the copyAppDependencies
task copies all of the dependencies, regardless if they've been changed or not. This makes all of the dependencies update and defeats the purpose of having a granular auto-updater: with the current work-flow, the clients have to pull down the whole app every time there is an update.
This problem doesn't seem to occur in projects using Maven because the Maven Dependency Plugin takes into account whether dependencies need updating.
@aalmiray, how easy is it to check for the same file already being there before copying it over? Can you point me in the right direction? I'm a groovy noob, but I'd be happy to submit a PR.
I've used the javapackager in other projects before, so I'd like to say I kind of know what I'm talking about—kind of.
The idea is convention over configuration. You put the drop-in resources in a certain spot and if they're where the javapackager expects them, it uses them instead of the default.
It appears, however, that the fxlauncher-gradle-plugin is missing an important step mentioned in the javapackager documentation: setting up the classpath (to match the gradle project structure).
In the documentation there's an example of setting up the classpath with an Ant task. We just need to do it with gradle... right?
I'm under the impression that putting the package
directory right in the root of the project goes against the gradle project structure. But I'm closer to a gradle noob than I am a gradle expert. @aalmiray, you know a thing or two. Can you weigh in on where the package
directory should be?
In the javafx-gradle-plugin, they've configured it to sit right next to the java
directory
│
└───src
├───main
│ ├───deploy
│ │ └───package
│ │ └───windows
│ ├───java
│ └───resources
└───test
├───java
└───resources
To conform to how a gradle project should be, is that right? Or should it be elsewhere?
Newer gradle versions recommend using the implementation
or api
keywords instead of compile
and runtime
. Unfortunately, the plugin doesn't seem to pick up dependencies declared in that way.
https://docs.gradle.org/current/userguide/dependency_management_for_java_projects.html
Hi edvin,
I am trying to use FXLauncher to build a launcher for my JavaFX application using Gradle. My build.gradle file current looks like this (Note: The actual URLs and domain names have been removed):
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'no.tornado:fxlauncher-gradle-plugin:1.0.17'
}
}
plugins {
id 'io.franzbecker.gradle-lombok' version '1.10'
id 'java'
}
group 'com.example.admin'
version '1.0.0'
apply plugin: 'java'
apply plugin: 'no.tornado.fxlauncher'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
fxlauncher {
applicationUrl = 'https://adminapp.example.com/'
applicationMainClass = 'com.example.admin.Main'
applicationVendor = 'Example Vendor'
applicationVersion = '1.0.0'
acceptDowngrade = false
deployTarget = '[email protected]:adminapp'
scpOptions = ["-v"]
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
compile 'org.slf4j:slf4j-api:1.7.25'
compile 'org.slf4j:slf4j-simple:1.7.25'
compile 'org.xerial:sqlite-jdbc:3.19.3'
compile 'org.apache.commons:commons-lang3:3.6'
}
Unfortunately, I am running into an issue when I try to run the Gradle deployApp task, which I do as follows:
./gradlew clean deployApp
That task actually runs fine because a build/fxlauncher directory is generated with all the artifacts and dependencies for the application inside of it, but when fxlauncher attempts to perform the SCP I see this error:
Execution failed for task ':deployApp'.
> scp exited with status 1
To verify that SCP was installed and working on my machine I copied a test file to the folder on my server and that worked without any issues. I then tried adding the scpOptions option to the build.gradle file, but no "verbose" output is displayed. I think if you can help me get that working, then I should be able to figure out the rest on my own. Thank you in advance.
Using plugin version 1.0.18. If I set:
fxLauncher {
stopOnUpdateErrors = true
}
the resulting manifest has:
<parameters>--stopOnUpdateErrors</parameters>
...
<stopOnUpdateErrors>false</stopOnUpdateErrors>
Looks like the latter takes precedence.
I have tried several different configs and such, and this is the closest to your example app.
Link:
> Task :generateApplicationManifest FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':generateApplicationManifest'.
> com/sun/javafx/application/ParametersImpl
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
5 actionable tasks: 3 executed, 2 up-to-date
➜ ancilla
The plugin must perform the following high level operations:
app.xml
manifestapp.xml
from plugin properties and embed it inside fxlauncher.jar in the staging directory
fxlauncher.CreateManifest.create(URI baseURI, String launchClass, Path stagingPath)
(in-process if possible)javapackager
binary from the JDKLatest available is 1.0.20
Hello while compiling muliti project build failed to find application url variable . after removing
//compile project(':CustomLauncher')
this line and
remove
include 'CustomLauncher'
from settings.gradle file and run it again without any problem.
here CustomLauncher module contain class files for custom ui
https://plugins.gradle.org/plugin/no.tornado.fxlauncher shows 1.0.16 as the latest version
but https://search.maven.org/#search%7Cga%7C1%7Ca%3A%22fxlauncher-gradle-plugin%22 shows a 1.0.18 release.
Tried using the new plugin DSL with the 1.0.18 plugin (now in the gradle repository, per #16).
plugins {
id 'no.tornado.fxlauncher' version '1.0.18'
}
But I'm getting the following error:
...
Caused by: org.gradle.api.plugins.InvalidPluginException: An exception occurred applying plugin request [id: 'no.tornado.fxlauncher', version: '1.0.18']
at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.exceptionOccurred(DefaultPluginRequestApplicator.java:247)
at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugin(DefaultPluginRequestApplicator.java:229)
... 96 more
Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [id 'no.tornado.fxlauncher']
at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:150)
at org.gradle.api.internal.plugins.DefaultPluginManager.apply(DefaultPluginManager.java:125)
at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator$3.run(DefaultPluginRequestApplicator.java:151)
at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugin(DefaultPluginRequestApplicator.java:225)
... 96 more
Caused by: groovy.lang.MissingPropertyException: Could not get unknown property 'jar' for task set of type org.gradle.api.internal.tasks.DefaultTaskContainer.
at org.gradle.internal.metaobject.AbstractDynamicObject.getMissingProperty(AbstractDynamicObject.java:83)
at org.gradle.internal.metaobject.AbstractDynamicObject.getProperty(AbstractDynamicObject.java:61)
at org.gradle.api.internal.tasks.DefaultTaskContainer_Decorated.getProperty(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:50)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:296)
at no.tornado.fxlauncher.gradle.FXLauncherPlugin.apply(FXLauncherPlugin.groovy:53)
at no.tornado.fxlauncher.gradle.FXLauncherPlugin.apply(FXLauncherPlugin.groovy)
at org.gradle.api.internal.plugins.ImperativeOnlyPluginTarget.applyImperative(ImperativeOnlyPluginTarget.java:42)
at org.gradle.api.internal.plugins.RuleBasedPluginTarget.applyImperative(RuleBasedPluginTarget.java:50)
at org.gradle.api.internal.plugins.DefaultPluginManager.addPlugin(DefaultPluginManager.java:164)
at org.gradle.api.internal.plugins.DefaultPluginManager.access$200(DefaultPluginManager.java:47)
at org.gradle.api.internal.plugins.DefaultPluginManager$AddPluginBuildOperation.run(DefaultPluginManager.java:252)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:144)
... 99 more
The old system of adding a buildscript dependency and calling "apply plugin" continues to work fine.
In order for UNC Paths to be fully supported I think this line needs to be updated to 1.0.21
A project which is building fine with the 1.5.30 JVM plugin fails with 1.6.20 with the following error:
Execution failed for task ':copyAppDependencies'.
> Resolving dependency configuration 'runtime' is not allowed as it is defined as 'canBeResolved=false'.
Instead, a resolvable ('canBeResolved=true') dependency configuration that extends 'runtime' should be resolved.
Presumably this is due to https://github.com/edvin/fxlauncher-gradle-plugin/blob/master/src/main/groovy/no/tornado/fxlauncher/gradle/CopyAppDependenciesTask.groovy#L29.
Maybe "runtimeClasspath" is the replacement, though I don't know if that is backwards compatible.
Thanks for great libs. I wonder how to create 1 jar file only from gradle build
Thank you so much
Hi!
I'm using fxlauncher for creating native installer for Windows. I need some customization of that process.
Are project files appName.iss, appName.ico, appName-setup-icon.bmp used?
I put them in "src/main/deploy/package/window" directory, but it seems they are not used.
Maybe there is another folder should be for that files?
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.