Skip to content
This repository has been archived by the owner on Jun 18, 2020. It is now read-only.

Commit

Permalink
Add golang driver test
Browse files Browse the repository at this point in the history
  • Loading branch information
sandrokeil committed Oct 26, 2017
1 parent a04847b commit 33bc2a1
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 6 deletions.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@ Native PHP extension for [ArangoDB](https://arangodb.com/).

## Development

First install dependencies with

```
$ ./get_fuerte
```

This extension is build with [PHP-CPP](http://www.php-cpp.com/).
The build is simple with [Docker Compose](https://docs.docker.com/compose/install/).

To build the c archive from go driver run `cd go && docker run --rm -it -v $(pwd):/go golang:1.9.1-stretch make build`

```
$ docker-compose build
$ docker-compose up -d --no-recreate
Expand Down
26 changes: 26 additions & 0 deletions go/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
PROJECT := arangodb-php-driver
SCRIPTDIR := $(shell pwd)
ROOTDIR := $(shell cd $(SCRIPTDIR) && pwd)

GOBUILDDIR := $(SCRIPTDIR)/.gobuild
GOVERSION := 1.8.3-alpine
TMPDIR := $(GOBUILDDIR)

ORGPATH := github.com/sandrokeil
ORGDIR := $(GOBUILDDIR)/src/$(ORGPATH)
REPONAME := $(PROJECT)
REPODIR := $(ORGDIR)/$(REPONAME)
REPOPATH := $(ORGPATH)/$(REPONAME)

SOURCES := $(shell find . -name '*.go')

.PHONY: all build

all: build

build: $(GOBUILDDIR) $(SOURCES)
GOPATH=$(GOBUILDDIR) go build -buildmode=c-archive -o arangodb.a main.go

$(GOBUILDDIR):
@mkdir -p $(ORGDIR)
GOPATH=$(GOBUILDDIR) go get github.com/arangodb/go-velocypack
19 changes: 19 additions & 0 deletions go/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package main

import (
"C"

"github.com/arangodb/go-velocypack"
)

// main is required to build a shared library, but does nothing
func main() {}

func test() {
var b velocypack.Builder

b.Bytes()

b.Close()
}

0 comments on commit 33bc2a1

Please sign in to comment.