From: Bill Erickson Date: Tue, 15 Nov 2016 20:42:04 +0000 (-0500) Subject: Native Messaging WIP -- developer install docs X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=fc8ab7ff357b5d15c95b6559735ff55ab2ac5b65;p=working%2FHatch.git Native Messaging WIP -- developer install docs Signed-off-by: Bill Erickson --- diff --git a/INSTALL.adoc b/INSTALL.adoc new file mode 100644 index 0000000000..8cfe416468 --- /dev/null +++ b/INSTALL.adoc @@ -0,0 +1,116 @@ += Hatch Developer Install Documentation = + +== Build and Test Hatch Java Libs == + +=== Windows === + TODO + +=== Linux === + +==== Download JDK 8 ==== + +1. Go to +http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html[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. + +[source,sh] +------------------------------------------------------------------------- +$ 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 ==== + +[source,sh] +------------------------------------------------------------------------- +$ 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 ==== + +[source,sh] +------------------------------------------------------------------------- +$ ./run.sh compile +------------------------------------------------------------------------- + +==== Test Hatch Java ==== + +Assuming the Java code compiles OK, this will run a series of tests. +Not print commands are enabled by default in the tests, but they +can be added by un-commenting them in +src/org/evergreen_ils/hatch/TestHatch.java and recompiling. + +[source,sh] +------------------------------------------------------------------------- +$ ./run.sh test +------------------------------------------------------------------------- + +== 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 browser client. + +[source,js] +------------------------------------------------------------------------- +... +"externally_connectable": { + "matches": ["*://eg-dev-local/*"] +} +... +------------------------------------------------------------------------- + +==== Install Chrome Extension ==== + +. Open Chrome and navigate to chrome://extensions +. Enable "Developer Mode" along the top right of the page. +. Click the "Load Unpacked Extension..." button. +. Load the directory at Hatch/extension/app + +===== Debugging Chrome Extension ===== + + * Click the "Background Page" link to see the exension console. + * Use the "Reload" link to apply changes made to the extension + (e.g. main.js). + * See also https://developer.chrome.com/extensions/getstarted + +=== Setup Chrome Native Messaging Host === + +==== Linux ==== + +1. Edit extension/host/org.evergreen_ils.hatch.json and change the "path" value +to the location of your copy of "start-hatch", found in the root directory +of the Hatch repository. The "path" value cannot be a relative path! + +2. Copy the host file into Chrome's configuration directory. + +For Chrome: + +[source,sh] +------------------------------------------------------------------------- +$ mkdir -p ~/.config/google-chrome/NativeMessagingHosts/ +$ cp extension/host/org.evergreen_ils.hatch.json \ + ~/.config/google-chrome/NativeMessagingHosts/ +------------------------------------------------------------------------- + +For Chromium: +[source,sh] +------------------------------------------------------------------------- +$ mkdir -p ~/.config/chromium/NativeMessagingHosts/ +$ cp extension/host/org.evergreen_ils.hatch.json \ + ~/.config/chromium/NativeMessagingHosts/ +------------------------------------------------------------------------- + +