mirror of
https://github.com/LukeHagar/plexgo.git
synced 2025-12-06 04:20:46 +00:00
🐝 Write repo Makefile
This commit is contained in:
36
Makefile
36
Makefile
@@ -1,14 +1,26 @@
|
|||||||
.PHONY: specs
|
.PHONY: *
|
||||||
specs:
|
|
||||||
git clone https://github.com/LukeHagar/plex-api-spec.git api-specs
|
|
||||||
|
|
||||||
.PHONY: clean-specs
|
all: speakeasy
|
||||||
clean-specs:
|
|
||||||
rm -rf ./api-specs
|
|
||||||
|
|
||||||
build:
|
|
||||||
java -jar openapi-generator-cli.jar generate -i api-specs/pms/pms-spec.yaml -g go -o pms --global-property skipFormModel=false --config sdk-resources/pms-config.yaml -p enumClassPrefix=true --git-repo-id plexgo --git-user-id lukehagar
|
speakeasy: check-speakeasy
|
||||||
node sdk-resources/postscript.js ./pms
|
speakeasy generate sdk --lang go -o . -s ./openapi.yaml
|
||||||
java -jar openapi-generator-cli.jar generate -i api-specs/plextv/plextv-spec.yaml -g go -o plextv --global-property skipFormModel=false --config sdk-resources/plextv-config.yaml -p enumClassPrefix=true --git-repo-id plexgo --git-user-id lukehagar
|
|
||||||
node sdk-resources/postscript.js ./plextv
|
speakeasy-validate: check-speakeasy
|
||||||
|
speakeasy validate openapi -s ./openapi.yaml
|
||||||
|
|
||||||
|
openapi:
|
||||||
|
curl https://raw.githubusercontent.com/LukeHagar/plex-api-spec/main/plex-media-server-spec-dereferenced.yaml > ./openapi.yaml
|
||||||
|
|
||||||
|
# This will replace the generation source in your workflow file with your local schema path
|
||||||
|
generate-from-local:
|
||||||
|
@if ! which sed >/dev/null; then \
|
||||||
|
echo "sed is not installed. Please install it using the following command:"; \
|
||||||
|
echo "For Ubuntu/Debian: apt-get install sed"; \
|
||||||
|
echo "For macOS: sed is pre-installed"; \
|
||||||
|
exit 1; \
|
||||||
|
fi
|
||||||
|
@sed -i '' '/openapi_docs: |/{n;s|-.*|- ./openapi.yaml|;}' ./.github/workflows/speakeasy_sdk_generation.yml
|
||||||
|
|
||||||
|
check-speakeasy:
|
||||||
|
@command -v speakeasy >/dev/null 2>&1 || { echo >&2 "speakeasy CLI is not installed. Please install before continuing."; exit 1; }
|
||||||
|
|||||||
Reference in New Issue
Block a user