forked from square/wire
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgen_tests.sh
executable file
·57 lines (41 loc) · 2.01 KB
/
gen_tests.sh
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
#!/bin/bash
set -e
mvn clean package -pl wire-compiler -am -Dmaven.test.skip
cd wire-runtime
PROTOS=`find src/test/proto -name '*.proto' | sed 's|^src/test/proto/||'`
java -jar ../wire-compiler/target/wire-compiler-*-SNAPSHOT-jar-with-dependencies.jar \
--proto_path=../wire-runtime/src/test/proto \
--java_out=../wire-runtime/src/test/proto-java \
${PROTOS}
# NO OPTIONS
java -jar ../wire-compiler/target/wire-compiler-*-SNAPSHOT-jar-with-dependencies.jar \
--proto_path=../wire-runtime/src/test/proto \
--java_out=../wire-runtime/src/test/proto-java.noOptions \
--no_options \
${PROTOS}
cp src/test/proto-java.noOptions/com/squareup/wire/protos/custom_options/FooBar.java \
src/test/proto-java/com/squareup/wire/protos/custom_options/FooBar.java.noOptions
cp src/test/proto-java.noOptions/com/squareup/wire/protos/custom_options/MessageWithOptions.java \
src/test/proto-java/com/squareup/wire/protos/custom_options/MessageWithOptions.java.noOptions
# ANDROID
java -jar ../wire-compiler/target/wire-compiler-*-SNAPSHOT-jar-with-dependencies.jar \
--proto_path=../wire-runtime/src/test/proto \
--java_out=../wire-runtime/src/test/proto-java.android \
--android \
person.proto
cp src/test/proto-java.android/com/squareup/wire/protos/person/Person.java \
src/test/proto-java/com/squareup/wire/protos/person/Person.java.android
# COMPACT
java -jar ../wire-compiler/target/wire-compiler-*-SNAPSHOT-jar-with-dependencies.jar \
--proto_path=../wire-runtime/src/test/proto \
--java_out=../wire-runtime/src/test/proto-java.compact \
--compact \
all_types.proto
cp src/test/proto-java.compact/com/squareup/wire/protos/alltypes/AllTypes.java \
src/test/proto-java/com/squareup/wire/protos/alltypes/AllTypes.java.compact
# GSON (uses COMPACT)
cp src/test/proto-java.compact/com/squareup/wire/protos/alltypes/AllTypes.java \
../wire-gson-support/src/test/java/com/squareup/wire/protos/alltypes/AllTypes.java
rm -r src/test/proto-java.noOptions
rm -r src/test/proto-java.compact
rm -r src/test/proto-java.android