Skip to content

Commit

Permalink
Feature 1.2 (#51)
Browse files Browse the repository at this point in the history
* Updated to rexs version 1.6

* Updated thirdparty dependencies

* Added references to external rexs files
  • Loading branch information
fuersten authored Apr 5, 2024
1 parent d5699c2 commit e5bccf1
Show file tree
Hide file tree
Showing 101 changed files with 17,957 additions and 637 deletions.
54 changes: 22 additions & 32 deletions .github/workflows/build_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
workflow_dispatch:

env:
CMAKE_VERSION: 3.16.3
CMAKE_VERSION: 3.22

jobs:
build-linux:
Expand All @@ -21,11 +21,11 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
os: [ubuntu-22.04]
build_type: [Debug, Release]
cxx: [g++, g++-10, clang++-10]
cxx: [g++, clang++-15]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get install ${{ matrix.cxx }} ninja-build lcov doxygen
- name: Check Coverage
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
genhtml coverage_filtered.info --output-directory html
- name: Archive code coverage results
if: ${{ env.COVERAGE == 'ON' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: html
Expand All @@ -85,9 +85,9 @@ jobs:
echo "VERSION=$version" >> "$GITHUB_ENV"
- name: Upload rexsapi package
if: ${{ matrix.build_type == 'Release' && matrix.cxx == 'g++' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: rexsapi-${{env.VERSION}}
name: rexsapi-linux-${{env.VERSION}}
path: build/rexsapi-linux-*.zip

build-macos:
Expand All @@ -96,10 +96,10 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-11]
os: [macos-12]
build_type: [Debug, Release]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: brew install doxygen
- name: Configure
Expand All @@ -120,9 +120,9 @@ jobs:
echo "VERSION=$version" >> "$GITHUB_ENV"
- name: Upload rexsapi package
if: ${{ matrix.build_type == 'Release' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: rexsapi-${{env.VERSION}}
name: rexsapi-darwin-${{env.VERSION}}
path: build/rexsapi-darwin-*.zip

build-windows:
Expand All @@ -131,10 +131,10 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-2019]
os: [windows-2022]
build_type: [Debug, Release]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: choco install doxygen.install
- name: Configure
Expand Down Expand Up @@ -168,46 +168,36 @@ jobs:
shell: python
- name: Upload rexsapi package
if: ${{ matrix.build_type == 'Release' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: rexsapi-${{env.VERSION}}
name: rexsapi-windows-${{env.VERSION}}
path: build/rexsapi-*.zip

create_release:
permissions: write-all
name: Create release
if: startsWith( github.ref, 'refs/tags/')
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: [build-linux, build-windows, build-macos]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Extract release notes
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v1
uses: ffurrer2/extract-release-notes@v2
with:
changelog_file: CHANGELOG.md
- name: Get release name
run: |
version=$(grep "project(" CMakeLists.txt | cut -d ' ' -f3)
echo "VERSION=$version" >> "$GITHUB_ENV"
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create release
id: create_release
uses: thomaseizinger/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: ncipollo/release-action@v1
with:
name: ${{ github.ref_name }}
body: ${{ steps.extract-release-notes.outputs.release_notes }}
prerelease: false
draft: false
- name: Upload release artifacts
uses: pyTooling/Actions/releaser@r0
with:
tag: ${{ github.ref }}
rm: true
token: ${{ secrets.GITHUB_TOKEN }}
files: |
./artifacts/rexsapi-${{env.VERSION}}/rexsapi-*.zip
artifacts: "./artifacts/rexsapi-*/rexsapi-*.zip"
removeArtifacts: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ build_xcode
check_loc.sh
ignore_files.txt
CMakeSettings.json
docker
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,37 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.0]

### Fixed

- Fixed README.md
- Fixed doxygen docu regarding brief description not rendering correctly in Visual Studio (#25)

### Changed

- Updated thirdparty components (#26)
- Upgraded cmake version to 3.22 (#27)
- Upgraded github CI os and compiler (#27)
- Upgraded github CI actions (#28)
- Except for the TModelInfo all other TModel constructor parameters have to be forcibly moved now
- The rexsapi tools currently do not support the resolving of external component references and should be
used with --mode-relaxed if references lead to problems
- TModelLoader now takes an optional TDataSourceResolver to resolve external component references (#31)
- Analogous to the TModelLoader, TJsonModelLoader and TXMLModelLoader also take an optional TDataSourceResolver

### Added

- External ids will be used for better error messages for easier finding a specific erroneous component in a
model file (#2)
- Components can have an external id, which represents exactly the components id specified in a model file (#4)
- Added model database file for 1.6 models (#30)
- References into external data sources can now be used for REXS models >= version 1.5 (#31)
- External sub components checker (#31)
- New check method for main components to TRelationTypeChecker (#36)
- TModelMerger to merge multiple TModel instances into a new instance (#36)
- The TModelBuilder can now use user supplied integers as ids

## [1.1.0]

### Changed
Expand All @@ -14,6 +45,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- The model registry can be configured to load the latest available model version, if the requested version is not
known. If no appropriate language can be found, english will be chosen. (#8)
- In relaxed mode latest available model version loading will be active (#8)
- Added model database file for 1.5 models (#12)
- Added new date_time data type (#20)
- Updated all thirdparty components (#7)
- Add changelog to the package (#16)

Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.16)
project(rexsapi VERSION 1.1.0 LANGUAGES CXX)
cmake_minimum_required(VERSION 3.22)
project(rexsapi VERSION 2.0.0 LANGUAGES CXX)

include(FetchContent)

Expand Down
28 changes: 15 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![Supported Platforms](https://img.shields.io/badge/platforms-Linux%20%7C%20Windows%20%7C%20Mac-blue.svg)
![License: Apache 2](https://img.shields.io/badge/license-Apache%202-blue)
![Language: C++17](https://img.shields.io/badge/language-C%2B%2B17-blue.svg)
![Version:](https://img.shields.io/badge/version-1.1.0-green)
![Version:](https://img.shields.io/badge/version-2.2.0-green)
[![GitHub Build Status](https://github.com/fva-net/rexs-api-cpp/workflows/CMake%20Build%20Matrix/badge.svg)](https://github.com/fva-net/rexs-api-cpp/actions)
[![Coverage Status](https://coveralls.io/repos/github/BearinxSimulationSuite/REXSapi/badge.svg?branch=main)](https://coveralls.io/github/BearinxSimulationSuite/REXSapi?branch=main)

Expand All @@ -15,7 +15,7 @@ The project is now released and is already used in production. However, the API

# Supported REXS Versions

The library uses REXS database model files in order to validate REXS model files. Database model files can be downloaded from the [REXS database page](https://database.rexs.info/). Currently, the implementation supports versions 1.0 to 1.5, but newer database files should also work. Version 1.0 to 1.5 database model files in english and german can also be found in the models directory of this project.
The library uses REXS database model files in order to validate REXS model files. Database model files can be downloaded from the [REXS database page](https://database.rexs.info/). Currently, the implementation supports versions 1.0 to 1.6, but newer database files should also work. Version 1.0 to 1.6 database model files in english and german can also be found in the models directory of this project.

The library supports REXS model files in xml and json format. Compressed REXS zip archives can also be loaded. The loading and storing mechanism can be easily extended to support other sources besides files for model loading and storing.

Expand Down Expand Up @@ -101,7 +101,7 @@ modelBuilder.addRelation(rexsapi::TRelationType::SIDE)

... [more relations]

auto model = modelBuilder.build("REXSApi Model Builder", "1.0", "en");
auto model = modelBuilder.build("REXSApi Model Builder", "1.2", "en");
```
First you add components and attributes to the model. The last added component or attribute are the so called active component or attribute. All following method calls always affect the currently active component or attribute. The same is true for relations. Attributes need real C++ types as values.
Expand Down Expand Up @@ -156,6 +156,7 @@ File ".FVA-Industriegetriebe_2stufig_1-4.rexs" processed with 10 warnings
The `model_converter` can convert REXS model files between xml and json format. Files can be converted in any direction, even into the same format. You can convert complete directories with one go. As with the `model_checker`, the tool supports a relaxed mode for loading non-standard complying model files. If files do not conform to the standard, converting them may result in removed elements.

### Options

| Option | Description |
|:--|:--|
| --help, -h | Show usage and options |
Expand Down Expand Up @@ -230,7 +231,7 @@ include(FetchContent)
FetchContent_Declare(
rexsapi
GIT_REPOSITORY https://github.com/fva-net/rexs-api-cpp.git
GIT_TAG origin/v1.0.0
GIT_TAG origin/v1.1.0
)
FetchContent_MakeAvailable(rexsapi)
Expand All @@ -247,8 +248,9 @@ The library is header only. A build is only necessary if you want to run the tes
## Linux

- You will need the following software packages
- g++ 9.3.0 or higher
- cmake 3.16.3 or higher
- g++ 11.4.0 or higher
- clang 15.0.7 or higher
- cmake 3.22 or higher
- To install the dependencies on ubuntu
- Call `sudo apt-get install cmake g++`
- Create a build directory in the source directory of REXSapi and change to it
Expand All @@ -260,15 +262,15 @@ The library is header only. A build is only necessary if you want to run the tes
## Windows

- You will need the following software packages
- Visual Studio 2019 or higher
- CMake support is build into Visual Studio 2019
- Visual Studio 2022 or higher
- CMake support is build into Visual Studio 2022
- Open the local folder of the REXSapi project
- Visual Studio will configure the project automatically

## Mac
- You will need the following software packages
- XCode 12.4 or higher
- cmake 3.16.3 or higher
- cmake 3.22 or higher
- To install cmake on Mac
- Call `brew install cmake`
- Create a build directory in the source directory of REXSapi and change to it
Expand All @@ -281,14 +283,14 @@ The library is header only. A build is only necessary if you want to run the tes

REXSapi uses the following thirdparty open source software

- [cli11 2.3.2](https://github.com/CLIUtils/CLI11)
- [cli11 2.4.1](https://github.com/CLIUtils/CLI11)
- [date 3.0.1](https://github.com/HowardHinnant/date)
- [doctest 2.4.10](https://github.com/doctest/doctest)
- [fmt 9.1.0](https://github.com/fmtlib/fmt)
- [fmt 10.2.1](https://github.com/fmtlib/fmt)
- [nlohmann json 3.11.2](https://github.com/nlohmann/json)
- [miniz 3.0.2](https://github.com/richgel999/miniz)
- [pugixml 1.13](https://github.com/zeux/pugixml)
- [valijson 1.0](https://github.com/tristanpenman/valijson)
- [pugixml 1.14](https://github.com/zeux/pugixml)
- [valijson 1.0.2](https://github.com/tristanpenman/valijson)

# License
REXsapi is licensed under the Apache-2.0 license.
Expand Down
2 changes: 1 addition & 1 deletion cmake/fetch_cli11.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FetchContent_Declare(
cli11
URL https://github.com/CLIUtils/CLI11/archive/refs/tags/v2.3.2.tar.gz
URL https://github.com/CLIUtils/CLI11/archive/refs/tags/v2.4.1.tar.gz
)

FetchContent_MakeAvailable(cli11)
2 changes: 1 addition & 1 deletion cmake/fetch_fmt.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FetchContent_Declare(
fmt
URL https://github.com/fmtlib/fmt/archive/refs/tags/9.1.0.tar.gz
URL https://github.com/fmtlib/fmt/archive/refs/tags/10.2.1.tar.gz
)

FetchContent_GetProperties(fmt)
Expand Down
2 changes: 1 addition & 1 deletion cmake/fetch_pugixml.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FetchContent_Declare(
pugixml
GIT_REPOSITORY https://github.com/zeux/pugixml
GIT_TAG v1.13
GIT_TAG v1.14
)

if(NOT pugixml_POPULATED)
Expand Down
2 changes: 1 addition & 1 deletion cmake/fetch_valijson.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FetchContent_Declare(
valijson
URL https://github.com/tristanpenman/valijson/archive/refs/tags/v1.0.tar.gz
URL https://github.com/tristanpenman/valijson/archive/refs/tags/v1.0.2.tar.gz
)

FetchContent_GetProperties(valijson)
Expand Down
Loading

0 comments on commit e5bccf1

Please sign in to comment.