Skip to content

Commit

Permalink
Check package.xml and CMakeLists.txt are the same
Browse files Browse the repository at this point in the history
Signed-off-by: Erik Boasson <[email protected]>
  • Loading branch information
eboasson committed Jan 10, 2022
1 parent 8e7fd85 commit af7de84
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .azure/templates/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#

steps:
- bash: bash versioncheck.bash
name: versioncheck
- task: UsePythonVersion@0
inputs:
versionSpec: '3.8'
Expand Down
12 changes: 12 additions & 0 deletions versioncheck.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
read pv < <(tr '\t' ' ' < package.xml | sed -ne 's;^ *<version> *\([0-9.][0-9.]*\) *</version>;\1;p')
read cv < <(tr '\t' ' ' < CMakeLists.txt | sed -ne 's;^ *project *( *CycloneDDS .*VERSION *\([0-9.][0-9.]*\)[ )].*;\1;p')
echo "package.xml version: $pv"
echo "CMakeLists.txt version: $cv"
if [[ -z "$pv" || -z "$cv" ]] ; then
echo "version extraction failed"
exit 1
fi
if [[ "$pv" != "$cv" ]] ; then
echo "version mismatch"
exit 1
fi

0 comments on commit af7de84

Please sign in to comment.