Vitaly Buka | 80925a7 | 2015-09-16 17:16:21 -0700 | [diff] [blame] | 1 | Overview |
| 2 | -------- |
| 3 | libWeave is the library to with device side implementation of Weave |
| 4 | protocol. |
| 5 | |
| 6 | Sources |
| 7 | ------- |
| 8 | Sources are located in git repository at |
| 9 | https://weave.googlesource.com/weave/libweave/ |
| 10 | |
| 11 | Checkout 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 | |
| 19 | Directory structure |
| 20 | ------------------- |
| 21 | Includes to be used by device code: |
| 22 | include/ |
| 23 | |
| 24 | Implementation sources: |
| 25 | src/ |
| 26 | |
| 27 | Example of device code: |
| 28 | examples/ |
| 29 | |
| 30 | Optional dependencies: |
| 31 | external/ |
| 32 | third_party/ |
| 33 | |
| 34 | Build files: |
| 35 | libweave_standalone.gyp |
| 36 | libweave_common.gypi |
| 37 | |
| 38 | ChromiumOS specific build files: |
| 39 | libweave-test.pc.in |
| 40 | libweave.pc.in |
| 41 | platform2.gyp |
| 42 | platform2_preinstall.sh |
| 43 | |
| 44 | AOSP specific build files: |
| 45 | Android.mk |
| 46 | |
| 47 | Quick start on Ubuntu |
| 48 | --------------------- |
| 49 | |
| 50 | Install prerequisites: |
| 51 | |
| 52 | examples/ubuntu/prerequisites.sh |
| 53 | |
| 54 | Build library, tests, run tests, build example: |
| 55 | |
| 56 | examples/ubuntu/build.sh |
| 57 | |
| 58 | Execute example: |
| 59 | |
| 60 | sudo out/Debug/weave |
| 61 | |
| 62 | |
| 63 | Prerequisites |
| 64 | ------------- |
| 65 | Common: |
| 66 | |
| 67 | autoconf |
| 68 | automake |
| 69 | binutils |
| 70 | libtool |
| 71 | gyp |
| 72 | libexpat1-dev |
| 73 | ninja-build |
| 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 | |
| 92 | Generate ninja build files: |
| 93 | |
| 94 | gyp -I libweave_common.gypi --toplevel-dir=. \ |
| 95 | -f ninja libweave_standalone.gyp |
| 96 | |
| 97 | Build library with tests: |
| 98 | |
| 99 | ninja -C out/Debug |
| 100 | |
| 101 | Build library only: |
| 102 | |
| 103 | ninja -C out/Debug libweave |
| 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 | |
| 119 | Edit code and commit locally e.g.: |
| 120 | |
| 121 | git commit -a -v |
| 122 | |
| 123 | Upload CL: |
| 124 | |
| 125 | git push origin HEAD:refs/for/master |
| 126 | |
| 127 | Go to the url from the output of "push" and add reviewers. |