]> git.evergreen-ils.org Git - working/Hatch.git/blob - INSTALL.adoc
4b190d49d4183d35286b7c98314a17bf35be31f2
[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 ===== Linux =====
30
31 The org.json jar file is retrieved automatically when running
32 'hatch.sh compile' (below).
33
34 ===== Windows =====
35
36 1. Create a directory called "lib" inside the Hatch directory.
37 2. Download the JSON jar file and put it into the "lib" directory:
38
39 https://search.maven.org/remotecontent?filepath=org/json/json/20160810/json-20160810.jar
40
41 ==== Compile Hatch Java ====
42
43 ===== Windows =====
44
45 [source,sh]
46 -------------------------------------------------------------------------
47 C:\> hatch.bat compile
48 -------------------------------------------------------------------------
49
50 ===== Linux =====
51
52 [source,sh]
53 -------------------------------------------------------------------------
54 $ ./hatch.sh compile
55 -------------------------------------------------------------------------
56
57 ==== Test Hatch Java ====
58
59 Assuming the Java code compiles OK, this will run a series of tests.
60
61 NOTE: print commands are disabled by default in the tests to avoid 
62 unexpected printing, but they can be added by un-commenting 
63 them in src/org/evergreen_ils/hatch/TestHatch.java and recompiling.
64
65 ===== Windows =====
66
67 [source,sh]
68 -------------------------------------------------------------------------
69 C:\> hatch.bat test
70 -------------------------------------------------------------------------
71
72 ===== Linux =====
73
74 [source,sh]
75 -------------------------------------------------------------------------
76 $ ./hatch.sh test
77 -------------------------------------------------------------------------
78
79 == Configure Chrome for Native Messaging with Hatch ==
80
81 === Setup Chrome Extension ===
82
83 NOTE: At time of writing, the Evergreen server used must have the
84 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].
85
86 ==== Install Chrome Extension ====
87
88 . Open Chrome and navigate to chrome://extensions
89 . Enable "Developer Mode" along the top right of the page.
90 . Click the "Load Unpacked Extension..." button.
91 . Load the directory at Hatch/extension/app
92
93 ===== Debugging The Chrome Extension =====
94
95  * Click the "Background Page" link to see the exension console.
96  * Use the "Reload" link to apply changes made to the extension 
97    (e.g. main.js).  
98  * See also https://developer.chrome.com/extensions/getstarted
99
100 === Setup Chrome Native Messaging Host ===
101
102 See also https://developer.chrome.com/extensions/nativeMessaging
103
104 ==== Windows ====
105
106 Edit extension/host/org.evergreen_ils.hatch.WINDOWS.json and change the 
107 "path" value to match the location of your copy of "hatch.bat", found in the 
108 root directory of the Hatch repository. 
109
110 Create a Native Messaging registry key entry via the Windows command prompt.
111 Modify the path value to point to your copy of 
112 HATCH/extension/host/org.evergreen_ils.hatch.WINDOWS.json.
113
114 [source,sh]
115 -------------------------------------------------------------------------
116 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
117 -------------------------------------------------------------------------
118
119 ==== Linux ====
120
121 Edit extension/host/org.evergreen_ils.hatch.json and change the "path" 
122 value to match the location of your copy of "hatch.sh", found in the root 
123 directory of the Hatch repository. 
124
125 Copy the host file into Chrome's configuration directory.
126
127 For Chrome:
128
129 [source,sh]
130 -------------------------------------------------------------------------
131 $ mkdir -p ~/.config/google-chrome/NativeMessagingHosts/
132 $ cp extension/host/org.evergreen_ils.hatch.json ~/.config/google-chrome/NativeMessagingHosts/
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 ~/.config/chromium/NativeMessagingHosts/
141 -------------------------------------------------------------------------
142