Skip to content

Commit 2a5c0b7

Browse files
committed
add docker for grammar generate.
1 parent db0c656 commit 2a5c0b7

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
all: peg grammar
2+
3+
peg:
4+
docker build -t peg-tool tool
5+
6+
grammar:
7+
docker run -it --rm -v `pwd`/lib/src:/src --platform linux/amd64 peg-tool

tool/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM google/dart:1.24.3
2+
3+
WORKDIR /tool
4+
RUN git clone https://github.com/cloudwebrtc/peg && \
5+
cd peg && \
6+
pub get && \
7+
pub global activate --source path .
8+
9+
WORKDIR /src
10+
CMD ["dart", "/tool/peg/bin/peg.dart", "general", "/src/grammar.peg"]

tool/README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
## NOTE
1+
# NOTE
22

33
`grammar_parser.dart` is generated from `grammar.peg` using the [peg](https://github.com/cloudwebrtc/peg) tool.
44
Since the peg tool does not support `dart 2.x`, you need to use `dart 1.24.3`.
55

6-
# Generate steps:
6+
## Generate steps
7+
78
- Install `Dart 1.24.3`.
89

910
`brew install dart@1`
@@ -22,4 +23,13 @@ Since the peg tool does not support `dart 2.x`, you need to use `dart 1.24.3`.
2223

2324
- Generate grammar parser
2425

25-
`./tool/generate_grammar.sh`
26+
`./tool/generate_grammar.sh`
27+
28+
## or use Docker
29+
30+
- Install `Docker`.
31+
32+
- Generate grammar parser
33+
`git clone https://github.com/flutter-webrtc/dart-sip-ua`
34+
`cd dart-sip-ua`
35+
`make peg && make grammar`

0 commit comments

Comments
 (0)