Skip to content

Commit

Permalink
Update version scheme to YY.MM, drop the long time used major version 4.
Browse files Browse the repository at this point in the history
  • Loading branch information
zufuliu committed May 26, 2024
1 parent 7f05586 commit 4fdbd93
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 36 deletions.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '4.24.x.{build}'
version: '24.x.{build}'

image:
- Visual Studio 2017
Expand Down
11 changes: 2 additions & 9 deletions build/BuildAll.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,7 @@ def zip_folder_inner(folder, output):
print('make zip fail:', retcode, os.path.basename(output))

def get_app_version():
major, minor, build, reversion = ['']*4
path = os.path.join(buildFolder, '../src/Version.h')
with open(path, encoding='utf-8') as fd:
for line in fd.read().splitlines():
if line.startswith('#define VERSION_MAJOR'):
major = line.split()[2]
break

minor, build, reversion = ['']*3
path = os.path.join(buildFolder, '../src/VersionRev.h')
with open(path, encoding='utf-8') as fd:
for line in fd.read().splitlines():
Expand All @@ -122,7 +115,7 @@ def get_app_version():
build = value
elif key == 'VERSION_REV':
reversion = value
return f'v{major}.{minor}.{build}r{reversion}'
return f'v{minor}.{build}r{reversion}'

def prepare_build_environment():
app_version = get_app_version()
Expand Down
4 changes: 1 addition & 3 deletions build/make_zip.bat
Original file line number Diff line number Diff line change
Expand Up @@ -241,16 +241,14 @@ EXIT /B

:SubGetVersion
rem Get the version
FOR /F "tokens=3,4" %%K IN (
'FINDSTR /I /L /C:"define VERSION_MAJOR" "..\src\Version.h"') DO (SET "VerMajor=%%K")
FOR /F "tokens=3,4" %%K IN (
'FINDSTR /I /L /C:"define VERSION_MINOR" "..\src\VersionRev.h"') DO (SET "VerMinor=%%K")
FOR /F "tokens=3,4" %%K IN (
'FINDSTR /I /L /C:"define VERSION_BUILD" "..\src\VersionRev.h"') DO (SET "VerBuild=%%K")
FOR /F "tokens=3,4" %%K IN (
'FINDSTR /I /L /C:"define VERSION_REV " "..\src\VersionRev.h"') DO (SET "VerRev=%%K")

SET NP2_VER=v%VerMajor%.%VerMinor%.%VerBuild%r%VerRev%
SET NP2_VER=v%VerMinor%.%VerBuild%r%VerRev%
EXIT /B


Expand Down
2 changes: 1 addition & 1 deletion doc/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
| zh-Hans | 中文 (简体) | Win32 | 🟠legacy Windows XP, Server 2003 |
| zh-Hant | 中文 (繁體) |
| i18n | all above languages include French | winget | `winget install -e "Notepad4"` |
| 한국어 | https://teus.me/category/IT/Notepad2 | winget | `winget install zufuliu.notepad4` |
| 한국어 | https://teus.me/Notepad4 | winget | `winget install zufuliu.notepad4` |

Latest development builds (artifacts in Release configuration for each compiler and platform) are available at https://github.com/zufuliu/notepad4/actions and https://ci.appveyor.com/project/zufuliu/notepad4.
2 changes: 1 addition & 1 deletion matepath/res/matepath.exe.manifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity name="matepath" processorArchitecture="*" version="4.24.05.5242" type="win32"/>
<assemblyIdentity name="matepath" processorArchitecture="*" version="24.05.0.5252" type="win32"/>
<description>matepath File Browser</description>
<dependency>
<dependentAssembly>
Expand Down
6 changes: 3 additions & 3 deletions matepath/src/VersionRev.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#define VERSION_MINOR 24
#define VERSION_BUILD_NUM 5
#define VERSION_BUILD 05
#define VERSION_HASH TEXT("8a997c12")
#define VERSION_REV 5242
#define VERSION_REV_FULL TEXT("r5242 (8a997c12)")
#define VERSION_HASH TEXT("7f055869")
#define VERSION_REV 5252
#define VERSION_REV_FULL TEXT("r5252 (7f055869)")
8 changes: 3 additions & 5 deletions matepath/src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@
#define DO_STRINGIFY(x) TEXT(#x)
#define STRINGIFY(x) DO_STRINGIFY(x)

#define VERSION_MAJOR 4

