todd-elvers / groovy-to-exe-converter Goto Github PK
View Code? Open in Web Editor NEWCreates a Windows executable out of a Groovy script or JAR file from the command-line using Launch4j
License: MIT License
Creates a Windows executable out of a Groovy script or JAR file from the command-line using Launch4j
License: MIT License
It would be nice if a user could launch the launch4j GUI directly through g2exe. Maybe with g2exe --launch4j
.
Since Windows caches Icons, creating an executable file with a custom .ico file will cache the application name + icon file + directory.
Say a user creates an executable file with g2exe in a specific directory with a custom icon. Windows Icon caching means if the user then creates an executable file with the same name, in the same directory, but with a different icon, then the old icon will be read from Window's cache and displayed instead of the new one.
It would be nice if there was a command line flag like --refresh-icons
which would kill Windows Explorer, delete the IconCache.db file(s) in the current user's AppData directory, and restart Windows Explorer.
I was able to achieve this in GroovyConsole with the following:
println "Cleaning ICON cache..."
"cmd /c del %userprofile%/AppData/Local/IconCache.db /a".execute().text
println "Stopping & restarting Windows..."
"cmd /c taskkill /f /im explorer.exe && explorer.exe".execute()
In case, I need to use only the .jar to .exe feature, I need not have GROOVY_HOME set - it still requires me to have GROOVY_HOME open.
There should be a way for people with JDK 1.5 to run g2exe, with confidence that all of g2exe is JDK 1.5 compatible.
Currently, the application claims to be JDK 1.5 compatible...but only by using gradle's sourceCompatibility = 1.5
setting, which is more of a suggestion to build 1.5 compatible code than a requirement. This does not force any imported dependencies to have Java 1.5 compatibility.
A gradle task needs to be created so that all generated classes can be checked for Java 5 compatibility. JDK 1.5 probably shouldn't be the main target for this application (especially since there are performance increases in later JDKs) but there should at least be the option for individuals who are forced to use JDK 1.5.
The current version of Launch4j that g2exe has is 3.6.1, which is old since version 3.8 was just released. I should upgrade the Launch4j version to 3.8.
Launch4j downloads: http://sourceforge.net/projects/launch4j/files/launch4j-3/
When g2exe cannot find a valid Java installation, a window pops up describing the issue. This window currently has no title, which makes it a little confusing. This should be fixed.
Once g2exe compiles a groovy script, it iterates through the classes in the script looking for a method whose name is "main".
This logic is currently too broad. If you include a method in a script like String main() {}
, g2exe will also detect this as a main method. This will then cause an exception later in the code because more than 1 main method was found.
The main-method detection logic should be improved to be more specific.
The newer launch4j is more tested and contains a plethora of bug fixes. This application should be updated to contain this new launch4j version.
Launch4j 3.6 can be found here:
http://sourceforge.net/projects/launch4j/files/launch4j-3/3.6/
gradlew clean check
will fail while executing GroovyToExeConverterRunnerIntegrationTest.
Right now when --debug or --stacktrace are called the logging is very verbose and helpful. However, when doing a normal run of the application very little information as to what is going on is outputted to the console. There has to be a happy medium between 2 log messages and what you get when you use --debug.
Make console output when not running --debug or --stacktrace slightly more verbose.
Consider the following Groovy script:
class ClassOne {
public static void main(String[] args) {
new ClassOne().print()
new ClassTwo().print()
}
void print() {
println "ClassOne successfully instantiated"
}
}
class ClassTwo {
void print() {
println "ClassTwo successfully instantiated"
}
}
When the above is executed in GroovyConsole, the results are what you'd expect:
ClassOne successfully instantiated
ClassTwo successfully instantiated
However, if this script is compiled into an executable file w/ g2exe, then running it yields:
ClassOne successfully instantiated
Exception in thread "main" java.lang.NoClassDefFoundError: ClassTwo
at ClassOne.main(Example.groovy:5)
Caused by: java.lang.ClassNotFoundException: ClassTwo
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more
This is a bug and a pretty nasty one at that.
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.