Răsfoiți Sursa

scripts: dist: patches do not deserve their own directory

Daniele Bartolini 3 luni în urmă
părinte
comite
0f471fb8d5
5 a modificat fișierele cu 28 adăugiri și 10 ștergeri
  1. 8 4
      scripts/dist/docs.sh
  2. 3 1
      scripts/dist/version.sh
  3. 8 2
      src/config.h
  4. 1 1
      src/device/device_options.cpp
  5. 8 2
      tools/config.vala

+ 8 - 4
scripts/dist/docs.sh

@@ -4,6 +4,8 @@
 
 set -eu
 
+. scripts/dist/version.sh
+
 if [ $# -gt 1 ]; then
 	echo "Usage: $0 [version]"
 	echo ""
@@ -13,8 +15,10 @@ fi
 VERSION=${1-}
 if [ -z "${VERSION}" ]; then
 	VERSION=$(git tag | tail -n 1)
+	VERSION_DIR=v$(crown_version_major).$(crown_version_minor).0
 elif [ "${VERSION}" = "master" ]; then
 	VERSION="master"
+	VERSION_DIR="master"
 else
 	echo "Invalid version name"
 	exit 1
@@ -37,9 +41,9 @@ make docs
 
 # Update gh-pages branch.
 git checkout gh-pages
-rm -r html/"${VERSION}"
-mkdir html/"${VERSION}"
-cp -r build/docs/html/* html/"${VERSION}"
+rm -r html/"${VERSION_DIR}"
+mkdir html/"${VERSION_DIR}"
+cp -r build/docs/html/* html/"${VERSION_DIR}"
 
 # Update 'latest' only in stable releases.
 if [ "${VERSION}" != "master" ]; then
@@ -50,5 +54,5 @@ if [ "${VERSION}" != "master" ]; then
 fi
 
 # Commit changes.
-git add html/"${VERSION}"
+git add html/"${VERSION_DIR}"
 git commit -m "Docs ${VERSION}"

+ 3 - 1
scripts/dist/version.sh

@@ -33,7 +33,9 @@ crown_set_version () {
 	sed -i "s/CROWN_VERSION_PATCH .*/CROWN_VERSION_PATCH ${3}/g" src/config.h
 
 	# Patch version string in config.vala
-	sed -i "s/CROWN_VERSION = \".*/CROWN_VERSION = \"${1}.${2}.${3}\";/g" tools/config.vala
+	sed -i "s/CROWN_VERSION_MAJOR = \".*/CROWN_VERSION_MAJOR = \"${1}\";/g" tools/config.vala
+	sed -i "s/CROWN_VERSION_MINOR = \".*/CROWN_VERSION_MINOR = \"${2}\";/g" tools/config.vala
+	sed -i "s/CROWN_VERSION_PATCH = \".*/CROWN_VERSION_PATCH = \"${3}\";/g" tools/config.vala
 }
 
 crown_docs_set_version () {

+ 8 - 2
src/config.h

@@ -11,8 +11,14 @@
 #define CROWN_VERSION_MINOR 60
 #define CROWN_VERSION_PATCH 0
 
-#define CROWN_VERSION CE_STRINGIZE(CROWN_VERSION_MAJOR) \
-	"." CE_STRINGIZE(CROWN_VERSION_MINOR)               \
+#define CROWN_FEATURES_VERSION CE_STRINGIZE(CROWN_VERSION_MAJOR) \
+	"." CE_STRINGIZE(CROWN_VERSION_MINOR)                        \
+
+#define CROWN_MANUAL_VERSION CE_STRINGIZE(CROWN_VERSION_MAJOR) \
+	"." CE_STRINGIZE(CROWN_VERSION_MINOR)                      \
+	".0"
+
+#define CROWN_VERSION CROWN_FEATURES_VERSION \
 	"." CE_STRINGIZE(CROWN_VERSION_PATCH)
 
 #ifndef CROWN_DEBUG

+ 1 - 1
src/device/device_options.cpp

@@ -51,7 +51,7 @@ static void help(const char *msg = NULL)
 		"  --string-id <string>            Prints the 32- and 64-bits IDs of <string>.\n"
 		"  --run-unit-tests                Run unit tests and quit.\n"
 		"\n"
-		"Full documentation at https://docs.crownengine.org/html/v" CROWN_VERSION "/reference/command_line.html\n"
+		"Full documentation at https://docs.crownengine.org/html/v" CROWN_MANUAL_VERSION "/reference/command_line.html\n"
 		);
 
 	if (msg)

+ 8 - 2
tools/config.vala

@@ -5,11 +5,17 @@
 
 namespace Crown
 {
-const string CROWN_VERSION = "0.60.0";
+const string CROWN_VERSION_MAJOR = "0";
+const string CROWN_VERSION_MINOR = "60";
+const string CROWN_VERSION_PATCH = "0";
+
+const string CROWN_FEATURES_VERSION = CROWN_VERSION_MAJOR + "." + CROWN_VERSION_MINOR;
+const string CROWN_MANUAL_VERSION = CROWN_FEATURES_VERSION + ".0";
+const string CROWN_VERSION = CROWN_FEATURES_VERSION + "." + CROWN_VERSION_PATCH;
 
 const string CROWN_WWW_URL = "https://www.crownengine.org";
 const string CROWN_DOCS_URL = "https://docs.crownengine.org";
-const string CROWN_LATEST_DOCS_URL = CROWN_DOCS_URL + "/html/v" + CROWN_VERSION;
+const string CROWN_LATEST_DOCS_URL = CROWN_DOCS_URL + "/html/v" + CROWN_MANUAL_VERSION;
 const string CROWN_LATEST_CHANGELOG_URL = CROWN_LATEST_DOCS_URL + "/changelog.html#changelog";
 const string CROWN_FUND_URL = CROWN_WWW_URL + "/fund";
 const string CROWN_CREDITS_URL = CROWN_WWW_URL + "/about/credits";