RFE: File->Export as Jar available on command line ? --- workaround

Asked by Laurent IZAC

--------------------------- workaround
2.0.5: run a script, that internally calls the feature worker to do what you want:
import org.sikuli.basics.FileManager as SXFM
SXFM.makeScriptjar(["plain", ".......... jartest.sikuli"])

replace .......... jartest.sikuli with an absolute path to your valid .sikuli to be wrapped in a jar.

---->>> For 2.0.6 you should use a script containing:
Debug.on(3) # run the script with option -c to get the log messages
import org.sikuli.ide.SikulixIDE as IDE
IDE.makeScriptjar(["plain", "/Users/raimundhocke/Desktop/jartest"])

It only works for Jython scripts and and the script folder to be wrapped must be a .sikuli folder.
-------------------------------------------------------------------

Hi Raiman,

I would like to bundle scripts for deployment as jar files in a batch build process.
But I can't find a way to trigger "Export as Jar" from the command line.
Is it there ? Or is it planned ?

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Laurent IZAC
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said (last edit ):
#1

The feature currently is only accessible via the IDE GUI.

In 2.0.6 the feature will be revised anyways. Will make it available as a command line option too.

For the current 2.0.5 you have to run a script, that internally calls the feature worker to do what you want:

.... sorry, not tested yet.
will come back

Revision history for this message
RaiMan (raimund-hocke) said :
#2

... so this is a working example:

import org.sikuli.basics.FileManager as SXFM
SXFM.makeScriptjar(["plain", ".......... jartest.sikuli"])

replace .......... jartest.sikuli with an absolute path to your valid .sikuli to be wrapped in a jar.

Revision history for this message
Laurent IZAC (laurent-izac) said :
#3

Thanks. It works

Revision history for this message
RaiMan (raimund-hocke) said :
#4

I have decided, to not make it a command line option for now (2.0.6) --- to many implications.

For 2.0.6 you should use a script containing:
Debug.on(3) # run the script with option -c to get the log messages
import org.sikuli.ide.SikulixIDE as IDE
IDE.makeScriptjar(["plain", "/Users/raimundhocke/Desktop/jartest"])

It only works for Jython scripts and and the script folder to be wrapped must be a .sikuli folder.

Revision history for this message
NounouRs (sandburg) said (last edit ):
#5

This is a really good question.
I would like to automate the Export of the .jar to be able to share it (since it is cross-platform, it's a must have).

The script you displayed, is it a .py script or a .java script? What are the prerequisite? I'm not able to run it on a device with Sikuli + X operational. (the distribution between java and py regarding Sikuli is never very clear to me)

At the end, I would like to build the .jar in a workflow/actions of Github. Someone already tried?

Also, why is the builder part of the IDE framework?

Revision history for this message
NounouRs (sandburg) said (last edit ):
#6

What are the prerequisite to run such a script/program?

just Java + sikulixide-2.0.5.jar ?
or it needs Python too?
or Jython?

Isn't it simpler in pure Java ?
If I imitate the code of public void doAsJar(ActionEvent ae)?