]> git.evergreen-ils.org Git - working/Hatch.git/blob - INSTALL.adoc
Hatch docs continued
[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 ===== Windows =====
41
42 [source,sh]
43 -------------------------------------------------------------------------
44 C:\> hatch.bat compile
45 -------------------------------------------------------------------------
46
47 ===== Linux =====
48
49 [source,sh]
50 -------------------------------------------------------------------------
51 $ ./hatch.sh compile
52 -------------------------------------------------------------------------
53
54 ==== Test Hatch Java ====
55
56 Assuming the Java code compiles OK, this will run a series of tests.
57
58 NOTE: print commands are disabled by default in the tests to avoid 
59 unexpected printing, but they can be added by un-commenting 
60 them in src/org/evergreen_ils/hatch/TestHatch.java and recompiling.
61
62 ===== Windows =====
63
64 [source,sh]
65 -------------------------------------------------------------------------
66 C:\> hatch.bat test
67 -------------------------------------------------------------------------
68
69 ===== Linux =====
70
71 [source,sh]
72 -------------------------------------------------------------------------
73 $ ./hatch.sh test
74 -------------------------------------------------------------------------
75
76 == Configure Chrome for Native Messaging with Hatch ==
77
78 === Setup Chrome Extension ===
79
80 ==== Tweak Extension Values ====
81
82 Edit extension/app/manifest.json and change the "evergreen.example.org" value 
83 found here to the hostname of your Evergreen server.
84
85 [source,js]
86 -------------------------------------------------------------------------
87 ...
88 "externally_connectable": {
89   "matches": ["*://evergreen.example.org/*"]
90 }
91 ...
92 -------------------------------------------------------------------------
93
94 NOTE: At time of writing, the Evergreen server used must have the
95 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].
96
97 ==== Install Chrome Extension ====
98
99 . Open Chrome and navigate to chrome://extensions
100 . Enable "Developer Mode" along the top right of the page.
101 . Click the "Load Unpacked Extension..." button.
102 . Load the directory at Hatch/extension/app
103
104 ===== Debugging The Chrome Extension =====
105
106  * Click the "Background Page" link to see the exension console.
107  * Use the "Reload" link to apply changes made to the extension 
108    (e.g. main.js).  
109  * See also https://developer.chrome.com/extensions/getstarted
110
111 === Setup Chrome Native Messaging Host ===
112
113 See also https://developer.chrome.com/extensions/nativeMessaging
114
115 ==== Windows ====
116
117 Edit extension/host/org.evergreen_ils.hatch.WINDOWS.json and change the 
118 "path" value to match the location of your copy of "hatch.bat", found in the 
119 root directory of the Hatch repository. 
120
121 Create a Native Messaging registry key entry via the Windows command prompt.
122 Modify the path value to point to your copy of 
123 HATCH/extension/host/org.evergreen_ils.hatch.WINDOWS.json.
124
125 [source,sh]
126 -------------------------------------------------------------------------
127 C:\> REG ADD "HKCU\Software\Google\Chrome\NativeMessagingHosts\org.evergreen_ils.hatch" /ve /t REG_SZ /d "C:\path\to\extension\host\org.evergreen_ils.hatch.WINDOWS.json" /f
128 -------------------------------------------------------------------------
129
130 ==== Linux ====
131
132 Edit extension/host/org.evergreen_ils.hatch.json and change the "path" 
133 value to match the location of your copy of "hatch.sh", found in the root 
134 directory of the Hatch repository. 
135
136 Copy the host file into Chrome's configuration directory.
137
138 For Chrome:
139
140 [source,sh]
141 -------------------------------------------------------------------------
142 $ mkdir -p ~/.config/google-chrome/NativeMessagingHosts/
143 $ cp extension/host/org.evergreen_ils.hatch.json ~/.config/google-chrome/NativeMessagingHosts/
144 -------------------------------------------------------------------------
145
146 For Chromium:
147
148 [source,sh]
149 -------------------------------------------------------------------------
150 $ mkdir -p ~/.config/chromium/NativeMessagingHosts/
151 $ cp extension/host/org.evergreen_ils.hatch.json ~/.config/chromium/NativeMessagingHosts/
152 -------------------------------------------------------------------------
153