From 3af5552b549fb04a2caf921100057ea87d0fe8df Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Sun, 11 Oct 2015 14:24:23 -0700 Subject: [PATCH] Makefile target to build a single plugin for local testing. Often when developing a plugin it's only necessary to rebuild that plugin. Here we add a simple Makefile target that makes that easy: make plugin-dev PLUGIN=provider-aws Since it's only building one package and it's only building for the host architecture, this just uses "go install" directly, rather than using gox as we do when installing multiple packages, possibly for multiple architectures. --- CHANGELOG.md | 1 + Makefile | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index adfe7c2a8..5e6fae1ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,6 +71,7 @@ BUG FIXES: INTERNAL IMPROVEMENTS: + * core: Makefile target "plugin-dev" for building just one plugin. [GH-3229] * helper/schema: Don't allow ``Update`` func if no attributes can actually be updated, per schema. [GH-3288] * helper/schema: Default hashing function for sets [GH-3018] * helper/multierror: Remove in favor of [github.com/hashicorp/go-multierror](http://github.com/hashicorp/go-multierror). [GH-3336] diff --git a/Makefile b/Makefile index 548b3ed2b..e53106307 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,12 @@ dev: generate quickdev: generate @TF_QUICKDEV=1 TF_DEV=1 sh -c "'$(CURDIR)/scripts/build.sh'" +# Shorthand for building and installing just one plugin for local testing. +# Run as (for example): make plugin-dev PLUGIN=provider-aws +plugin-dev: generate + go install github.com/hashicorp/terraform/builtin/bins/$(PLUGIN) + mv $(GOPATH)/bin/$(PLUGIN) $(GOPATH)/bin/terraform-$(PLUGIN) + release: updatedeps gox -build-toolchain @$(MAKE) bin