From 4bb759780fb0e293cb762b77f56adbd1e27fe11e Mon Sep 17 00:00:00 2001 From: vit9696 Date: Tue, 22 May 2018 00:43:34 +0300 Subject: [PATCH] Unify version scheme --- .gitignore | 2 ++ UEFIPatch/uefipatch.pro | 1 + UEFIPatch/uefipatch_main.cpp | 4 +++- UEFIReplace/uefireplace.pro | 3 ++- UEFIReplace/uefireplace_main.cpp | 4 +++- uefitool.cpp | 3 ++- uefitool.pro | 1 + unixbuild.sh | 12 +++++------- version.h | 19 +++++++++++++++++++ 9 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 version.h diff --git a/.gitignore b/.gitignore index c84a076..04fe0e1 100644 --- a/.gitignore +++ b/.gitignore @@ -238,3 +238,5 @@ UEFITool .qmake.stash UEFITool.app/ uefitool_plugin_import.cpp +DerivedData +*.xcodeproj diff --git a/UEFIPatch/uefipatch.pro b/UEFIPatch/uefipatch.pro index 5465b31..9e53160 100644 --- a/UEFIPatch/uefipatch.pro +++ b/UEFIPatch/uefipatch.pro @@ -36,6 +36,7 @@ HEADERS += uefipatch.h \ ../ffsengine.h \ ../treeitem.h \ ../treemodel.h \ + ../version.h \ ../LZMA/LzmaCompress.h \ ../LZMA/LzmaDecompress.h \ ../Tiano/EfiTianoDecompress.h \ diff --git a/UEFIPatch/uefipatch_main.cpp b/UEFIPatch/uefipatch_main.cpp index ff9177f..ee1c9c9 100644 --- a/UEFIPatch/uefipatch_main.cpp +++ b/UEFIPatch/uefipatch_main.cpp @@ -15,6 +15,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include + +#include "../version.h" #include "uefipatch.h" int main(int argc, char *argv[]) @@ -30,7 +32,7 @@ int main(int argc, char *argv[]) UINT32 argumentsCount = args.length(); if (argumentsCount < 2) { - std::cout << "UEFIPatch 0.3.15 - UEFI image file patching utility" << std::endl << std::endl << + std::cout << "UEFIPatch " PROGRAM_VERSION " - UEFI image file patching utility" << std::endl << std::endl << "Usage: UEFIPatch image_file [patches.txt] [-o output]" << std::endl << std::endl << "Patches will be read from patches.txt file by default\n"; return ERR_SUCCESS; diff --git a/UEFIReplace/uefireplace.pro b/UEFIReplace/uefireplace.pro index e3d853d..d63072b 100644 --- a/UEFIReplace/uefireplace.pro +++ b/UEFIReplace/uefireplace.pro @@ -36,7 +36,8 @@ HEADERS += uefireplace.h \ ../ffsengine.h \ ../treeitem.h \ ../treemodel.h \ + ../version.h \ ../LZMA/LzmaCompress.h \ ../LZMA/LzmaDecompress.h \ ../Tiano/EfiTianoDecompress.h \ - ../Tiano/EfiTianoCompress.h + ../Tiano/EfiTianoCompress.h \ No newline at end of file diff --git a/UEFIReplace/uefireplace_main.cpp b/UEFIReplace/uefireplace_main.cpp index 93c72ec..78baca4 100644 --- a/UEFIReplace/uefireplace_main.cpp +++ b/UEFIReplace/uefireplace_main.cpp @@ -14,6 +14,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include + +#include "../version.h" #include "uefireplace.h" int main(int argc, char *argv[]) @@ -28,7 +30,7 @@ int main(int argc, char *argv[]) QStringList args = a.arguments(); if (args.length() < 5) { - std::cout << "UEFIReplace 0.1.3 - UEFI image file replacement utility" << std::endl << std::endl << + std::cout << "UEFIReplace " PROGRAM_VERSION " - UEFI image file replacement utility" << std::endl << std::endl << "Usage: UEFIReplace image_file guid section_type contents_file [-o output] [-all] [-asis]" << std::endl; return ERR_SUCCESS; } diff --git a/uefitool.cpp b/uefitool.cpp index 9127e87..8813f60 100644 --- a/uefitool.cpp +++ b/uefitool.cpp @@ -11,13 +11,14 @@ */ +#include "version.h" #include "uefitool.h" #include "ui_uefitool.h" UEFITool::UEFITool(QWidget *parent) : QMainWindow(parent), ui(new Ui::UEFITool), -version(tr("0.24.0")) +version(tr(PROGRAM_VERSION)) { clipboard = QApplication::clipboard(); diff --git a/uefitool.pro b/uefitool.pro index 59f6c21..f17f30a 100644 --- a/uefitool.pro +++ b/uefitool.pro @@ -39,6 +39,7 @@ HEADERS += uefitool.h \ treemodel.h \ messagelistitem.h \ guidlineedit.h \ + version.h \ LZMA/LzmaCompress.h \ LZMA/LzmaDecompress.h \ Tiano/EfiTianoDecompress.h \ diff --git a/unixbuild.sh b/unixbuild.sh index 13a5559..d81df31 100755 --- a/unixbuild.sh +++ b/unixbuild.sh @@ -55,11 +55,9 @@ elif [ "$UPLATFORM" = "win32" ]; then export PATH="/c/Qt/5.6/mingw49_32_release_static/bin:$PATH" fi -echo "Attempting to build UEFITool NE for ${UPLATFORM}..." +echo "Attempting to build UEFITool for ${UPLATFORM}..." -UEFITOOL_VER=$(cat uefitool.cpp | grep ^version | cut -d'"' -f2) -UEFIPATCH_VER=$(cat UEFIPatch/uefipatch_main.cpp | grep '"UEFIPatch [0-9]' | cut -d'"' -f2 | cut -d' ' -f2) -UEFIREPLACE_VER=$(cat UEFIReplace/uefireplace_main.cpp | grep '"UEFIReplace [0-9]' | cut -d'"' -f2 | cut -d' ' -f2) +UEFITOOL_VER=$(cat version.h | grep PROGRAM_VERSION | cut -d'"' -f2) build_tool() { echo "Building $1 $2" @@ -113,8 +111,8 @@ build_tool() { rm -rf dist mkdir -p dist || exit 1 -build_tool UEFITool "$UEFITOOL_VER" uefitool.pro -build_tool UEFIPatch "$UEFIPATCH_VER" uefipatch.pro patches*.txt -build_tool UEFIReplace "$UEFIREPLACE_VER" uefireplace.pro +build_tool UEFITool "$UEFITOOL_VER" uefitool.pro +build_tool UEFIPatch "$UEFITOOL_VER" uefipatch.pro patches*.txt +build_tool UEFIReplace "$UEFITOOL_VER" uefireplace.pro exit 0 diff --git a/version.h b/version.h new file mode 100644 index 0000000..9d0a434 --- /dev/null +++ b/version.h @@ -0,0 +1,19 @@ +/* types.h + +Copyright (c) 2015, Nikolaj Schlej. All rights reserved. +This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +*/ + +#ifndef __VERSION_H__ +#define __VERSION_H__ + +#define PROGRAM_VERSION "0.25.0" + +#endif \ No newline at end of file