Skip to content
This repository has been archived by the owner on Mar 14, 2018. It is now read-only.

How to produce the ready_to_use jar packages

Raimund Hocke edited this page Feb 23, 2014 · 56 revisions

To use this info, a valid Maven 3 installation allowing to use mvn on command line, is recommended.
... and out of the box it only works in the context of this repo structure

But the Maven based build steps can be fired in a Maven aware IDE as well.

For the normal user (not being a Sikuli developer or contributor)
it is strongly recommended, to produce the ready-to-use jars

  • sikulix.jar
  • sikulixapi.jar

using sikulixsetup-1.1.jar from the download page (depending on availability)

The Basics

The ready-to-use jars contain all Java dependencies and, depending on the selected setup options, native libraries and the basic tessdata folder. The jars downloaded during setup (or taken locally from the setup/Downloads folder) in contrast only contain the Java dependencies. Setup will add the additional stuff as needed locally and so produce the ready-to-use fat jars.
Additionally the setup process checks relevant environment aspects, exports convenience command scripts and some other stuff and runs a basic test after package build, to assure, that the package is useable. On Windows the needed entry in system path for the native libraries is added to the registry.

At time of 1.1.0-Beta1 (March 2014) the project has the following modules:

[INFO] Reactor Build Order:
[INFO] 
[INFO] SikuliX-Project (top level parent)
[INFO] Jygments4SikuliX
[INFO] OpenCV4SikuliX
[INFO] SikuliX-Basics
[INFO] SikuliX-Natives
[INFO] SikuliX-API (the Java API) 
[INFO] Tesseract4SikuliX
[INFO] SikuliX-Libs
[INFO] SikuliX-Setup (the setup jar)
[INFO] SikuliX-Jython (Jython support)
[INFO] SikuliX-JythonFat
[INFO] SikuliX-JRuby (JRuby support)
[INFO] SikuliX-JRubyFat
[INFO] SikuliX-APIFat
[INFO] SikuliX-IDE (the IDE and scripting support)
[INFO] SikuliX-IDEFat
[INFO] SikuliX-MacApp
[INFO] SikuliX-Tesseract
[INFO] SikuliX-Remote (the experimental remote feature)
[INFO] SikuliX-Guide

The sequence is according to Maven dependency evaluation. The phyisical folder names do not have the leading SikuliX-.

More details about intention and content of the modules read the main README.

The build and packaging process

... has 3 steps, is straightforward and can be repeated from any step at any time:

1. (BUILD) Compile and install to local repo

2. (PACK) Collect the artefacts needed for setup

3. (SETUP) Store the setup stuff outside of the project and run setup

Step 3 is comparable to when you are doing an offline setup after having downloaded the sikulixsetup.jar and the relevant packages from launchpad.

1. BUILD

run mvn clean install being in the root folder of the repo.

This processes every module's pom (compiles on the Java level if needed) and installs a respective jar for every module in the local repo.

You might as well do this from within an IDE with the intention to run the IDE or use SikuliX jars together with your own stuff.

This step has to be run at least once before going to step 2 and can be repeated at any time, which makes it necessary to repeat also steps 2 and 3 thereafter.

2. PACK

The clean install from step 1 has created a sikulixsetup-1.1.0-plain.jar in the module folder [project]/Setup/target.

Just ignore the other stuff Maven has created and double-click this jar sikulixsetup-1.1.0-plain.jar (or (mandatory) being in this folder use java -jar sikulixsetup-1.1.0-plain.jar).

This in fact starts a setup run in this folder [project]/Setup/target, that you might run to the end, leaving you with useable SikuliX jars at successful termination. If you do not want to work in this folder with the read-to-use SikuliX stuff, it is recommended to cancel the setup being in the options dialog.

This is the expected result of step 2 (not running setup to the end):

-- folder [project]/Setup/target
   sikulixsetup-1.1.0-plain.jar
   -- Downloads (folder)
      1.1.0-8.jar (tessdata)
      1.1.0-9.jar (MacApp, only on Mac)
      1.1.0-Beta1-1.jar (IDE)
      1.1.0-Beta1-2.jar (API)
      1.1.0-Beta1-3.jar (Remote)
      1.1.0-Beta1-4.jar (Jython)
      1.1.0-Beta1-5.jar (JRuby)

As already mentioned: None of these jars in Downloads is useable!

3. SETUP

This last step is to get a valid SikuliX setup folder containing the jars, as if they were downloaded from launchpad for an online setup. The folder content is similar to [project]/Setup/target only setup is named as it should be.

Currently the target folder is SikuliX-Setup in the parent folder containing the repo. After successful completion, you might move this folder to its final destination as you like with a name of your choice.

On a command line go to the root folder of the SikuliX project and run

collectjars.bat (Windows) respectively collectjars (Mac/Linux)

The expected result is:

-- folder [parent of project]/SikuliX-Setup
   sikulixsetup-1.1.jar
   -- Downloads (folder)
      1.1.0-8.jar (tessdata)
      1.1.0-9.jar (MacApp, only on Mac)
      1.1.0-Beta1-1.jar (IDE)
      1.1.0-Beta1-2.jar (API)
      1.1.0-Beta1-3.jar (Remote)
      1.1.0-Beta1-4.jar (Jython)
      1.1.0-Beta1-5.jar (JRuby)

To get the wanted SikuliX packages just double-click sikulixsetup-1.1.jar (recommended).