Vitaly Buka | 80925a7 | 2015-09-16 17:16:21 -0700 | [diff] [blame] | 1 | Overview |
| 2 | -------- |
Vitaly Buka | b0efd87 | 2015-12-03 10:50:10 -0800 | [diff] [blame] | 3 | libWeave is the library with device side implementation of Weave |
Vitaly Buka | 80925a7 | 2015-09-16 17:16:21 -0700 | [diff] [blame] | 4 | protocol. |
| 5 | |
| 6 | Sources |
| 7 | ------- |
| 8 | Sources are located in git repository at |
| 9 | https://weave.googlesource.com/weave/libweave/ |
| 10 | |
Vitaly Buka | 80925a7 | 2015-09-16 17:16:21 -0700 | [diff] [blame] | 11 | |
Paul Westbrook | dac3ea3 | 2015-10-31 17:03:16 -0700 | [diff] [blame] | 12 | Install Repo |
| 13 | ------- |
| 14 | 1. Make sure you have a bin/ directory in your home directory |
| 15 | and that it is included in your path: |
| 16 | |
| 17 | mkdir ~/bin |
| 18 | PATH=~/bin:$PATH |
| 19 | |
| 20 | 2. 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 | |
| 25 | Checkout code |
| 26 | ------- |
| 27 | repo init -u https://weave.googlesource.com/weave/manifest |
| 28 | repo sync |
Vitaly Buka | 80925a7 | 2015-09-16 17:16:21 -0700 | [diff] [blame] | 29 | |
| 30 | Directory structure |
| 31 | ------------------- |
| 32 | Includes to be used by device code: |
| 33 | include/ |
| 34 | |
| 35 | Implementation sources: |
| 36 | src/ |
| 37 | |
| 38 | Example of device code: |
| 39 | examples/ |
| 40 | |
Vitaly Buka | 35fb87b | 2015-10-14 17:50:26 -0700 | [diff] [blame] | 41 | Dependencies: |
Vitaly Buka | 80925a7 | 2015-09-16 17:16:21 -0700 | [diff] [blame] | 42 | third_party/ |
| 43 | |
| 44 | Build files: |
| 45 | libweave_standalone.gyp |
| 46 | libweave_common.gypi |
| 47 | |
Stefan Sauer | 6a8a47b | 2015-10-16 16:50:44 +0200 | [diff] [blame] | 48 | Quick start on Debian/Ubuntu |
| 49 | ---------------------------- |
Vitaly Buka | 80925a7 | 2015-09-16 17:16:21 -0700 | [diff] [blame] | 50 | |
| 51 | Install prerequisites: |
| 52 | |
Stefan Sauer | 6a8a47b | 2015-10-16 16:50:44 +0200 | [diff] [blame] | 53 | examples/prerequisites.sh |
Vitaly Buka | 80925a7 | 2015-09-16 17:16:21 -0700 | [diff] [blame] | 54 | |
| 55 | Build library, tests, run tests, build example: |
| 56 | |
Stefan Sauer | 6a8a47b | 2015-10-16 16:50:44 +0200 | [diff] [blame] | 57 | examples/build.sh |
Vitaly Buka | 80925a7 | 2015-09-16 17:16:21 -0700 | [diff] [blame] | 58 | |
Jun Yang | d7c0fb8 | 2015-11-03 14:58:15 -0800 | [diff] [blame] | 59 | Execute example (check examples/daemon/README for details): |
Vitaly Buka | 80925a7 | 2015-09-16 17:16:21 -0700 | [diff] [blame] | 60 | |
Paul Westbrook | 422cdda | 2015-11-02 11:56:28 -0800 | [diff] [blame] | 61 | sudo out/Debug/weave_daemon |
Vitaly Buka | 80925a7 | 2015-09-16 17:16:21 -0700 | [diff] [blame] | 62 | |
| 63 | |
| 64 | Prerequisites |
| 65 | ------------- |
| 66 | Common: |
| 67 | |
| 68 | autoconf |
| 69 | automake |
| 70 | binutils |
| 71 | libtool |
| 72 | gyp |
| 73 | libexpat1-dev |
Vitaly Buka | 80925a7 | 2015-09-16 17:16:21 -0700 | [diff] [blame] | 74 | |
| 75 | For tests: |
| 76 | |
| 77 | gtest |
| 78 | gmock |
| 79 | |
| 80 | For examples: |
| 81 | |
| 82 | hostapd |
| 83 | libavahi-client-dev |
| 84 | libcurl4-openssl-dev |
| 85 | libevent 2.1.x-alpha |
| 86 | |
| 87 | |
| 88 | Compiling |
| 89 | --------- |
| 90 | Everywhere below Debug can be replaced with Release. |
| 91 | |
Vitaly Buka | 9e9aca9 | 2015-11-23 23:20:12 -0800 | [diff] [blame] | 92 | Generate build files: |
Vitaly Buka | 80925a7 | 2015-09-16 17:16:21 -0700 | [diff] [blame] | 93 | |
Johan Euphrosine | 63e49b5 | 2015-10-14 22:55:04 -0700 | [diff] [blame] | 94 | gyp -I libweave_common.gypi --toplevel-dir=. --depth=. \ |
Vitaly Buka | 9e9aca9 | 2015-11-23 23:20:12 -0800 | [diff] [blame] | 95 | -f make libweave_standalone.gyp |
Vitaly Buka | 80925a7 | 2015-09-16 17:16:21 -0700 | [diff] [blame] | 96 | |
| 97 | Build library with tests: |
| 98 | |
Vitaly Buka | 9e9aca9 | 2015-11-23 23:20:12 -0800 | [diff] [blame] | 99 | make |
Vitaly Buka | 80925a7 | 2015-09-16 17:16:21 -0700 | [diff] [blame] | 100 | |
| 101 | Build library only: |
| 102 | |
Vitaly Buka | 9e9aca9 | 2015-11-23 23:20:12 -0800 | [diff] [blame] | 103 | make libweave |
Vitaly Buka | 80925a7 | 2015-09-16 17:16:21 -0700 | [diff] [blame] | 104 | |
| 105 | Testing |
| 106 | ------- |
| 107 | Run unittests tests: |
| 108 | |
| 109 | out/Debug/libweave_testrunner |
| 110 | out/Debug/libweave_exports_testrunner |
| 111 | |
| 112 | Making changes |
| 113 | -------------- |
| 114 | Make 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 Westbrook | dac3ea3 | 2015-10-31 17:03:16 -0700 | [diff] [blame] | 119 | Start local branch |
| 120 | |
| 121 | repo start <branch name> . |
| 122 | |
Vitaly Buka | 80925a7 | 2015-09-16 17:16:21 -0700 | [diff] [blame] | 123 | Edit code and commit locally e.g.: |
| 124 | |
| 125 | git commit -a -v |
| 126 | |
| 127 | Upload CL: |
| 128 | |
Paul Westbrook | dac3ea3 | 2015-10-31 17:03:16 -0700 | [diff] [blame] | 129 | repo upload . |
Vitaly Buka | 80925a7 | 2015-09-16 17:16:21 -0700 | [diff] [blame] | 130 | |
Paul Westbrook | dac3ea3 | 2015-10-31 17:03:16 -0700 | [diff] [blame] | 131 | Go to the url from the output of "repo upload" and add reviewers. |