Skip to content

Running compiled Jython scripts packed in a jar with option -r (related #392) #393

Description

@RaiMan

This post is only to document the status.
How we deal with it further, has to be evaluated and decided.

Motivated by the discussion #392, I had a look into this stuff:

  • SikuliX IDE had a feature in the file menu, to pack compiled Jython scripts into jars
  • these jars could be run from commandline using java -jar …ide…jar -r script.jar
  • the code to build and run is available in Oculix, but is deactivated and not documented
  • this seems to work: if you have a jar built with SikuliX, you can run it with Oculix with the -r option

I had a look through the build code and did some minor fixes, so the build of such jars now works in Oculix.

To test it, I used this Jython script (easier than to make it in Java):

import org.sikuli.support.FileManager as FM
FM.makeScriptjar(("plain","/Users/raimundhocke/Downloads/GitProjects/Test/makejartest.sikuli", ))

The script to pack (makejartest.py) simply a one liner:
print "hello from makejartest“

The minor fixes are in claude/i18n-phase3 commit b31b0ae

There is also a version in the code, that packs a Java main() into the jar, together with support to populate the classpath at runtime with the needed jars to run it.
I suggest to not make this available as a feature, since it is more complex, without having any advantages.

Metadata

Metadata

Assignees

Type

Fields

No fields configured for Task.

Projects

Status
In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions