Skip to content

Commit

Permalink
add qarchive version string, add bump_version script
Browse files Browse the repository at this point in the history
  • Loading branch information
antony-jr committed Dec 10, 2023
1 parent 5421796 commit 1e3e477
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# ---

CMAKE_MINIMUM_REQUIRED( VERSION 3.17)
project(QArchive VERSION 2.2.7)
project(QArchive VERSION 2.2.8)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project(
'QArchive',
'cpp',
version: '2.2.7',
version: '2.2.8',
license: 'BSD-3-Clause',
default_options: ['cpp_std=c++17'],
meson_version: '>=0.49.0',
Expand Down
17 changes: 17 additions & 0 deletions other/cmake/config.h.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
#ifndef CONFIG_H_QARCHIVE_INCLUDED
#define CONFIG_H_QARCHIVE_INCLUDED
#cmakedefine QARCHIVE_STATIC

#ifndef QARCHIVE_VERSION_STR
# define QARCHIVE_VERSION_STR "@PROJECT_VERSION@"
#endif

#ifndef QARCHIVE_VERSION_MAJOR
# define QARCHIVE_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
#endif

#ifndef QARCHIVE_VERSION_MINOR
# define QARCHIVE_VERSION_MINOR @PROJECT_VERSION_MINOR@
#endif

#ifndef QARCHIVE_VERSION_PATCH
# define QARCHIVE_VERSION_PATCH @PROJECT_VERSION_PATCH@
#endif

#endif

37 changes: 37 additions & 0 deletions scripts/bump_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash

echo "Bump Version, Simple Script to Bump QArchive Version"
echo "Copyright (c) 2023-Preset, D. Antony J.R <[email protected]>"
echo ""

if [[ -z "$QARCHIVE_VERSION" ]] then
echo "QARCHIVE_VERSION not set, giving up."
exit -1
fi

echo QARCHIVE_VERSION=$QARCHIVE_VERSION

sed -i 's/QArchive VERSION .*/QArchive VERSION '$QARCHIVE_VERSION'\)/' CMakeLists.txt
sed -i "s/ version: .*/ version: '$QARCHIVE_VERSION',/" meson.build

cat > /tmp/qarchive.commit.template.txt << EOF
[Release $QARCHIVE_VERSION] QArchive v$QARCHIVE_VERSION release
#Changelog
* Change 1
* Change 2
Signed-off-by: Divya Antony J R <[email protected]>
EOF

git add -A
git status

read -p "Do you want to commit? press any key to continue..."

git commit -S -t /tmp/qarchive.commit.template.txt

rm -rf /tmp/qarchive.commit.template.txt

echo "Please run 'git push origin master' to release."
3 changes: 2 additions & 1 deletion scripts/write_conan.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def configure(self):
self.requires("zstd/1.5.5")
self.options["qt"].shared = {}
self.options["libarchive"].shared = {}
self.options["libarchive"].with_lz4 = True
self.options["libarchive"].with_lzo = True
self.options["libarchive"].with_lzma = True
Expand All @@ -43,7 +44,7 @@ def configure(self):
print("QARCHIVE_VERSION: {}".format(qarchive_version))

fp = open('conanfile.py', 'wt')
fp.write(contents.format(qarchive_version, qt_version, build_shared))
fp.write(contents.format(qarchive_version, qt_version, build_shared, build_shared))
fp.close()

print("\nFile Written.")

0 comments on commit 1e3e477

Please sign in to comment.