This repository has been archived by the owner on Jan 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen_tests.sh
executable file
·69 lines (51 loc) · 2.83 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
58
59
60
61
62
63
64
65
66
67
68
69
#!/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 \
--enum_options=squareup.protos.custom_options.enum_value_option,squareup.protos.custom_options.complex_enum_value_option,squareup.protos.foreign.foreign_enum_value_option \
${PROTOS}
# GSON
cp src/test/proto-java/com/squareup/wire/protos/alltypes/* ../wire-gson-support/src/test/java/com/squareup/wire/protos/alltypes/
# 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 \
--enum_options=squareup.protos.custom_options.enum_value_option \
${PROTOS}
cp src/test/proto-java.noOptions/com/squareup/wire/protos/custom_options/Ext_custom_options.java \
src/test/proto-java/com/squareup/wire/protos/custom_options/Ext_custom_options.java.noOptions
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
rm -r src/test/proto-java.noOptions
# REGISTRY
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 \
--registry_class=com.squareup.wire.protos.person.EmptyRegistry \
person.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 \
--registry_class=com.squareup.wire.protos.ProtoRegistry \
simple_message.proto external_message.proto foreign.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 \
--registry_class=com.squareup.wire.protos.one_extension.OneExtensionRegistry \
one_extension.proto
# 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
rm -r src/test/proto-java.android