mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-06-24 03:28:23 +08:00
- Implemented `RequestInterceptor`, `ResponseInterceptor`, and `StreamChunkInterceptor` using embedded JavaScript. - Added support for configuring script paths, built-in script resolution, and safe execution. - Introduced ABI lifecycle management, plugin registration, and execution monitoring. - Enhanced with extensive test coverage for both plugin behavior and configuration logic.
24 lines
590 B
Makefile
24 lines
590 B
Makefile
PLUGIN_NAME ?= jshandler
|
|
BUILD_DIR ?= .
|
|
GOOS ?= $(shell go env GOOS)
|
|
GOARCH ?= $(shell go env GOARCH)
|
|
|
|
EXT_linux = so
|
|
EXT_freebsd = so
|
|
EXT_darwin = dylib
|
|
EXT_windows = dll
|
|
PLUGIN_EXT = $(or $(EXT_$(GOOS)),so)
|
|
PLUGIN_OUTPUT ?= $(BUILD_DIR)/$(PLUGIN_NAME).$(PLUGIN_EXT)
|
|
PLUGIN_HEADER = $(basename $(PLUGIN_OUTPUT)).h
|
|
|
|
.PHONY: build clean
|
|
|
|
build:
|
|
CGO_ENABLED=1 GOOS=$(GOOS) GOARCH=$(GOARCH) go build -buildmode=c-shared -o $(PLUGIN_OUTPUT) .
|
|
|
|
clean:
|
|
rm -f $(BUILD_DIR)/$(PLUGIN_NAME).so
|
|
rm -f $(BUILD_DIR)/$(PLUGIN_NAME).dylib
|
|
rm -f $(BUILD_DIR)/$(PLUGIN_NAME).dll
|
|
rm -f $(PLUGIN_HEADER)
|