From 05d30818bb12fb877226ce284b9a3a41b971a889 Mon Sep 17 00:00:00 2001 From: Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com> Date: Sat, 1 Apr 2023 19:08:08 +0200 Subject: [PATCH] Bump to version 0.2.0 (#9) --- CMakeLists.txt | 2 +- README.md | 5 ++- fpm.toml | 5 +-- meson.build | 2 +- src/jonquil.f90 | 2 ++ src/jonquil/CMakeLists.txt | 1 + src/jonquil/meson.build | 1 + src/jonquil/version.f90 | 74 ++++++++++++++++++++++++++++++++++++++ 8 files changed, 85 insertions(+), 7 deletions(-) create mode 100644 src/jonquil/version.f90 diff --git a/CMakeLists.txt b/CMakeLists.txt index f96cc9a..5bfdc37 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ get_directory_property(is-subproject PARENT_DIRECTORY) project( "jonquil" LANGUAGES "Fortran" - VERSION "0.1.0" + VERSION "0.2.0" DESCRIPTION "Bringing TOML blooms to JSON land" ) diff --git a/README.md b/README.md index 4e465f4..bb51937 100644 --- a/README.md +++ b/README.md @@ -154,11 +154,10 @@ program demo end if block - use tomlf, only : toml_table, toml_array, add_array, set_value, toml_serializer + use tomlf, only : toml_table, toml_array, add_array, set_value, toml_serialize type(toml_table), pointer :: table type(toml_array), pointer :: array - type(toml_serializer) :: ser ! Add an array to the object call add_array(object, "c", array) @@ -169,7 +168,7 @@ program demo call set_value(table, "sub", "table") print '(a)', "# representation in TOML land" - call object%accept(ser) + print '(a)', toml_serialize(object) end block end program demo diff --git a/fpm.toml b/fpm.toml index f2738a4..5d3a762 100644 --- a/fpm.toml +++ b/fpm.toml @@ -1,15 +1,16 @@ name = "jonquil" -version = "0.1.0" +version = "0.2.0" license = "Apache-2.0 OR MIT" maintainer = ["@awvwgk"] author = ["Sebastian Ehlert"] copyright = "2022 Sebastian Ehlert" -homepage = "https://toml-f.readthedocs.io/en/latest/tutorial/json/" +homepage = "https://toml-f.readthedocs.io/en/latest/how-to/jonquil/" keywords = ["json", "io", "serde"] description = "Bringing TOML blooms to JSON land" [dependencies] toml-f.git = "https://github.com/toml-f/toml-f" +toml-f.tag = "v0.4.0" [[test]] name = "jqtest" diff --git a/meson.build b/meson.build index 016d3a6..aaf8edb 100644 --- a/meson.build +++ b/meson.build @@ -14,7 +14,7 @@ project( 'jonquil', 'fortran', - version: '0.1.0', + version: '0.2.0', license: 'Apache-2.0 OR MIT', meson_version: '>=0.55', default_options: [ diff --git a/src/jonquil.f90 b/src/jonquil.f90 index 4e243d9..caf6d0c 100644 --- a/src/jonquil.f90 +++ b/src/jonquil.f90 @@ -21,6 +21,8 @@ module jonquil & new_object => new_table, add_object => add_table, add_array, add_keyval, sort, len use tomlf_type, only : cast_to_object => cast_to_table, cast_to_array, cast_to_keyval use tomlf_version, only : tomlf_version_string, tomlf_version_compact, get_tomlf_version + use jonquil_version, only : jonquil_version_string, jonquil_version_compact, & + & get_jonquil_version use jonquil_parser, only : json_load, json_loads use jonquil_ser, only : json_serializer, json_serialize, json_dump, json_dumps, & & json_ser_config diff --git a/src/jonquil/CMakeLists.txt b/src/jonquil/CMakeLists.txt index 504b3f5..c0e0590 100644 --- a/src/jonquil/CMakeLists.txt +++ b/src/jonquil/CMakeLists.txt @@ -18,6 +18,7 @@ list( "${dir}/lexer.f90" "${dir}/parser.f90" "${dir}/ser.f90" + "${dir}/version.f90" ) set(srcs "${srcs}" PARENT_SCOPE) diff --git a/src/jonquil/meson.build b/src/jonquil/meson.build index 5849231..4e374da 100644 --- a/src/jonquil/meson.build +++ b/src/jonquil/meson.build @@ -15,4 +15,5 @@ srcs += files( 'lexer.f90', 'parser.f90', 'ser.f90', + 'version.f90', ) diff --git a/src/jonquil/version.f90 b/src/jonquil/version.f90 new file mode 100644 index 0000000..6fbf8f7 --- /dev/null +++ b/src/jonquil/version.f90 @@ -0,0 +1,74 @@ +! This file is part of jonquil. +! SPDX-Identifier: Apache-2.0 OR MIT +! +! Licensed under either of Apache License, Version 2.0 or MIT license +! at your option; you may not use this file except in compliance with +! the License. +! +! Unless required by applicable law or agreed to in writing, software +! distributed under the License is distributed on an "AS IS" BASIS, +! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +! See the License for the specific language governing permissions and +! limitations under the License. + +!> Version information on jonquil +module jonquil_version + implicit none + private + + public :: get_jonquil_version + public :: jonquil_version_string, jonquil_version_compact + + + !> String representation of the jonquil version + character(len=*), parameter :: jonquil_version_string = "0.4.0" + + !> Major version number of the above jonquil version + integer, parameter :: jonquil_major = 0 + + !> Minor version number of the above jonquil version + integer, parameter :: jonquil_minor = 4 + + !> Patch version number of the above jonquil version + integer, parameter :: jonquil_patch = 0 + + !> Compact numeric representation of the jonquil version + integer, parameter :: jonquil_version_compact = & + & jonquil_major*10000 + jonquil_minor*100 + jonquil_patch + + +contains + + +!> Getter function to retrieve jonquil version +subroutine get_jonquil_version(major, minor, patch, string) + + !> Major version number of the jonquil version + integer, intent(out), optional :: major + + !> Minor version number of the jonquil version + integer, intent(out), optional :: minor + + !> Patch version number of the jonquil version + integer, intent(out), optional :: patch + + !> String representation of the jonquil version + character(len=:), allocatable, intent(out), optional :: string + + if (present(major)) then + major = jonquil_major + end if + if (present(minor)) then + minor = jonquil_minor + end if + if (present(patch)) then + patch = jonquil_patch + end if + if (present(string)) then + string = jonquil_version_string + end if + +end subroutine get_jonquil_version + + +end module jonquil_version