aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru N. Onea <alexandru.onea@harman.com>2019-04-11 12:56:54 +0300
committerAlexandru N. Onea <alexandru.onea@harman.com>2019-04-11 13:02:35 +0300
commit1830893d7b0c43e53da0e4c50449cf7826101614 (patch)
tree5b8d58fb04d2500535e8416056bb4f6584a7cddb
parenta6838a0c6955a5803ca1b15338b971292c3e824b (diff)
Move changelog check ver. from build systems to CI
This commit moves the changelog version check to the CI instead of the build systems. Rationale is: the failure to update the changelog is not a build failure / issue but rather an integration failure and it should be detected at integration testing. The closest to integration testing is the CI testing which is mandatory before pull requests and new features integration. Additionally, the old version.py script is removed because it is relying on the old version of include/tinyalsa/version.h where the TINYALSA_VERSION_STRING macro is defiend as an explicit string literal. Since now the version string is defined piece-wise and based on the individual version numbers, and since the introduction of version.sh and its use within meson build system to get the version from the version file, the old version.py script is obsolete.
-rw-r--r--CMakeLists.txt6
-rw-r--r--Makefile1
-rw-r--r--meson.build7
-rwxr-xr-xscripts/travis-build.sh4
-rwxr-xr-xscripts/version.py25
5 files changed, 4 insertions, 39 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0bb0af5..cb31c58 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,12 +17,6 @@ add_library("tinyalsa" ${HDRS} ${SRCS})
target_compile_options("tinyalsa" PRIVATE -Wall -Wextra -Werror -Wfatal-errors)
target_include_directories("tinyalsa" PRIVATE "include")
-add_custom_command(TARGET "tinyalsa"
- POST_BUILD
- COMMENT "Checking version against the changelog"
- WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
- COMMAND ${PROJECT_SOURCE_DIR}/scripts/version.sh check)
-
macro(ADD_EXAMPLE EXAMPLE)
add_executable(${EXAMPLE} ${ARGN})
target_link_libraries(${EXAMPLE} "tinyalsa")
diff --git a/Makefile b/Makefile
index f268487..9c3dcb1 100644
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,6 @@ all:
$(MAKE) -C utils
$(MAKE) -C doxygen
$(MAKE) -C examples
- $(VERSIONSCRIPT) check
.PHONY: clean
clean:
diff --git a/meson.build b/meson.build
index 7762706..abbca8e 100644
--- a/meson.build
+++ b/meson.build
@@ -10,13 +10,6 @@ tinyalsa = library('tinyalsa',
version: meson.project_version(),
install: true)
-log_version = run_command(find_program('scripts/version.sh'), 'check')
-if log_version.returncode() != 0
- error(log_version.stderr())
-endif
-
-message(log_version.stdout())
-
# For use as a Meson subproject
tinyalsa_dep = declare_dependency(link_with: tinyalsa,
include_directories: include_directories('include'))
diff --git a/scripts/travis-build.sh b/scripts/travis-build.sh
index 9639d88..2bfc4d2 100755
--- a/scripts/travis-build.sh
+++ b/scripts/travis-build.sh
@@ -3,6 +3,8 @@
set -e
set -u
+ROOT=$(pwd)
+
make
make clean
@@ -16,3 +18,5 @@ $HOME/.local/bin/meson . meson-build
cd meson-build
ninja
cd ..
+
+${ROOT}/scripts/version.sh check
diff --git a/scripts/version.py b/scripts/version.py
deleted file mode 100755
index 892dbdb..0000000
--- a/scripts/version.py
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env python3
-#
-# tinyalsa version.py: Extracts versions from TINYALSA_VERSION_STRING in
-# include/tinyalsa/version.h header file for Meson build.
-import os
-import sys
-
-if __name__ == '__main__':
- try:
- srcroot = os.environ['MESON_SOURCE_ROOT']
- except:
- srcroot = os.getcwd()
- print('Warning: MESON_SOURCE_ROOT env var not set, assuming source code is in', srcroot, file=sys.stderr)
-
- # API version
- api_version = None
- f = open(os.path.join(srcroot, 'include', 'tinyalsa', 'version.h'), 'r')
- for line in f:
- if line.startswith('#define TINYALSA_VERSION_STRING '):
- api_version = line[32:].strip().replace('"', '')
- print(api_version)
- sys.exit(0)
-
- print('Warning: Could not extract API version from TINYALSA_VERSION_STRING in include/tinyalsa/version.h in', srcroot, file=sys.stderr)
- sys.exit(-1)