blob: def7148c2a7dc45a4d8e1d2e598f71af64a5499f [file] [log] [blame]
Vitaly Buka80925a72015-09-16 17:16:21 -07001Overview
2--------
3libWeave is the library to with device side implementation of Weave
4protocol.
5
6Sources
7-------
8Sources are located in git repository at
9https://weave.googlesource.com/weave/libweave/
10
11Checkout code with:
12
13 git clone https://weave.googlesource.com/weave/libweave && \
14 (cd libweave && \
15 curl -Lo `git rev-parse --git-dir`/hooks/commit-msg \
16 https://gerrit-review.googlesource.com/tools/hooks/commit-msg ;\
17 chmod +x `git rev-parse --git-dir`/hooks/commit-msg)
18
19Directory structure
20-------------------
21Includes to be used by device code:
22 include/
23
24Implementation sources:
25 src/
26
27Example of device code:
28 examples/
29
30Optional dependencies:
31 external/
32 third_party/
33
34Build files:
35 libweave_standalone.gyp
36 libweave_common.gypi
37
38ChromiumOS specific build files:
39 libweave-test.pc.in
40 libweave.pc.in
41 platform2.gyp
42 platform2_preinstall.sh
43
44AOSP specific build files:
45 Android.mk
46
47Quick start on Ubuntu
48---------------------
49
50Install prerequisites:
51
52 examples/ubuntu/prerequisites.sh
53
54Build library, tests, run tests, build example:
55
56 examples/ubuntu/build.sh
57
58Execute example:
59
60 sudo out/Debug/weave
61
62
63Prerequisites
64-------------
65Common:
66
67 autoconf
68 automake
69 binutils
70 libtool
71 gyp
72 libexpat1-dev
73 ninja-build
74
75For tests:
76
77 gtest
78 gmock
79
80For examples:
81
82 hostapd
83 libavahi-client-dev
84 libcurl4-openssl-dev
85 libevent 2.1.x-alpha
86
87
88Compiling
89---------
90Everywhere below Debug can be replaced with Release.
91
92Generate ninja build files:
93
94 gyp -I libweave_common.gypi --toplevel-dir=. \
95 -f ninja libweave_standalone.gyp
96
97Build library with tests:
98
99 ninja -C out/Debug
100
101Build library only:
102
103 ninja -C out/Debug libweave
104
105Testing
106-------
107Run unittests tests:
108
109 out/Debug/libweave_testrunner
110 out/Debug/libweave_exports_testrunner
111
112Making changes
113--------------
114Make sure to have correct user in local or global config e.g.:
115
116 git config --local user.name "John Doe"
117 git config --local user.email johndoe@example.com
118
119Edit code and commit locally e.g.:
120
121 git commit -a -v
122
123Upload CL:
124
125 git push origin HEAD:refs/for/master
126
127Go to the url from the output of "push" and add reviewers.