diff --git a/Cargo.toml b/Cargo.toml index 77ac8431..4191e473 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "libloot" -version = "0.27.0" -edition = "2024" -license = "GPL-3.0-or-later" +version.workspace = true +edition.workspace = true +license.workspace = true [dependencies] crc32fast = "1.5.0" @@ -30,6 +30,11 @@ workspace = true [workspace] members = ["cpp", "ffi-errors", "nodejs", "parameterized-test", "python"] +[workspace.package] +version = "0.27.0" +edition = "2024" +license = "GPL-3.0-or-later" + [profile.release] debug = "limited" lto = "thin" diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 2b7eae04..c01cf45c 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -5,7 +5,7 @@ endif() if(POLICY CMP0167) cmake_policy(SET CMP0167 NEW) endif() -project(libloot) +project(libloot VERSION "0.27.0") include(ExternalProject) include(FetchContent) include(CMakeDependentOption) @@ -253,11 +253,9 @@ endif() add_library(libloot::loot ALIAS loot) if(LIBLOOT_BUILD_SHARED) - set(LIBLOOT_VERSION "0.27.0") - - set_property(TARGET loot PROPERTY VERSION ${LIBLOOT_VERSION}) - set_property(TARGET loot PROPERTY SOVERSION 0) - set_property(TARGET loot PROPERTY INTERFACE_libloot_MAJOR_VERSION 0) + set_property(TARGET loot PROPERTY VERSION ${libloot_VERSION}) + set_property(TARGET loot PROPERTY SOVERSION ${libloot_VERSION_MAJOR}) + set_property(TARGET loot PROPERTY INTERFACE_libloot_MAJOR_VERSION ${libloot_VERSION_MAJOR}) set_property(TARGET loot APPEND PROPERTY COMPATIBLE_INTERFACE_STRING libloot_MAJOR_VERSION) configure_package_config_file( @@ -268,7 +266,7 @@ if(LIBLOOT_BUILD_SHARED) write_basic_package_version_file( "${PROJECT_BINARY_DIR}/liblootConfigVersion.cmake" - VERSION "${LIBLOOT_VERSION}" + VERSION "${libloot_VERSION}" COMPATIBILITY AnyNewerVersion ) diff --git a/cpp/Cargo.toml b/cpp/Cargo.toml index 5da06d04..0dafe19b 100644 --- a/cpp/Cargo.toml +++ b/cpp/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "libloot-cpp" -version = "0.27.0" -edition = "2024" -license = "GPL-3.0-or-later" +version.workspace = true +edition.workspace = true +license.workspace = true [dependencies] cxx = { version = "1.0", features = ["c++17"] } diff --git a/ffi-errors/Cargo.toml b/ffi-errors/Cargo.toml index e50de3a9..aafac17e 100644 --- a/ffi-errors/Cargo.toml +++ b/ffi-errors/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "libloot-ffi-errors" -version = "0.27.0" -edition = "2024" -license = "GPL-3.0-or-later" +version.workspace = true +edition.workspace = true +license.workspace = true [lints] workspace = true diff --git a/nodejs/Cargo.toml b/nodejs/Cargo.toml index f537da1a..438c55bb 100644 --- a/nodejs/Cargo.toml +++ b/nodejs/Cargo.toml @@ -1,8 +1,8 @@ [package] -edition = "2021" name = "libloot-nodejs" -version = "0.27.0" -license = "GPL-3.0-or-later" +version.workspace = true +edition = "2021" +license.workspace = true [lib] crate-type = ["cdylib"] diff --git a/parameterized-test/Cargo.toml b/parameterized-test/Cargo.toml index e4fea0f3..8d639844 100644 --- a/parameterized-test/Cargo.toml +++ b/parameterized-test/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "parameterized-test" -version = "0.27.0" -edition = "2024" +version.workspace = true +edition.workspace = true license = "MIT" [dependencies] diff --git a/python/Cargo.toml b/python/Cargo.toml index 2625164e..102fffeb 100644 --- a/python/Cargo.toml +++ b/python/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "libloot-python" -version = "0.27.0" -edition = "2024" -license = "GPL-3.0-or-later" +version.workspace = true +edition.workspace = true +license.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lib] diff --git a/scripts/set_version_number.py b/scripts/set_version_number.py index eb15e788..0bd57bb8 100644 --- a/scripts/set_version_number.py +++ b/scripts/set_version_number.py @@ -31,11 +31,7 @@ def update_resource_file(path, version): replace_in_file(path, 'Version", "\\d+\\.\\d+\\.\\d+"', 'Version", "{}"'.format(version)) def update_cmakelists(path, version): - version_parts = version.split('.') - - replace_in_file(path, 'set\\(LIBLOOT_VERSION "\\d+\\.\\d+\\.\\d+"\\)', 'set(LIBLOOT_VERSION "{}")'.format(version)) - replace_in_file(path, 'TARGET loot PROPERTY SOVERSION \\d+', 'TARGET loot PROPERTY SOVERSION {}'.format(version_parts[0])) - replace_in_file(path, 'INTERFACE_libloot_MAJOR_VERSION \\d+', 'INTERFACE_libloot_MAJOR_VERSION {}'.format(version_parts[0])) + replace_in_file(path, 'project\\(libloot VERSION "\\d+\\.\\d+\\.\\d+"\\)', 'project(libloot VERSION "{}")'.format(version)) def update_cargo_toml(path, version): replace_in_file(path, '^version = "\\d+\\.\\d+\\.\\d+"$', 'version = "{}"'.format(version)) @@ -60,14 +56,9 @@ if __name__ == "__main__": update_cmakelists(os.path.join('cpp', 'CMakeLists.txt'), arguments.version[0]) update_cargo_toml('Cargo.toml', arguments.version[0]) - update_cargo_toml(os.path.join('cpp', 'Cargo.toml'), arguments.version[0]) - update_cargo_toml(os.path.join('ffi-errors', 'Cargo.toml'), arguments.version[0]) - update_cargo_toml(os.path.join('nodejs', 'Cargo.toml'), arguments.version[0]) - update_cargo_toml(os.path.join('parameterized-test', 'Cargo.toml'), arguments.version[0]) - update_cargo_toml(os.path.join('python', 'Cargo.toml'), arguments.version[0]) # update_cargo_toml also works for pyproject.toml - update_cargo_toml(os.path.join('cpp', 'docs', 'pyproject.toml'), arguments.version[0]) + update_cargo_toml(os.path.join('docs', 'pyproject.toml'), arguments.version[0]) update_package_json(os.path.join('nodejs', 'package.json'), arguments.version[0]) update_package_json(os.path.join('nodejs', 'npm', 'linux-x64-gnu', 'package.json'), arguments.version[0])