Comments (15)
I can also confirm that setting the classpath property yields no effects. Here is what I do:
launch4j {
mainClassName = "com.something..."
classpath.set([
"additional1/*",
"additional2/*"
])
}
When I print the classpath in my main method I see that everything within the libraryDir is included, but I do not see my additional resources.
When I look into the extension I see that the classpath property is not annotated with @Input
, could this be the reason for the property not being mapped?
from gradle-launch4j.
@KlemenDEV thanks for your example project. All the issues you've found should be fixed as shown in Issue150Test.groovy
To create a new LibraryTask in a separate gradle file you have to add the plugin again to the classpath of that file:
buildscript {
repositories{
gradlePluginPortal()
}
dependencies {
classpath 'edu.sc.seis.launch4j:launch4j:3.0.1'
}
}
import edu.sc.seis.launch4j.tasks.Launch4jLibraryTask
tasks.register('createFastStart', Launch4jLibraryTask) {
...
works in your provided example project but fails in the test case as the test environment is not setup to handle this.
from gradle-launch4j.
I just tested this with the 3.0.1 release, and the classpath
property now works as expected. Thanks for fixing this so quickly.
from gradle-launch4j.
I have also noticed some other parameters are marked as final now and give a warning in eg. IDEA, such as classpath
and jvmOptions
.
from gradle-launch4j.
Have you tried replacing the deprecated task configuration createExe{...}
with the launch4j{...}
extension?
from gradle-launch4j.
@KlemenDEV I cannot reproduce this. Could you please add a code snippet or link to the mentioned readme section?
from gradle-launch4j.
@KlemenDEV I cannot reproduce this. Could you please add a code snippet or link to the mentioned readme section?
Here is the code snippet that one can reproduce this with:
createExe {
copyConfigurable = []
...
}
Have you tried replacing the deprecated task configuration createExe with the launch4j extension?
Yes, I wanted to use "modern" approach and not the legacy method, however, I have tried the following two things:
- I tried replacing it with launch4j and I get those warnings:
so seems in this case, classpath and jvmOptions are final and produce warnings which is also probably not ok.
- Tried adding custom Launch4jLibraryTask task
tasks.register<edu.sc.seis.launch4j.tasks.Launch4jLibraryTask>("testTask") {
...
}
but I get the following error:
Could not get unknown property 'register' for task set of type org.gradle.api.internal.tasks.DefaultTaskContainer.
I also tried to import Launch4jLibraryTask like
import edu.sc.seis.launch4j.tasks.Launch4jLibraryTask
but this produces the following error:
unable to resolve class edu.sc.seis.launch4j.tasks.Launch4jLibraryTask
I have also found that I am not the only one having problems with importing or using Launch4jLibraryTask: https://stackoverflow.com/questions/75859510/gradle-launch4j-cant-create-launch4jlibrarytask-due-to-project-afterevaluate-e. The plugin is loaded properly in plugins block and also launch4j and createExe are detected, so there must be something else preventing from importing Launch4jLibraryTask
I have been using 2.5.4 without problems, but in 3.0.0 I just can't find a configuration to make this work. createExe has problem with copyConfigurable, launch4j task with final fields and creating custom Launch4jLibraryTask does not seem to work either.
I guess we will stick with 2.5.4 for now until something is figured out or done on this area.
from gradle-launch4j.
Being a Property
you should call their methods rather than assigning to it. e.g. jvmOptions.set(…)
from gradle-launch4j.
I see. I guess we can use method 1. then. Any idea why
unable to resolve class edu.sc.seis.launch4j.tasks.Launch4jLibraryTask
would happen?
from gradle-launch4j.
Being a Property you should call their methods rather than assigning to it. e.g. jvmOptions.set(…)
launch4j {
...
classpath.set(["./lib/*"])
}
yields exe not working and the following debug log ( --l4j-debug):
Info: Classpath not defined.
So even set does not work
from gradle-launch4j.
Take a look here how the syntax for creating custom tasks is.
I'll take a look at the warning that IntelliJ shows in your screen grab above.
To really help you please submit a runnable and self contained example i.e. a build.gradle file demonstrating the issue you're experiencing.
from gradle-launch4j.
We should probably add setter methods for the HasMultipleValues<T>
properties.
from gradle-launch4j.
So here is a demo setup showing the following 3 bugs present in the plugin:
- see build.gradle: "warnings emitted for classpath and jvmOptions"
- see build.gradle and subfile.gradle: unable to resolve class edu.sc.seis.launch4j.tasks.Launch4jLibraryTask when using Launch4jLibraryTask from another .gradle file applied to the build.gradle
- see test.exe: generated with configuration from build.gradle. If put next to folder called "jdk" that contains valid JDK, the and executed with "test.exe --l4j-debug", log attached in the zip is generated stating "Classpath not defined." despite it being set in the build.gradle settings
from gradle-launch4j.
Thanks to @etschelp for pointing out the annotation issue. It will be released with the next version 3.0.2, but can be tested now from my artifactory, although I don't see it as a big problem. If you do mind, please open another issue and we'll address it right away.
from gradle-launch4j.
I can also confirm it works fine now and no warning is emitted in IDEA
from gradle-launch4j.
Related Issues (20)
- Build for Linux OS HOT 1
- Gradle 7 support HOT 3
- Created EXE needs admin-privileges to be run HOT 2
- add support for gradle configuration cache HOT 1
- Launch4jLibraryTask broken with Gradle 8+
- Plans to update to Launch4j 3.50 HOT 11
- Add support for not specifying a jar file HOT 2
- classpath property issue HOT 3
- Version 3 should not require the presence of the jar plugin
- Unable to use empty `libraryDir` with latest version HOT 3
- It should be possible to define a Wrapper Manifest
- Gradle tries to download launch4j 3.0.3 plugin from jcenter HOT 3
- Question: Differences between 2.5.4 and 3.0.+ versions? HOT 4
- Improved diagnosis possibilitites / output of the launch4j process HOT 4
- No such field error after upgrading 2.5.4 -> 3.0.4 HOT 1
- Build fails with error: "Original filename exceeds the maximum length of 50 characters" HOT 2
- Erratic "Caused by: net.sf.launch4j.BuilderException: Icon doesn't exist." HOT 3
- how to change jar file location in version 3.0.5 HOT 3
- "Unresolved reference: jarTask" with Gradle Kotlin DSL HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradle-launch4j.