Add publish metadata: MIT license, README, icon, store tags, working make dist
This commit is contained in:
parent
cb06115f08
commit
c11585e79c
7 changed files with 111 additions and 8 deletions
11
Makefile
11
Makefile
|
|
@ -1,8 +1,9 @@
|
|||
PLUGIN_ID ?= $(shell grep 'plugin\.id' plugin.json | grep -o ':.*' | grep -o '"[^"]\+"' | sed 's/"//g')
|
||||
PLUGIN_NAME ?= $(shell grep 'plugin\.name' plugin.json | grep -o ':.*' | grep -o '"[^"]\+"' | sed 's/"//g')
|
||||
|
||||
GODOT ?= /usr/bin/godot
|
||||
GODOT ?= $(shell command -v godot 2>/dev/null || echo godot)
|
||||
OPENGAMEPAD_UI_REPO ?= https://github.com/ShadowBlip/OpenGamepadUI.git
|
||||
OPENGAMEPAD_UI_TAG ?= v0.40.4
|
||||
OPENGAMEPAD_UI_BASE ?= ../OpenGamepadUI
|
||||
EXPORT_PRESETS ?= $(OPENGAMEPAD_UI_BASE)/export_presets.cfg
|
||||
PLUGINS_DIR := $(OPENGAMEPAD_UI_BASE)/plugins
|
||||
|
|
@ -33,8 +34,8 @@ dist: build ## Build and package plugin
|
|||
|
||||
.PHONY: build
|
||||
build: $(PLUGINS_DIR)/$(PLUGIN_ID) export_preset ## Build the plugin
|
||||
@echo "Exporting plugin package"
|
||||
cd $(OPENGAMEPAD_UI_BASE) && $(MAKE) addons
|
||||
@echo "Importing project assets (expect non-fatal GDExtension errors without a built core addon)"
|
||||
cd $(OPENGAMEPAD_UI_BASE) && $(GODOT) --headless --import > /dev/null 2>&1 || true
|
||||
mkdir -p dist
|
||||
touch dist/.gdignore
|
||||
$(GODOT) --headless \
|
||||
|
|
@ -51,7 +52,7 @@ install: dist ## Installs the plugin
|
|||
@echo "Installed plugin to $(INSTALL_DIR)"
|
||||
|
||||
$(OPENGAMEPAD_UI_BASE):
|
||||
git clone $(OPENGAMEPAD_UI_REPO) $@
|
||||
git clone --branch $(OPENGAMEPAD_UI_TAG) --depth 1 $(OPENGAMEPAD_UI_REPO) $@
|
||||
|
||||
$(PLUGINS_DIR)/$(PLUGIN_ID): $(OPENGAMEPAD_UI_BASE)
|
||||
if ! [ -L $(PLUGINS_DIR)/$(PLUGIN_ID) ]; then ln -s $(PWD) $(PLUGINS_DIR)/$(PLUGIN_ID); fi
|
||||
|
|
@ -60,7 +61,7 @@ $(PLUGINS_DIR)/$(PLUGIN_ID): $(OPENGAMEPAD_UI_BASE)
|
|||
export_preset: $(OPENGAMEPAD_UI_BASE) ## Configure plugin export preset
|
||||
$(eval LAST_PRESET=$(shell grep -oEi '^\[preset\.([0-9]+)]' $(EXPORT_PRESETS) | tail -n 1))
|
||||
$(eval LAST_PRESET_NUM=$(shell echo "$(LAST_PRESET)" | grep -oE '([0-9]+)'))
|
||||
$(eval PRESET_NUM=$(shell echo "$(LAST_PRESET_NUM)+1" | bc))
|
||||
$(eval PRESET_NUM=$(shell expr $(LAST_PRESET_NUM) + 1))
|
||||
@if grep 'name="$(PLUGIN_NAME)"' $(EXPORT_PRESETS) > /dev/null; then \
|
||||
echo "Export preset already configured"; \
|
||||
else \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue