consider the value of site-url when verifying the handbook revision and simplify the makefile code to do so as well
This commit is contained in:
+10
-12
@@ -32,6 +32,7 @@ SG_PROJECT_NAME := The SenseGlove Unreal Engine Handbook
|
||||
|
||||
SG_HANDBOOK_DIR := $(CURDIR)
|
||||
SG_HANDBOOK_SRC_DIR := $(SG_HANDBOOK_DIR)/src
|
||||
SG_HANDBOOK_CONFIG_FILE := $(realpath $(SG_HANDBOOK_DIR)/book.toml)
|
||||
SG_PLUGIN_DIR := $(realpath $(SG_HANDBOOK_DIR)/..)
|
||||
SG_PLUGIN_RESOURCES_DIR := $(SG_PLUGIN_DIR)/Resources
|
||||
SG_PLUGIN_FILE := $(SG_PLUGIN_DIR)/SenseGlove.uplugin
|
||||
@@ -96,7 +97,8 @@ SG_GIT_COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null)
|
||||
SG_GIT_COMMIT_NUMS_SINCE_TAG := $(shell git rev-list --count HEAD ^`git describe --tags --abbrev=0 2>/dev/null` 2>/dev/null)
|
||||
SG_GIT_TREE_STATE := $(shell test -n "`git status --porcelain 2>/dev/null`" && echo "dirty" || echo "clean")
|
||||
|
||||
SG_PLUGIN_VERSION := $(shell grep -o '"VersionName": "[^"]*"' ${SG_PLUGIN_FILE} | awk -F'"' '{print "v" $$4}')
|
||||
SG_PLUGIN_VERSION := $(shell grep -o '"VersionName": "[^"]*"' ${SG_PLUGIN_FILE} | awk -F'"' '{print "v" $$4}')
|
||||
SG_HANDBOOK_SITE_URL := $(shell grep '^site-url' $(SG_HANDBOOK_CONFIG_FILE) | sed -n 's|^site-url = "/\(.*\)/"|\1|p')
|
||||
|
||||
ifeq ($(strip $(SG_GIT_COMMIT_NUMS_SINCE_TAG)),)
|
||||
SG_GIT_COMMIT_NUMS_SINCE_TAG := 0
|
||||
@@ -141,29 +143,25 @@ SG_BUILD_TIME := $(shell date '+%a %b %d, %Y %H:%M %Z %z')
|
||||
|
||||
ifeq ($(strip $(SG_GIT_BRANCH)),dev)
|
||||
ifeq ($(strip $(SG_GIT_VERSION)),)
|
||||
ifeq ($(strip $(SG_HANDBOOK_SITE_URL)),next)
|
||||
SG_HANDBOOK_REVISION := next
|
||||
endif # ($(strip $(SG_HANDBOOK_SITE_URL)),next)
|
||||
endif # ($(strip $(SG_GIT_VERSION)),)
|
||||
endif # ($(strip $(SG_GIT_BRANCH)),dev)
|
||||
|
||||
ifeq ($(strip $(SG_GIT_BRANCH)),HEAD)
|
||||
ifeq ($(strip $(SG_GIT_COMMIT_NUMS_SINCE_TAG)),0)
|
||||
ifeq ($(strip $(SG_GIT_TREE_STATE)),clean)
|
||||
ifeq ($(strip $(SG_GIT_VERSION)),$(strip $(SG_PLUGIN_VERSION)))
|
||||
SG_HANDBOOK_REVISION := SG_PLUGIN_VERSION_MAJOR.SG_PLUGIN_VERSION_MINOR
|
||||
endif # ($(strip $(SG_GIT_VERSION)),$(strip $(SG_PLUGIN_VERSION)))
|
||||
endif # ($(strip $(SG_GIT_TREE_STATE)),clean)
|
||||
endif # ($(strip $(SG_GIT_COMMIT_NUMS_SINCE_TAG)),0)
|
||||
endif # ($(strip $(SG_GIT_BRANCH)),HEAD)
|
||||
SG_IS_GIT_BRANCH_HEAD_OR_MASTER := $(or $(filter HEAD,$(strip $(SG_GIT_BRANCH))),$(filter master,$(strip $(SG_GIT_BRANCH))))
|
||||
|
||||
ifeq ($(strip $(SG_GIT_BRANCH)),master)
|
||||
ifeq ($(SG_IS_GIT_BRANCH_HEAD_OR_MASTER),1)
|
||||
ifeq ($(strip $(SG_GIT_COMMIT_NUMS_SINCE_TAG)),0)
|
||||
ifeq ($(strip $(SG_GIT_TREE_STATE)),clean)
|
||||
ifeq ($(strip $(SG_GIT_VERSION)),$(strip $(SG_PLUGIN_VERSION)))
|
||||
ifeq ($(strip $(SG_HANDBOOK_SITE_URL)),$(strip $(SG_PLUGIN_VERSION_MAJOR).$(SG_PLUGIN_VERSION_MINOR)))
|
||||
SG_HANDBOOK_REVISION := SG_PLUGIN_VERSION_MAJOR.SG_PLUGIN_VERSION_MINOR
|
||||
endif # ($(strip $(SG_HANDBOOK_SITE_URL)),$(strip $(SG_PLUGIN_VERSION_MAJOR).$(SG_PLUGIN_VERSION_MINOR)))
|
||||
endif # ($(strip $(SG_GIT_VERSION)),$(strip $(SG_PLUGIN_VERSION)))
|
||||
endif # ($(strip $(SG_GIT_TREE_STATE)),clean)
|
||||
endif # ($(strip $(SG_GIT_COMMIT_NUMS_SINCE_TAG)),0)
|
||||
endif # ($(strip $(SG_GIT_BRANCH)),master)
|
||||
endif # ($(SG_IS_GIT_BRANCH_HEAD_OR_MASTER),1)
|
||||
|
||||
ifeq ($(strip $(SG_HANDBOOK_REVISION)),)
|
||||
SG_HANDBOOK_REVISION := mismatched
|
||||
|
||||
Reference in New Issue
Block a user