]> git.evergreen-ils.org Git - working/Hatch.git/blob - INSTALL.adoc
Hatch docs/scripts consolidation; linux/windows host json files
[working/Hatch.git] / INSTALL.adoc
1 = Hatch Developer Install Documentation =
2
3 == Build and Test Hatch Java Libs ==
4
5 === Windows ===
6     TODO
7
8 === Linux ===
9
10 ==== Download JDK 8 ====
11
12 1. Go to 
13 http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html[oracle.com],
14 accept the license, download the Linux .tar.gz file.
15
16 2. Extract the file in the Hatch root directory and link it into place.
17
18 [source,sh]
19 -------------------------------------------------------------------------
20 $ tar -zxf jdk*tar.gz
21 $ ln -s jdk1.8* jdk1.8
22 -------------------------------------------------------------------------
23
24 NOTE: We may some day use openjdk, but its JavaFX libs are not ready
25 for prime time as of writing.  
26
27 ==== Download org.json Java JSON Library ====
28
29 [source,sh]
30 -------------------------------------------------------------------------
31 $ mkdir -p lib
32 $ cd lib
33 $ wget -O json-20160810.jar \
34     'https://search.maven.org/remotecontent?filepath=org/json/json/20160810/json-20160810.jar'
35 $ cd ../
36 -------------------------------------------------------------------------
37
38 ==== Compile Hatch Java ====
39
40 [source,sh]
41 -------------------------------------------------------------------------
42 $ ./hatch.sh compile
43 -------------------------------------------------------------------------
44
45 ==== Test Hatch Java ====
46
47 Assuming the Java code compiles OK, this will run a series of tests.
48
49 [source,sh]
50 -------------------------------------------------------------------------
51 $ ./hatch.sh test
52 -------------------------------------------------------------------------
53
54 NOTE: print commands are disabled by default in the tests to avoid 
55 unexpected printing, but they can be added by un-commenting 
56 them in src/org/evergreen_ils/hatch/TestHatch.java and recompiling.
57
58
59 == Configure Chrome/Chromium for Native Messaging with Hatch ==
60
61 === Setup Chrome Extension ===
62
63 ==== Tweak Extension Values ====
64
65 Edit extension/app/manifest.json and change the "egserver.example.org" value 
66 found here to the hostname of your Evergreen server.
67
68 [source,js]
69 -------------------------------------------------------------------------
70 ...
71 "externally_connectable": {
72   "matches": ["*://egserver.example.org/*"]
73 }
74 ...
75 -------------------------------------------------------------------------
76
77 NOTE: At time of writing, the Evergreen server used must have the
78 patches included in the http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/lp1640255-hatch-native-messaging[Hatch Native Messaging working branch].
79
80 ==== Install Chrome Extension ====
81
82 . Open Chrome and navigate to chrome://extensions
83 . Enable "Developer Mode" along the top right of the page.
84 . Click the "Load Unpacked Extension..." button.
85 . Load the directory at Hatch/extension/app
86
87 ===== Debugging The Chrome Extension =====
88
89  * Click the "Background Page" link to see the exension console.
90  * Use the "Reload" link to apply changes made to the extension 
91    (e.g. main.js).  
92  * See also https://developer.chrome.com/extensions/getstarted
93
94 === Setup Chrome Native Messaging Host ===
95
96 ==== Linux ====
97
98 Edit extension/host/org.evergreen_ils.hatch.json.LINUX and change the "path" 
99 value to match the location of your copy of "hatch.sh", found in the root 
100 directory of the Hatch repository. 
101
102 ==== Windows ====
103
104 Edit extension/host/org.evergreen_ils.hatch.json.WINDOWS and change the 
105 "path" value to match the location of your copy of "hatch.bat", found in the 
106 root directory of the Hatch repository. 
107
108
109 [source,js]
110 -------------------------------------------------------------------------
111 ...
112   "path": "/home/berick/code/Hatch/hatchsh",
113 ...
114 -------------------------------------------------------------------------
115
116 See also https://developer.chrome.com/extensions/nativeMessaging
117
118 ==== Windows ====
119
120 TODO
121
122 ==== Linux ====
123
124 Copy the host file into Chrome's configuration directory.
125
126 For Chrome:
127
128 [source,sh]
129 -------------------------------------------------------------------------
130 $ mkdir -p ~/.config/google-chrome/NativeMessagingHosts/
131 $ cp extension/host/org.evergreen_ils.hatch.json.LINUX \
132     ~/.config/google-chrome/NativeMessagingHosts/org.evergreen_ils.hatch.json
133 -------------------------------------------------------------------------
134
135 For Chromium:
136
137 [source,sh]
138 -------------------------------------------------------------------------
139 $ mkdir -p ~/.config/chromium/NativeMessagingHosts/
140 $ cp extension/host/org.evergreen_ils.hatch.json.LINUX \
141     ~/.config/chromium/NativeMessagingHosts/org.evergreen_ils.hatch.json
142 -------------------------------------------------------------------------
143