| 30 |
ashish |
1 |
/*
|
|
|
2 |
* Licensed to the Apache Software Foundation (ASF) under one
|
|
|
3 |
* or more contributor license agreements. See the NOTICE file
|
|
|
4 |
* distributed with this work for additional information
|
|
|
5 |
* regarding copyright ownership. The ASF licenses this file
|
|
|
6 |
* to you under the Apache License, Version 2.0 (the
|
|
|
7 |
* "License"); you may not use this file except in compliance
|
|
|
8 |
* with the License. You may obtain a copy of the License at
|
|
|
9 |
*
|
|
|
10 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
11 |
*
|
|
|
12 |
* Unless required by applicable law or agreed to in writing,
|
|
|
13 |
* software distributed under the License is distributed on an
|
|
|
14 |
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
15 |
* KIND, either express or implied. See the License for the
|
|
|
16 |
* specific language governing permissions and limitations
|
|
|
17 |
* under the License.
|
|
|
18 |
*/
|
|
|
19 |
|
|
|
20 |
// This is to make sure you don't mess something up when you change typedef code.
|
|
|
21 |
// Generate it with the old and new thrift and make sure they are the same.
|
|
|
22 |
/*
|
|
|
23 |
rm -rf gen-* orig-*
|
|
|
24 |
mkdir old new
|
|
|
25 |
thrift --gen cpp --gen java --gen php --gen phpi --gen py --gen rb --gen xsd --gen perl --gen ocaml --gen erl --gen hs --strict ManyTypedefs.thrift
|
|
|
26 |
mv gen-* old
|
|
|
27 |
../compiler/cpp/thrift --gen cpp --gen java --gen php --gen phpi --gen py --gen rb --gen xsd --gen perl --gen ocaml --gen erl --gen hs --strict ManyTypedefs.thrift
|
|
|
28 |
mv gen-* new
|
|
|
29 |
diff -ur old new
|
|
|
30 |
rm -rf old new
|
|
|
31 |
# There should be no output.
|
|
|
32 |
*/
|
|
|
33 |
|
|
|
34 |
typedef i32 int32
|
|
|
35 |
typedef list<map<int32, string>> biglist
|
|
|
36 |
|
|
|
37 |
struct struct1 {
|
|
|
38 |
1: int32 myint;
|
|
|
39 |
2: biglist mylist;
|
|
|
40 |
}
|
|
|
41 |
|
|
|
42 |
exception exception1 {
|
|
|
43 |
1: biglist alist;
|
|
|
44 |
2: struct1 mystruct;
|
|
|
45 |
}
|
|
|
46 |
|
|
|
47 |
service AService {
|
|
|
48 |
struct1 method1(1: int32 myint) throws (1: exception1 exn);
|
|
|
49 |
biglist method2();
|
|
|
50 |
}
|