From 8ebadee2e44a05c8329c934005249bd7eabcb88d Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 3 Sep 2017 18:31:20 +0900 Subject: Try to introduce api-generator to Travis CI --- .travis.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 24a182cf..394282ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,20 +1,24 @@ language: cpp + matrix: include: - - os: linux - dist: trusty - compiler: gcc - - os: linux - dist: trusty - compiler: clang + - { os: linux, dist: trusty, compiler: gcc } + - { os: linux, dist: trusty, compiler: clang } - os: osx + install: - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; else sudo apt-get update -qq; fi - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install qt5; export PATH="$PATH:/usr/local/opt/qt/bin"; else sudo apt-get install -y qt5-default; fi + - git clone https://github.com/matrix.org/matrix-doc + - git clone https://github.com/KitsuneRal/api-generator + - cd api-generator && mkdir build && cd build && cmake .. && cmake --target all + +before_script: - mkdir build && cd build - - cmake .. -script: - - cmake --build . --target all + - cmake -DMATRIX_DOC_PATH="matrix-doc" -DAPIGEN_PATH="api-generator/build/api-generator" .. + +script: cmake --build . --target all + notifications: webhooks: urls: -- cgit v1.2.3 From 7b22c356aca065acb04d1c4fa96d878bf6b36757 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 3 Sep 2017 18:34:46 +0900 Subject: Travis CI: build in containers, use newer compilers api-generator only builds on newer compilers (GCC 5, Clang 3.8). Qt version is unchanged. --- .travis.yml | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 394282ef..99e78096 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,23 +1,38 @@ language: cpp +addons: + apt: + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.8 + packages: + - g++-5 + - clang-3.8 + - qt5-default + matrix: include: - - { os: linux, dist: trusty, compiler: gcc } - - { os: linux, dist: trusty, compiler: clang } - - os: osx + - os: linux + env: [ ENV_EVAL="CC=gcc-5 && CXX=g++-5" ] + - os: linux + env: [ ENV_EVAL="CC=clang-3.8 && CXX=clang++-3.8" ] + - os: osx + env: [ ENV_EVAL="brew update && brew install qt5 && CMAKE_PREFIX_PATH=/usr/local/opt/qt" ] install: - - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; else sudo apt-get update -qq; fi - - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install qt5; export PATH="$PATH:/usr/local/opt/qt/bin"; else sudo apt-get install -y qt5-default; fi - - git clone https://github.com/matrix.org/matrix-doc - - git clone https://github.com/KitsuneRal/api-generator - - cd api-generator && mkdir build && cd build && cmake .. && cmake --target all +- eval "${ENV_EVAL}" +- git clone https://github.com/matrix-org/matrix-doc.git +- git clone --recursive https://github.com/KitsuneRal/api-generator.git +- pushd api-generator +- cmake -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} . +- cmake --build . +- popd before_script: - - mkdir build && cd build - - cmake -DMATRIX_DOC_PATH="matrix-doc" -DAPIGEN_PATH="api-generator/build/api-generator" .. +- mkdir build && cd build +- cmake -DMATRIX_DOC_PATH="matrix-doc" -DAPIGEN_PATH="api-generator/api-generator" -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} .. -script: cmake --build . --target all +script: cmake --build . notifications: webhooks: -- cgit v1.2.3 From fd4ee6b9eb083d25f701cede70922d7f54643cad Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Mon, 4 Sep 2017 13:19:57 +0900 Subject: Generate job files on every Travis build --- .travis.yml | 1 + 1 file changed, 1 insertion(+) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 99e78096..ae016c88 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,6 +31,7 @@ install: before_script: - mkdir build && cd build - cmake -DMATRIX_DOC_PATH="matrix-doc" -DAPIGEN_PATH="api-generator/api-generator" -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} .. +- cmake --build . --target update-api script: cmake --build . -- cgit v1.2.3 From cb56a6aa547307e33caf43173f628ea855a4366d Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Mon, 4 Sep 2017 13:28:28 +0900 Subject: Use QMatrixClient's fork of matrix-doc in the meantime Because only the fork contains operationId's yet. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index ae016c88..b8917ef1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ matrix: install: - eval "${ENV_EVAL}" -- git clone https://github.com/matrix-org/matrix-doc.git +- git clone https://github.com/QMatrixClient/matrix-doc.git - git clone --recursive https://github.com/KitsuneRal/api-generator.git - pushd api-generator - cmake -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} . -- cgit v1.2.3 From ce1bbe88509715c9a35bb7aeeb5f20f0d4918ec4 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Mon, 2 Oct 2017 20:07:59 +0900 Subject: api-generator has been renamed to gtad --- .travis.yml | 6 +++--- CMakeLists.txt | 13 ++++++++----- jobs/apigen.yaml | 57 -------------------------------------------------------- jobs/gtad.yaml | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 68 insertions(+), 65 deletions(-) delete mode 100644 jobs/apigen.yaml create mode 100644 jobs/gtad.yaml (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index b8917ef1..2abf0e2b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,15 +22,15 @@ matrix: install: - eval "${ENV_EVAL}" - git clone https://github.com/QMatrixClient/matrix-doc.git -- git clone --recursive https://github.com/KitsuneRal/api-generator.git -- pushd api-generator +- git clone --recursive https://github.com/KitsuneRal/gtad.git +- pushd gtad - cmake -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} . - cmake --build . - popd before_script: - mkdir build && cd build -- cmake -DMATRIX_DOC_PATH="matrix-doc" -DAPIGEN_PATH="api-generator/api-generator" -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} .. +- cmake -DMATRIX_DOC_PATH="matrix-doc" -DGTAD_PATH="gtad/gtad" -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} .. - cmake --build . --target update-api script: cmake --build . diff --git a/CMakeLists.txt b/CMakeLists.txt index f4358521..44f63c79 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,6 +50,11 @@ if (CMAKE_BUILD_TYPE) endif(CMAKE_BUILD_TYPE) message( STATUS "Using compiler: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}" ) message( STATUS "Using Qt ${Qt5_VERSION} at ${Qt5_Prefix}" ) +if (MATRIX_DOC_PATH AND GTAD_PATH) + message( STATUS "Generating API stubs enabled" ) + message( STATUS " Using GTAD at ${GTAD_PATH}" ) + message( STATUS " Using CS API files at ${MATRIX_DOC_PATH}/api/client-server" ) +endif () message( STATUS "=============================================================================" ) message( STATUS ) @@ -84,16 +89,14 @@ set(libqmatrixclient_SRCS jobs/logoutjob.cpp ) -aux_source_directory(jobs/generated libqmatrixclient_job_SRCS) - -if (MATRIX_DOC_PATH AND APIGEN_PATH) +if (MATRIX_DOC_PATH AND GTAD_PATH) add_custom_target(update-api - ${APIGEN_PATH} --config jobs/apigen.yaml --out jobs/generated + ${GTAD_PATH} --config jobs/gtad.yaml --out jobs/generated ${MATRIX_DOC_PATH}/api/client-server content-repo.yaml- cas_login_redirect.yaml- cas_login_ticket.yaml- old_sync.yaml- room_initial_sync.yaml- WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} - SOURCES jobs/apigen.yaml jobs/{{base}}.h.mustache jobs/{{base}}.cpp.mustache + SOURCES jobs/gtad.yaml jobs/{{base}}.h.mustache jobs/{{base}}.cpp.mustache VERBATIM ) endif() diff --git a/jobs/apigen.yaml b/jobs/apigen.yaml deleted file mode 100644 index 69662a5d..00000000 --- a/jobs/apigen.yaml +++ /dev/null @@ -1,57 +0,0 @@ -preprocess: - "%CLIENT_RELEASE_LABEL%": r0 - "%CLIENT_MAJOR_VERSION%": r0 - -# Structure: -# swaggerType: -# OR -# swaggerType: -# - swaggerFormat: -# - /swaggerFormatRegEx/: -# - //: # default, if the format doesn't mach anything above -# WHERE -# targetTypeSpec = targetType OR -# { type: targetType, imports: , } -types: - integer: - - int64: qint64 - - int32: qint32 - - //: int - number: - - float: float - - //: double - boolean: bool - string: - - byte: &QByteArray { type: QByteArray, imports: } - - binary: *QByteArray - - date: - type: QDate - avoidCopy?: true - imports: - - dateTime: - type: QDateTime - avoidCopy?: true - imports: - - //: { type: QString, imports: } - file: - type: QByteArray - imports: - "returnFile?": true - object: { type: QJsonObject, "avoidCopy?": true, imports: } - array: { type: "QVector<{{1}}>", "avoidCopy?": true, imports: } - -#operations: - -env: -# preamble: preamble.mustache - copyrightName: Kitsune Ral - copyrightEmail: -# imports: { set: } -# returnFile?: { bool: false } - -templates: -- "{{base}}.h.mustache" -- "{{base}}.cpp.mustache" - -#outFilesList: apifiles.txt - diff --git a/jobs/gtad.yaml b/jobs/gtad.yaml new file mode 100644 index 00000000..69662a5d --- /dev/null +++ b/jobs/gtad.yaml @@ -0,0 +1,57 @@ +preprocess: + "%CLIENT_RELEASE_LABEL%": r0 + "%CLIENT_MAJOR_VERSION%": r0 + +# Structure: +# swaggerType: +# OR +# swaggerType: +# - swaggerFormat: +# - /swaggerFormatRegEx/: +# - //: # default, if the format doesn't mach anything above +# WHERE +# targetTypeSpec = targetType OR +# { type: targetType, imports: , } +types: + integer: + - int64: qint64 + - int32: qint32 + - //: int + number: + - float: float + - //: double + boolean: bool + string: + - byte: &QByteArray { type: QByteArray, imports: } + - binary: *QByteArray + - date: + type: QDate + avoidCopy?: true + imports: + - dateTime: + type: QDateTime + avoidCopy?: true + imports: + - //: { type: QString, imports: } + file: + type: QByteArray + imports: + "returnFile?": true + object: { type: QJsonObject, "avoidCopy?": true, imports: } + array: { type: "QVector<{{1}}>", "avoidCopy?": true, imports: } + +#operations: + +env: +# preamble: preamble.mustache + copyrightName: Kitsune Ral + copyrightEmail: +# imports: { set: } +# returnFile?: { bool: false } + +templates: +- "{{base}}.h.mustache" +- "{{base}}.cpp.mustache" + +#outFilesList: apifiles.txt + -- cgit v1.2.3 From 844eddfffb8e1ee5d213371299dee0d15614bef8 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Thu, 3 May 2018 23:20:31 +0900 Subject: .travis.yml: Use newer Qt Because GTAD needs it. --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 531eec3e..0b2967cf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,10 +4,10 @@ addons: apt: sources: - ubuntu-toolchain-r-test - - sourceline: 'ppa:beineri/opt-qt563-trusty' + - sourceline: 'ppa:beineri/opt-qt571-trusty' packages: - g++-5 - - qt56base + - qt57base - valgrind matrix: @@ -22,7 +22,7 @@ matrix: before_install: - eval "${ENV_EVAL}" -- if [ "$TRAVIS_OS_NAME" = "linux" ]; then VALGRIND="valgrind $VALGRIND_OPTIONS"; . /opt/qt56/bin/qt56-env.sh; fi +- if [ "$TRAVIS_OS_NAME" = "linux" ]; then VALGRIND="valgrind $VALGRIND_OPTIONS"; . /opt/qt57/bin/qt57-env.sh; fi install: - git clone https://github.com/QMatrixClient/matrix-doc.git -- cgit v1.2.3