blob: c78283b66ba7b8e4f25521f215af152753abfd57 [file] [log] [blame]
Vitaly Buka80925a72015-09-16 17:16:21 -07001Overview
2--------
Vitaly Bukab0efd872015-12-03 10:50:10 -08003libWeave is the library with device side implementation of Weave
Vitaly Buka80925a72015-09-16 17:16:21 -07004protocol.
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
Jun Yangd7c0fb82015-11-03 14:58:15 -080059Execute example (check examples/daemon/README for details):
Vitaly Buka80925a72015-09-16 17:16:21 -070060
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
Vitaly Buka80925a72015-09-16 17:16:21 -070074
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
Vitaly Buka9e9aca92015-11-23 23:20:12 -080092Generate build files:
Vitaly Buka80925a72015-09-16 17:16:21 -070093
Johan Euphrosine63e49b52015-10-14 22:55:04 -070094 gyp -I libweave_common.gypi --toplevel-dir=. --depth=. \
Vitaly Buka9e9aca92015-11-23 23:20:12 -080095 -f make libweave_standalone.gyp
Vitaly Buka80925a72015-09-16 17:16:21 -070096
97Build library with tests:
98
Vitaly Buka9e9aca92015-11-23 23:20:12 -080099 make
Vitaly Buka80925a72015-09-16 17:16:21 -0700100
101Build library only:
102
Vitaly Buka9e9aca92015-11-23 23:20:12 -0800103 make libweave
Vitaly Buka80925a72015-09-16 17:16:21 -0700104
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
Paul Westbrookdac3ea32015-10-31 17:03:16 -0700119Start local branch
120
121 repo start <branch name> .
122
Vitaly Buka80925a72015-09-16 17:16:21 -0700123Edit code and commit locally e.g.:
124
125 git commit -a -v
126
127Upload CL:
128
Paul Westbrookdac3ea32015-10-31 17:03:16 -0700129 repo upload .
Vitaly Buka80925a72015-09-16 17:16:21 -0700130
Paul Westbrookdac3ea32015-10-31 17:03:16 -0700131Go to the url from the output of "repo upload" and add reviewers.