Browse Source

Repair the plugins

Signed-off-by: Vadim Markovtsev <vadim@sourced.tech>
Vadim Markovtsev 5 years ago
parent
commit
77613670e7
3 changed files with 8 additions and 5 deletions
  1. 3 2
      .travis.yml
  2. 1 1
      cmd/hercules/generate_plugin.go
  3. 4 2
      contrib/_plugin_example/Makefile

+ 3 - 2
.travis.yml

@@ -63,8 +63,9 @@ script:
   - hercules --burndown --couples --devs --quiet --pb https://github.com/src-d/hercules > 1.pb
   - cp 1.pb 2.pb
   - hercules combine 1.pb 2.pb > 12.pb
-  - #(hercules generate-plugin -n MyPlug -o myplug && cd myplug && make)
-  - #(cd contrib/_plugin_example && make)
+  - (hercules generate-plugin -n MyPlug -o myplug && cd myplug && GOFLAGS="-tags=tensorflow" make)
+  - hercules --plugin myplug/my_plug.so --help | grep my-plug
+  - (cd contrib/_plugin_example && GOBIN=../.. make)
   - hercules --burndown --burndown-files --burndown-people --couples --devs --quiet https://github.com/src-d/hercules | labours -m all -o out --backend Agg --disable-projector
   - hercules --burndown --burndown-files --burndown-people --couples --devs --quiet --pb https://github.com/src-d/hercules | labours -f pb -m all -o out --backend Agg --disable-projector
   - # hercules --sentiment --quiet --languages Python https://github.com/src-d/hercules > /dev/null

+ 1 - 1
cmd/hercules/generate_plugin.go

@@ -111,7 +111,7 @@ var generatePluginCmd = &cobra.Command{
 all: {{.shlib}}
 
 {{.shlib}}: {{.output}} {{.protogo}}
-` + "\t" + `go build -buildmode=plugin -linkshared {{.output}} {{.protogo}}
+` + "\t" + `go build -buildmode=plugin ${GOFLAGS} {{.output}} {{.protogo}}
 
 {{.protogo}}: {{.proto}}
 ` + "\t" + `PATH=$$PATH:$$GOBIN protoc --gogo_out=. --proto_path=. {{.proto}}

+ 4 - 2
contrib/_plugin_example/Makefile

@@ -1,7 +1,9 @@
+GO111MODULE = on
+
 all: churn_analysis.so
 
 churn_analysis.so: churn_analysis.go churn_analysis.pb.go
-	go build -buildmode=plugin -linkshared churn_analysis.go churn_analysis.pb.go
+	go build -buildmode=plugin churn_analysis.go churn_analysis.pb.go
 
 churn_analysis.pb.go: churn_analysis.proto
-	PATH=$$PATH:$$GOPATH/bin protoc --gogo_out=. --proto_path=. churn_analysis.proto
+	PATH=$$PATH:$$GOBIN protoc --gogo_out=. --proto_path=. churn_analysis.proto