Skip to content

Instantly share code, notes, and snippets.

@berick
Created November 15, 2016 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save berick/c981a7da5683a74478d8afce77c02d27 to your computer and use it in GitHub Desktop.
Save berick/c981a7da5683a74478d8afce77c02d27 to your computer and use it in GitHub Desktop.

Hatch Developer Install Documentation

Build and Test Hatch Java Libs

Windows

TODO

Linux

Download JDK 8

  1. Go to oracle.com, accept the license, download the Linux .tar.gz file.

  2. Extract the file in the Hatch root directory and link it into place.

$ tar -zxf jdk*tar.gz
$ ln -s jdk1.8* jdk1.8
Note
We may some day use openjdk, but its JavaFX libs are not ready for prime time as of writing.

Download org.json Java JSON Library

$ mkdir -p lib
$ cd lib
$ wget -O json-20160810.jar \
    'https://search.maven.org/remotecontent?filepath=org/json/json/20160810/json-20160810.jar'
$ cd ../

Compile Hatch Java

$ ./run.sh compile

Test Hatch Java

Assuming the Java code compiles OK, this will run a series of tests.

$ ./run.sh test
Note
print commands are disabled by default in the tests to avoid unexpected printing, but they can be added by un-commenting them in src/org/evergreen_ils/hatch/TestHatch.java and recompiling.

Configure Chrome/Chromium for Native Messaging with Hatch

Setup Chrome Extension

Tweak Extension Values

Edit extension/app/manifest.json and change the "eg-dev-local" value found here to the hostname of your Evergreen server.

...
"externally_connectable": {
  "matches": ["*://eg-dev-local/*"]
}
...
Note
At time of writing, the Evergreen server used must have the patches included in the Hatch Native Messaging working branch.

Install Chrome Extension

  1. Open Chrome and navigate to chrome://extensions

  2. Enable "Developer Mode" along the top right of the page.

  3. Click the "Load Unpacked Extension…​" button.

  4. Load the directory at Hatch/extension/app

Debugging The Chrome Extension

Setup Chrome Native Messaging Host

Edit extension/host/org.evergreen_ils.hatch.json and change the "path" value to match the location of your copy of "start-hatch", found in the root directory of the Hatch repository.

...
  "path": "/home/berick/code/Hatch/start-hatch",
...

Windows

TODO

Linux

Copy the host file into Chrome’s configuration directory.

For Chrome:

$ mkdir -p ~/.config/google-chrome/NativeMessagingHosts/
$ cp extension/host/org.evergreen_ils.hatch.json ~/.config/google-chrome/NativeMessagingHosts/

For Chromium:

$ mkdir -p ~/.config/chromium/NativeMessagingHosts/
$ cp extension/host/org.evergreen_ils.hatch.json ~/.config/chromium/NativeMessagingHosts/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment