blob: b62b547c15c0d8a9f07751e949cb98469f0dd2e2 [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
Vitaly Buka80925a72015-09-16 17:16:21 -070011
Paul Westbrookdac3ea32015-10-31 17:03:16 -070012Install Repo
13-------
141. Make sure you have a bin/ directory in your home directory
15and that it is included in your path:
16
17 mkdir ~/bin
18 PATH=~/bin:$PATH
19
202. Download the Repo tool and ensure that it is executable:
21
22 curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
23 chmod a+x ~/bin/repo
24
25Checkout code
26-------
27 repo init -u https://weave.googlesource.com/weave/manifest
28 repo sync
Vitaly Buka80925a72015-09-16 17:16:21 -070029
30Directory structure
31-------------------
32Includes to be used by device code:
33 include/
34
35Implementation sources:
36 src/
37
38Example of device code:
39 examples/
40
Vitaly Buka35fb87b2015-10-14 17:50:26 -070041Dependencies:
Vitaly Buka80925a72015-09-16 17:16:21 -070042 third_party/
43
44Build files:
45 libweave_standalone.gyp
46 libweave_common.gypi
47
Stefan Sauer6a8a47b2015-10-16 16:50:44 +020048Quick start on Debian/Ubuntu
49----------------------------
Vitaly Buka80925a72015-09-16 17:16:21 -070050
51Install prerequisites:
52
Stefan Sauer6a8a47b2015-10-16 16:50:44 +020053 examples/prerequisites.sh
Vitaly Buka80925a72015-09-16 17:16:21 -070054
55Build library, tests, run tests, build example:
56
Stefan Sauer6a8a47b2015-10-16 16:50:44 +020057 examples/build.sh
Vitaly Buka80925a72015-09-16 17:16:21 -070058
59Execute example:
60
Paul Westbrook422cdda2015-11-02 11:56:28 -080061 sudo out/Debug/weave_daemon
Vitaly Buka80925a72015-09-16 17:16:21 -070062
63
64Prerequisites
65-------------
66Common:
67
68 autoconf
69 automake
70 binutils
71 libtool
72 gyp
73 libexpat1-dev
74 ninja-build
75
76For tests:
77
78 gtest
79 gmock
80
81For examples:
82
83 hostapd
84 libavahi-client-dev
85 libcurl4-openssl-dev
86 libevent 2.1.x-alpha
87
88
89Compiling
90---------
91Everywhere below Debug can be replaced with Release.
92
93Generate ninja build files:
94
Johan Euphrosine63e49b52015-10-14 22:55:04 -070095 gyp -I libweave_common.gypi --toplevel-dir=. --depth=. \
Vitaly Buka80925a72015-09-16 17:16:21 -070096 -f ninja libweave_standalone.gyp
97
98Build library with tests:
99
100 ninja -C out/Debug
101
102Build library only:
103
104 ninja -C out/Debug libweave
105
106Testing
107-------
108Run unittests tests:
109
110 out/Debug/libweave_testrunner
111 out/Debug/libweave_exports_testrunner
112
113Making changes
114--------------
115Make sure to have correct user in local or global config e.g.:
116
117 git config --local user.name "John Doe"
118 git config --local user.email johndoe@example.com
119
Paul Westbrookdac3ea32015-10-31 17:03:16 -0700120Start local branch
121
122 repo start <branch name> .
123
Vitaly Buka80925a72015-09-16 17:16:21 -0700124Edit code and commit locally e.g.:
125
126 git commit -a -v
127
128Upload CL:
129
Paul Westbrookdac3ea32015-10-31 17:03:16 -0700130 repo upload .
Vitaly Buka80925a72015-09-16 17:16:21 -0700131
Paul Westbrookdac3ea32015-10-31 17:03:16 -0700132Go to the url from the output of "repo upload" and add reviewers.
Vitaly Buka088dd0d2015-10-16 12:38:33 -0700133
134Known Issues
135------------
136* No big-endian support. Pairing fails on big-endian hardware.