#define MY_APPNAME L"matepath"
#define MY_APPNAME_DESCRIPTION L"matepath File Browser"
#define VERSION_FILEVERSION_NUM VERSION_MAJOR,VERSION_MINOR,VERSION_BUILD_NUM,VERSION_REV
#define VERSION_FILEVERSION STRINGIFY(VERSION_MAJOR) "." STRINGIFY(VERSION_MINOR) "." \
#define VERSION_FILEVERSION_NUM VERSION_MINOR,VERSION_BUILD_NUM,0,VERSION_REV
#define VERSION_FILEVERSION STRINGIFY(VERSION_MINOR) "." \
STRINGIFY(VERSION_BUILD) "." STRINGIFY(VERSION_REV)
#define VERSION_LEGALCOPYRIGHT L"\xA9 2011-2024 Zufu Liu and all contributors"
#define VERSION_COMPANYNAME L"Zufu Liu et al."
Expand Down Expand Up @@ -91,6 +89,6 @@
#define VERSION_FILEVERSION_ARCH L" (32-bit) "
#endif
#endif
#define VERSION_FILEVERSION_LONG MY_APPNAME VERSION_FILEVERSION_ARCH STRINGIFY(VERSION_MAJOR) L"." \
#define VERSION_FILEVERSION_LONG MY_APPNAME VERSION_FILEVERSION_ARCH \
STRINGIFY(VERSION_MINOR) L"." STRINGIFY(VERSION_BUILD) \
L" " VERSION_REV_FULL
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,5 +200,5 @@ Latest development builds (artifacts in Release configuration for each compiler
* [中文 (繁體)](https://github.com/zufuliu/notepad4/tree/main/locale/zh-Hant)
* [中文 (简体)](https://github.com/zufuliu/notepad4/tree/main/locale/zh-Hans)
* [한국어](https://github.com/zufuliu/notepad4/tree/main/locale/ko) by [@VenusGirl](https://github.com/VenusGirl)
* [한국어](https://teus.me/category/IT/Notepad2) by [@bluenlive](https://github.com/bluenlive)
* [한국어](https://teus.me/Notepad4) by [@bluenlive](https://github.com/bluenlive)
* [Notepad4 Wiki](https://github.com/zufuliu/notepad4/wiki)
2 changes: 1 addition & 1 deletion res/Notepad4.exe.manifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity name="Notepad4" processorArchitecture="*" version="4.24.05.5242" type="win32"/>
<assemblyIdentity name="Notepad4" processorArchitecture="*" version="24.05.0.5252" type="win32"/>
<description>Notepad4 Text Editor</description>
<dependency>
<dependentAssembly>
Expand Down
8 changes: 3 additions & 5 deletions src/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@
#define DO_STRINGIFY(x) TEXT(#x)
#define STRINGIFY(x) DO_STRINGIFY(x)

#define VERSION_MAJOR 4

#define MY_APPNAME L"Notepad4"
#define MY_APPNAME_DESCRIPTION L"Notepad4 Text Editor"
#define VERSION_FILEVERSION_NUM VERSION_MAJOR,VERSION_MINOR,VERSION_BUILD_NUM,VERSION_REV
#define VERSION_FILEVERSION STRINGIFY(VERSION_MAJOR) "." STRINGIFY(VERSION_MINOR) "." \
#define VERSION_FILEVERSION_NUM VERSION_MINOR,VERSION_BUILD_NUM,0,VERSION_REV
#define VERSION_FILEVERSION STRINGIFY(VERSION_MINOR) "." \
STRINGIFY(VERSION_BUILD) "." STRINGIFY(VERSION_REV)
#define VERSION_LEGALCOPYRIGHT L"\xA9 2011-2024 Zufu Liu and all contributors"
#define VERSION_COMPANYNAME L"Zufu Liu et al."
Expand Down Expand Up @@ -94,6 +92,6 @@
#define VERSION_FILEVERSION_ARCH L" (32-bit) "
#endif
#endif
#define VERSION_FILEVERSION_LONG MY_APPNAME VERSION_FILEVERSION_ARCH STRINGIFY(VERSION_MAJOR) L"." \
#define VERSION_FILEVERSION_LONG MY_APPNAME VERSION_FILEVERSION_ARCH \
STRINGIFY(VERSION_MINOR) L"." STRINGIFY(VERSION_BUILD) \
L" " VERSION_REV_FULL
6 changes: 3 additions & 3 deletions src/VersionRev.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#define VERSION_MINOR 24
#define VERSION_BUILD_NUM 5
#define VERSION_BUILD 05
#define VERSION_HASH TEXT("8a997c12")
#define VERSION_REV 5242
#define VERSION_REV_FULL TEXT("r5242 (8a997c12)")
#define VERSION_HASH TEXT("7f055869")
#define VERSION_REV 5252
#define VERSION_REV_FULL TEXT("r5252 (7f055869)")
5 changes: 2 additions & 3 deletions version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ if [[ ! -f "$versionfile" ]] || [[ "$version_info" != "$(<"$versionfile")" ]]; t
fi

# Update manifest file if version information was changed.
base_ver="4"
new_ver="`date +%y.%m`.${ver}"
base_ver="[0-9][0-9]"
new_ver="`date +%m`.0.${ver}"
newmanifest="$(sed -Ee "0,/(${base_ver}\.)([0-9.]+)/s//\1${new_ver}/g" "$manifestfile")"
if [[ "$newmanifest" != "$(<"$manifestfile")" ]]; then
# Update the revision number in the manifest file
Expand All @@ -104,7 +104,6 @@ if [[ $# -ne 0 ]]; then
echo "$version_info" > "$versionfile"
fi

base_ver="4"
newmanifest="$(sed -Ee "0,/(${base_ver}\.)([0-9.]+)/s//\1${new_ver}/g" "$manifestfile")"
if [[ "$newmanifest" != "$(<"$manifestfile")" ]]; then
echo "$newmanifest" > "$manifestfile"
Expand Down

0 comments on commit 4fdbd93

Please sign in to comment.