diff --git a/.azure/templates/build-test.yml b/.azure/templates/build-test.yml index 065eabc0b9..4fb6df11dd 100644 --- a/.azure/templates/build-test.yml +++ b/.azure/templates/build-test.yml @@ -15,6 +15,8 @@ # steps: + - bash: bash versioncheck.bash + name: versioncheck - task: UsePythonVersion@0 inputs: versionSpec: '3.8' diff --git a/versioncheck.bash b/versioncheck.bash new file mode 100644 index 0000000000..af131d7853 --- /dev/null +++ b/versioncheck.bash @@ -0,0 +1,12 @@ +read pv < <(tr '\t' ' ' < package.xml | sed -ne 's;^ * *\([0-9.][0-9.]*\) *;\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