blob: c13ba747fa915f5c9c0ca76a15f297f7e62b344c [file] [log] [blame]
Jens Geyera7da4882013-07-18 00:33:05 +02001#
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
Jens Geyer45687922014-04-07 21:20:16 +020020THRIFT = $(top_srcdir)/compiler/cpp/thrift -out gopath/src/ --gen go:thrift_import=thrift
Jens Geyera7da4882013-07-18 00:33:05 +020021THRIFTTEST = $(top_srcdir)/test/ThriftTest.thrift
22
23# Thrift for GO has problems with complex map keys: THRIFT-2063
Jens Geyer20bcf382014-04-16 00:27:31 +020024gopath: $(top_srcdir)/compiler/cpp/thrift $(THRIFTTEST) \
25 IncludesTest.thrift \
26 NamespacedTest.thrift \
Jens Geyer751c97c2014-04-22 23:36:27 +020027 MultiplexedProtocolTest.thrift \
Jens Geyer731975a2014-05-02 00:24:24 +020028 OnewayTest.thrift \
29 OptionalFieldsTest.thrift \
30 ServicesTest.thrift \
Jens Geyerc0d126f2014-06-19 22:49:54 +020031 GoTagTest.thrift \
Jens Geyer731975a2014-05-02 00:24:24 +020032 TypedefFieldTest.thrift \
33 RefAnnotationFieldsTest.thrift
Jens Geyera7da4882013-07-18 00:33:05 +020034 mkdir -p gopath/src
Jens Geyer731975a2014-05-02 00:24:24 +020035 grep -v list.*map.*list.*map $(THRIFTTEST) | grep -v 'set<Insanity>' > ThriftTest.thrift
Jens Geyer45687922014-04-07 21:20:16 +020036 $(THRIFT) -r IncludesTest.thrift
37 $(THRIFT) BinaryKeyTest.thrift
Jens Geyer751c97c2014-04-22 23:36:27 +020038 $(THRIFT) MultiplexedProtocolTest.thrift
Jens Geyerc2ccca82014-04-14 22:36:50 +020039 $(THRIFT) OnewayTest.thrift
Jens Geyer731975a2014-05-02 00:24:24 +020040 $(THRIFT) OptionalFieldsTest.thrift
41 $(THRIFT) ServicesTest.thrift
Jens Geyerc0d126f2014-06-19 22:49:54 +020042 $(THRIFT) GoTagTest.thrift
Jens Geyer731975a2014-05-02 00:24:24 +020043 $(THRIFT) TypedefFieldTest.thrift
44 $(THRIFT) RefAnnotationFieldsTest.thrift
45 GOPATH=`pwd`/gopath $(GO) get code.google.com/p/gomock/gomock
Jens Geyera7da4882013-07-18 00:33:05 +020046 ln -nfs ../../../thrift gopath/src/thrift
Jens Geyer45687922014-04-07 21:20:16 +020047 ln -nfs ../../tests gopath/src/tests
Jens Geyera7da4882013-07-18 00:33:05 +020048 touch gopath
49
50check: gopath
Jens Geyer731975a2014-05-02 00:24:24 +020051 GOPATH=`pwd`/gopath $(GO) build \
Jens Geyere52c0462014-05-02 23:37:39 +020052 includestest \
53 binarykeytest \
54 servicestest \
55 typedeffieldtest \
56 refannotationfieldstest
Jens Geyer45687922014-04-07 21:20:16 +020057 GOPATH=`pwd`/gopath $(GO) test thrift tests
Jens Geyera7da4882013-07-18 00:33:05 +020058
59clean-local:
Jens Geyerf04d9f42014-07-27 13:32:12 +020060 $(RM) -r gopath ThriftTest.thrift gen-go
Jens Geyera7da4882013-07-18 00:33:05 +020061
62client: stubs
63 $(GO) run TestClient.go
jfarrell32d323e2013-08-15 20:39:58 -040064
65EXTRA_DIST = \
jfarrell8fd8c632014-07-10 09:14:51 -040066 tests \
67 BinaryKeyTest.thrift \
68 GoTagTest.thrift \
jfarrell32d323e2013-08-15 20:39:58 -040069 IncludesTest.thrift \
jfarrell8fd8c632014-07-10 09:14:51 -040070 MultiplexedProtocolTest.thrift \
71 NamespacedTest.thrift \
72 OnewayTest.thrift \
73 OptionalFieldsTest.thrift \
74 RefAnnotationFieldsTest.thrift \
75 ServicesTest.thrift \
76 TypedefFieldTest.thrift