Download: https://ln5.sync.com/dl/2dca9a120/fihaabv7-5xyfruxd-rk6shfaq-uvfanupw
This is fully capable of interop with Java and Kotlin. As far as I know, it can be used in any JVM language.
A library that creates jar files using the jar executable included in the JDK.
Also used as the backend in my GUI implementation: https://github.com/mpierson531/jarizard
Collect input files or directories, an output file path (and optional main-class path, version, etc.), then call new Backend().jarIt(*paramters*)
.
Now you have a new jar file!
This also includes a simple DSL, which can be parsed from a file, then turned into a jar.
The file containing the DSL code should be a .txt
file.
input "path"
input = "path"
input {
"path"
"otherPath"
}
All of these syntaxes can be applied to all parameters (input, output, mainclass, version, useCompression, dependencies).
Quotes are not necessary if the file path doesn't have any spaces. Quotes can be single or double.
Compression is used by default by the jar executable. If you don't want the resulting jar to be compressed, do this:
compress = 0
// or
compress = false
Once you have the DSL file, simply call new Backend().jarIt(dslFile)
As of right now, only Maven dependencies are supported.
DSL Example:
dependency = "org.jetbrains.kotlin.kotlin-stdlib 1.9.0"
dependencies {
"org.jetbrains.kotlin.kotlin-stdlib 1.9.0"
"org.scala-lang.scala-library 2.10.0"
}
Paths like this can easily be directly translated into Maven URLs, which is why only Maven dependencies are supported right now.
As of right now, file paths are assumed to be absolute.
It is also assumed that the system this is run on has the JAVA_HOME
environment variable set.