Skip to content

Commit

Permalink
[rtemodel] Align implementation with specification (#1465)
Browse files Browse the repository at this point in the history
See Open-CMSIS-Pack/Open-CMSIS-Pack-Spec#307

**Note**: This changes both the RtePackage.cpp file, but also the pdsc
files used for testing, including something that looks like it was done
to ensure that the releases were sorted.

Contributed by STMicroelectronics

Signed-off-by: Torbjörn SVENSSON <[email protected]>
  • Loading branch information
Torbjorn-Svensson authored Apr 29, 2024
1 parent 5c7b148 commit 0f91a97
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
7 changes: 3 additions & 4 deletions libs/rtemodel/src/RtePackage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ void RteReleaseContainer::Construct()
{
string version;
for (auto release : GetChildren()) {
const string& releaseVersion = release->GetVersionString();
if (version.empty() || VersionCmp::Compare(releaseVersion, version) > 0) {
version = releaseVersion;
}
// First release XML node is the version of the package
version = release->GetVersionString();
break;
}
AddAttribute("version", version);
}
Expand Down
6 changes: 3 additions & 3 deletions test/packs/ARM/RteTest_DFP/0.1.1/ARM.RteTest_DFP.pdsc
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
<url>http://www.keil.com/pack/</url>

<releases>
<release version="0.1.0" date="2021-02-16">
Tag to check that the latest release item version is picked up even if it is below
</release>
<release version="0.1.1+metadata" date="2021-02-17">
Initial copy from ARM.CMSIS pack
</release>
<release version="0.1.0" date="2021-02-16">
Tag to check that the latest release item version is picked up even if it is below
</release>
</releases>

<taxonomy>
Expand Down
8 changes: 4 additions & 4 deletions test/packs/ARM/RteTest_DFP/0.2.0/ARM.RteTest_DFP.pdsc
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
<url>http://www.keil.com/pack/</url>

<releases>
<release version="0.1.0" date="2021-02-16">
Tag to check that the latest release item version is picked up even if it is below
<release version="0.2.0" date="2022-02-19">
Added a new device 'RteTest_ARMCM0_Dual'
</release>
<release version="0.1.1" date="2021-02-17">
Initial copy from ARM.CMSIS pack
</release>
<release version="0.2.0" date="2022-02-19">
Added a new device 'RteTest_ARMCM0_Dual'
<release version="0.1.0" date="2021-02-16">
Tag to check that the latest release item version is picked up even if it is below
</release>
</releases>
<taxonomy>
Expand Down

0 comments on commit 0f91a97

Please sign in to comment.