mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-11 18:20:33 +09:00
generate switft protobuf bindings
This commit is contained in:
parent
e62c6fb145
commit
7e9cfd3e24
6 changed files with 22 additions and 11 deletions
|
@ -317,14 +317,16 @@ jobs:
|
|||
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
|
||||
go mod download
|
||||
- restore_cache:
|
||||
key: homebrew-v3-{{ arch }}
|
||||
keys:
|
||||
- homebrew-v4-{{ arch }}
|
||||
- homebrew-v3-{{ arch }}
|
||||
- run:
|
||||
name: install protobuf
|
||||
# also mingw-w64 because we have the shared cache with build-lib-darwin-windows
|
||||
command: |
|
||||
brew install mingw-w64 protobuf jq
|
||||
brew install mingw-w64 protobuf jq swift-protobuf
|
||||
- save_cache:
|
||||
key: homebrew-v3-{{ arch }}
|
||||
key: homebrew-v4-{{ arch }}
|
||||
paths:
|
||||
- /usr/local/Homebrew
|
||||
- ~/Library/Caches/Homebrew
|
||||
|
@ -350,13 +352,13 @@ jobs:
|
|||
- ~/go/pkg
|
||||
- ~/Library/Caches/go-build
|
||||
- run:
|
||||
name: build obj c protobuf bindings
|
||||
name: build swift c protobuf bindings
|
||||
command: |
|
||||
cd ~/go/src/github.com/anytypeio/go-anytype-middleware
|
||||
mkdir -p protobuf/protos
|
||||
cp ./pb/protos/*.proto protobuf/protos
|
||||
cp ./vendor/github.com/anytypeio/go-anytype-library/pb/model/protos/*.proto protobuf/protos
|
||||
protoc -I ./ --objc_out=./protobuf pb/protos/* vendor/github.com/anytypeio/go-anytype-library/pb/model/protos/*
|
||||
protoc -I ./ --swift_opt=FileNaming=DropPath --swift_opt=Visibility=Internal --swift_out=./protobuf pb/protos/* vendor/github.com/anytypeio/go-anytype-library/pb/model/protos/*
|
||||
- run:
|
||||
name: collect artifacts
|
||||
command: |
|
||||
|
|
13
Makefile
13
Makefile
|
@ -53,13 +53,13 @@ build-js:
|
|||
build-ios:
|
||||
$(eval FLAGS := $$(shell govvv -flags | sed 's/main/github.com\/anytypeio\/go-anytype-middleware\/lib/g'))
|
||||
env go111module=off gomobile bind -ldflags "$(FLAGS)" -v -target=ios github.com/anytypeio/go-anytype-middleware/lib
|
||||
mkdir -p dist/ios/ && cp -r Mobile.framework mobile/dist/ios/
|
||||
mkdir -p dist/ios/ && cp -r Mobile.framework dist/ios/
|
||||
rm -rf Mobile.framework
|
||||
|
||||
build-android:
|
||||
$(eval FLAGS := $$(shell govvv -flags | sed 's/main/github.com\/anytypeio\/go-anytype-middleware\/lib/g'))
|
||||
env go111module=off gomobile bind -ldflags "$(FLAGS)" -v -target=android -o mobile.aar github.com/anytypeio/go-anytype-middleware/lib
|
||||
mkdir -p dist/android/ && mv mobile.aar mobile/dist/android/
|
||||
mkdir -p dist/android/ && mv mobile.aar dist/android/
|
||||
|
||||
setup-protoc:
|
||||
rm -rf $(GOPATH)/src/github.com/gogo
|
||||
|
@ -87,6 +87,15 @@ protos: protos_deps
|
|||
GOGO_NO_UNDERSCORE=1 GOGO_EXPORT_ONEOF_INTERFACE=1 PACKAGE_PATH=github.com/anytypeio/go-anytype-middleware/pb protoc -I=. --gogofaster_out=$(PKGMAP),plugins=gomobile:. ./pb/protos/service/service.proto; mv ./pb/protos/service/*.pb.go ./lib/
|
||||
protoc -I ./ --doc_out=./docs --doc_opt=markdown,proto.md pb/protos/service/*.proto pb/protos/*.proto vendor/github.com/anytypeio/go-anytype-library/pb/model/protos/*.proto
|
||||
|
||||
protos-swift:
|
||||
protoc -I ./ --swift_opt=FileNaming=DropPath --swift_opt=Visibility=Internal --swift_out=./build/swift pb/protos/* vendor/github.com/anytypeio/go-anytype-library/pb/model/protos/*
|
||||
|
||||
protos-java:
|
||||
protoc -I ./ --java_out=./protobuf pb/protos/* vendor/github.com/anytypeio/go-anytype-library/pb/model/protos/*.proto
|
||||
|
||||
protos-ts:
|
||||
npm run build:ts
|
||||
|
||||
build-dev-js:
|
||||
go mod download
|
||||
make build-lib build-js
|
||||
|
|
2
go.mod
2
go.mod
|
@ -3,7 +3,7 @@ module github.com/anytypeio/go-anytype-middleware
|
|||
go 1.12
|
||||
|
||||
require (
|
||||
github.com/anytypeio/go-anytype-library v0.0.0-20191216120937-496f2447de98
|
||||
github.com/anytypeio/go-anytype-library v0.0.0-20191216203601-efaea4671983
|
||||
|
||||
github.com/gogo/protobuf v1.3.1
|
||||
github.com/golang/mock v1.3.1
|
||||
|
|
4
go.sum
4
go.sum
|
@ -31,8 +31,8 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5Vpd
|
|||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZqLG4oE62mJzwPIB8+Tee4RNCL9ulrY=
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/anytypeio/go-anytype-library v0.0.0-20191216120937-496f2447de98 h1:BXXJIrx375GqEOy6XNLi0GZMN7vP5Ol2RMiZAZwauNs=
|
||||
github.com/anytypeio/go-anytype-library v0.0.0-20191216120937-496f2447de98/go.mod h1:PGWUuLJII1ajBLkUSo6McFu5LDueapm+HoZCfs9ZnYI=
|
||||
github.com/anytypeio/go-anytype-library v0.0.0-20191216203601-efaea4671983 h1:UaQ9LIvxbBGuKe68JorKr3P0I7QOKTXAQW2K+kdPuCU=
|
||||
github.com/anytypeio/go-anytype-library v0.0.0-20191216203601-efaea4671983/go.mod h1:PGWUuLJII1ajBLkUSo6McFu5LDueapm+HoZCfs9ZnYI=
|
||||
github.com/anytypeio/go-textile v0.6.10-0.20191213152255-79bffa62134a h1:+4iGG6rPm3vcJtqWZKlCg4Qvr1qfX9hLPkH6ru2VrEY=
|
||||
github.com/anytypeio/go-textile v0.6.10-0.20191213152255-79bffa62134a/go.mod h1:upnwIsP8dsXfGQEjJ8BL9AY6yJHU6etVWozxVN4PyXc=
|
||||
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
syntax = "proto3";
|
||||
syntax="proto3";
|
||||
package anytype;
|
||||
option go_package = "pb";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue