Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Turn Core←→Plug-ins #62

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dohernandez
Copy link
Contributor

@dohernandez dohernandez commented Nov 28, 2024

Description

Turn dev pkg into a Plug-ins architecture allowing to add plugins on the based targets enriching the experience of the make command for development.

With this change now it is possible to extends the basic targets defined in the package just by including the a key=value item into the MODULES var.

# MODULES is a list of dev modules (mk) to be included in the project.
MODULES := \
	DEVGO_PATH=github.com/bool64/dev

to add another module, right now is as simple as

# MODULES is a list of dev modules (mk) to be included in the project.
MODULES := \
	DEVGO_PATH=github.com/bool64/dev \
	DEVGRPCGO_PATH=github.com/dohernandez/dev-grpc

where the key value DEVGO_PATH is the root path and var that will be exported for further use. The value github.com/bool64/dev represents the github repository where the mk files are stored.

Example of how to add a plugin, github.com/dohernandez/dev-grpc:

  1. Add the module and import the mk
# Makefile

# MODULES is a list of dev modules (mk) to be included in the project.
MODULES := \
	DEVGO_PATH=github.com/bool64/dev \
	DEVGRPCGO_PATH=github.com/dohernandez/dev-grpc

  ...	
	
-include $(DEVGO_PATH)/makefiles/bench.mk
-include $(DEVGO_PATH)/makefiles/reset-ci.mk

-include $(DEVGRPCGO_PATH)/makefiles/protoc.mk

2.Add the module into the dev_test.go to your unused import

package mymodule_test

import (
    _ "github.com/bool64/dev" // Include development helpers to the project. 
    _ "github.com/dohernandez/dev-grpc" // Include development grpc helpers to the project. 

Turn dev pkg into a Plug-ins architecture allowing to add plugins on the based targets enriching the experience of the `make` command for development.
Copy link

github-actions bot commented Nov 28, 2024

Lines Of Code

Language Files Lines Code Comments Blanks Complexity Bytes
Go 8 (+1) 163 (+6) 114 (+2) 21 (+2) 28 (+2) 22 3.6K (+122B)
Makefile 13 (+2) 312 (+70) 210 (+47) 41 (+11) 61 (+12) 47 (+2) 10.6K (+1.8K)
Markdown 4 209 (+79) 153 (+57) 0 56 (+22) 0 5.8K (+2.1K)
Shell 6 (+1) 169 (+62) 101 (+36) 28 (+13) 40 (+13) 86 (+5) 7.1K (+1.7K)
YAML 11 (+1) 804 (+41) 676 (+36) 54 (+5) 74 0 27.5K (+1K)

@dohernandez dohernandez requested a review from vearutop November 28, 2024 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant