aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: c2ad2c9704b9b5a7760281350f4c1a2eb3461dee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# 1. High Level Voice Service Core (VSHL-CORE)
This repository hosts the code for the AGL's high level voice service's core request arbitration binding also known as VSHL-CORE.
Please refer to the [architecture](https://confluence.automotivelinux.org/display/SPE/Speech+EG+Architecture) for more information.

# 2. Build Dependencies and License Information

During the build time, the following dependencies are fetched and run by the build system. Please refer to each of the individual entities for the particular licenses.
* [Google Test v1.8.0](https://github.com/google/googletest) when compiled with ENABLE_UNIT_TESTS option.

# 3. Getting the Source Code
```
export MY_PROJECTS_DIR = <Your Project Directory>
pushd $MY_PROJECTS_DIR
git clone --recursive https://gerrit.automotivelinux.org/gerrit/apps/agl-service-voice-high-core
```

# 4. Renesas R-Car M3 board
## 4.1 Building VSHL Core

```
pushd agl-service-voice-high-core
mkdir build
pushd build
source /opt/agl-sdk/6.0.1-aarch64/environment-setup-aarch64-agl-linux
cmake ..
make autobuild
popd
./conf.d/autobuild/agl/autobuild package
```
* The build output will be located at $MY_PROJECTS_DIR/agl-service-voice-high-core/build/vshl-core.wgt

## 4.2 Running VSHL Core
```
# afm-util install vshl-core.wgt
# afm-util start vshl-core@1.0
```

# 5. Ubuntu 16.04
## 5.1 Building VSHL Core

```
pushd agl-service-voice-high-core
mkdir build
pushd build
cmake ..
make autobuild
popd
./conf.d/autobuild/linux/autobuild package
```
To build the included unit tests modify the cmake step as following:
cmake .. -DENABLE_UNIT_TESTS=ON

## 5.2 Running VSHL Core
```
afb-daemon --port=1111 --name=afb-vshl-core --workdir=$MY_PROJECTS_DIR/agl-voice-service-high-core/build/package --ldpaths=lib --roothttp=htdocs --token= -vvv
```

# 6. Running the Unit Tests
## 6.1 Ubuntu 16.04
```
pushd agl-service-voice-high-core/
./build/src/plugins/vshl-core-api_Test
popd
```

# 7. Testing VSHL Core
* The binding can be tested by launching the HTML5 sample application that is bundled with the package in a browser.

```
http://localhost:1111
```

# 8. Contributing code
Before contributing the source, its recommended to format the code with clang-format. This is done automatically during commit step if following instructions are followed.
**Prerequisite**: Install clang-format-6.0 or greater.
There are following 2 options.

* Before commit, manually run clang-format on the file (It will use local .clang-format file for checking the rules)
```
clang-format -i <path to source file>
```

* Setup clang-format as pre-commit git hook. This is one time step after you clone the repo
```
cd ${VSHL_CORE_ROOT}
cp tools/pre-commit .git/hooks/pre-commit
```

* With the hook in place, everytime you try to commit, it will check the format and disallow commit if format doesn't abide by the .clang-format rules.
It will also give you the option to apply a patch (it creates a patch in /tmp folder) to make the source abide by the .clang-format rules. Apply the patch and proceed to commit
```
git apply /tmp/<patch>
git add <source files>
git commit
```