Skip to content

Commit

Permalink
Merge pull request #30 from d1vanov/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
d1vanov authored Jan 7, 2020
2 parents eee14ff + 4c0088a commit 845df22
Show file tree
Hide file tree
Showing 85 changed files with 176,881 additions and 26,267 deletions.
42 changes: 13 additions & 29 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,10 @@ branches:
matrix:
include:
- os: linux
env: QT_BASE=48 COMPILER=g++-5.4 CMAKE_BUILD_TYPE=Debug
env: COMPILER=g++-5.4 CMAKE_BUILD_TYPE=RelWithDebInfo

- os: linux
env: QT_BASE=48 COMPILER=clang++ CMAKE_BUILD_TYPE=Debug

- os: linux
env: QT_BASE=5123 COMPILER=g++-5.4 CMAKE_BUILD_TYPE=RelWithDebInfo

- os: linux
env: QT_BASE=5123 COMPILER=clang++ CMAKE_BUILD_TYPE=Debug
env: COMPILER=clang++ CMAKE_BUILD_TYPE=Debug

- os: osx
env: CMAKE_BUILD_TYPE=RelWithDebInfo
Expand Down Expand Up @@ -59,22 +53,12 @@ install:
sudo cp -fR cmake-3.2.0-Linux-x86_64/* /usr &&
sudo apt-get -qq install p7zip-full coreutils curl &&
sudo apt-add-repository -y ppa:ubuntu-toolchain-r/test &&
if [ "${QT_BASE}" = "5123" ]; then
sudo apt-add-repository -y ppa:beineri/opt-qt-5.12.3-xenial &&
sudo apt-get -qq update &&
sudo apt-get -qq install qt512tools qt512base qt512webchannel qt512webengine qt512websockets mesa-common-dev libgl1-mesa-dev &&
if [ "${COMPILER}" = "clang++" ]; then
export CXX="clang++" &&
export CC="clang"
fi
else
export DISPLAY=:99.0 &&
sudo apt-get -qq update &&
sudo apt-get -qq install libqt4-dev libqt4-dev-bin libqt4-network libqtwebkit-dev &&
if [ "${COMPILER}" = "clang++" ]; then
export CXX="clang++" &&
export CC="clang"
fi
sudo apt-add-repository -y ppa:beineri/opt-qt-5.12.3-xenial &&
sudo apt-get -qq update &&
sudo apt-get -qq install qt512tools qt512base qt512webchannel qt512webengine qt512websockets mesa-common-dev libgl1-mesa-dev &&
if [ "${COMPILER}" = "clang++" ]; then
export CXX="clang++" &&
export CC="clang"
fi
else
brew update &&
Expand All @@ -92,7 +76,7 @@ before_script:
- cd build
- cmake --version
- |
if [ "${QT_BASE}" = "5123" ]; then
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
source /opt/qt512/bin/qt512-env.sh &&
cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/installdir ..
elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
Expand All @@ -106,21 +90,21 @@ script:
- make check
- make install
- |
if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${QT_BASE}" = "5123" ] && [ "${COMPILER}" = "g++-5.4" ] && [ "${TRAVIS_BRANCH}" = "development" ]; then
if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${COMPILER}" = "g++-5.4" ] && [ "${TRAVIS_BRANCH}" = "development" ]; then
echo "Triggering build at OpenSUSE build service for development branch" &&
curl -X POST -H "Authorization: Token $OSC_TOKEN" https://api.opensuse.org/trigger/runservice?project=home%3Ad1vanov%3Aquentier-development&package=qevercloud-development
fi
after_success:
- |
if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${QT_BASE}" = "5123" ] && [ "${COMPILER}" = "g++-5.4" ]; then
if [ "${TRAVIS_OS_NAME}" = "linux" ] && [ "${COMPILER}" = "g++-5.4" ]; then
if [ "${TRAVIS_BRANCH}" = "master" ] || [ "${TRAVIS_BRANCH}" = "development" ]; then
cd $QEVERCLOUD_DIR/build/installdir &&
7z a qevercloud_linux_qt_${QT_BASE}_x86_64.zip * &&
7z a qevercloud_linux_qt_513_x86_64.zip * &&
wget https://github.com/d1vanov/ciuploadtool/releases/download/continuous-master/ciuploadtool_linux.zip &&
unzip ciuploadtool_linux.zip &&
chmod 755 ciuploadtool &&
./ciuploadtool -suffix="$TRAVIS_BRANCH" qevercloud_linux_qt_${QT_BASE}_x86_64.zip
./ciuploadtool -suffix="$TRAVIS_BRANCH" qevercloud_linux_qt_513_x86_64.zip
fi
elif [ "${TRAVIS_OS_NAME}" = "osx" ]; then
if [ "${TRAVIS_BRANCH}" = "master" ] || [ "${TRAVIS_BRANCH}" = "development" ]; then
Expand Down
93 changes: 92 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,96 @@
# Changelog

## 5.0.0
* **A lot of new features were added in this release which unfortunately
required to introduce several API breaks.**
* Network requests sent to Evernote service via `NoteStore` and `UserStore`
method calls are now automatically retried if network occasionally fails.
Retry logic can be parametrized on `NoteStore` or `UserStore` level
or per each particular method call.
* `IRequestContext` interface was introduced and added to all methods of
`NoteStore` and `UserStore` as well as to their constructors. This interface
allows to specify and track various parameters for each request done from
QEverCloud to Evernote service: each such request (i.e. each `NoteStore` and
`UserStore` method call) now has a unique identifier, timeout, parameters
controlling automatic retry of requests which failed due to network problems.
Authentication token used for requests to Evernote service is also a part of
`IRequestContext` interface so it can be conveniently specified for `NoteStore`
and `UserStore` on their construction and overridden for individual requests
if necessary.
* Due to the introduction of request contexts global functions `connectionTimeout`
and `setConnectionTimeout` were removed. Their names were misleading as they
were actually request timeouts.
* Enumerations were migrated to strongly typed ones of modern C++, i.e. they
are `enum class` now and require explicit cast for conversion to/from integer
types. There is also no `structs` wrapping enums called `type` anymore so e.g.
`EDAMErrorCode::type` values are now simply `EDAMErrorCode` ones.
* Enumerations were also marked with [Q_ENUM_NS](https://doc.qt.io/qt-5/qobject.html#Q_ENUM_NS)
macro if QEverCloud is built with Qt >= 5.8 and if the corresponding CMake
option is enabled. This macro adds some introspection capabilities for
the bespoke enumerations.
* A dedicated exception class representing network failures was added -
`NetworkException`. As other QEverCloud's exceptions, it is a subclass of
`EverCloudException`. By default QEverCloud catches such exceptions on its
own and retries the request up to several times.
* Some introspection capabilities were added to QEverCloud types: they now have
[Q_GADGET](https://doc.qt.io/qt-5/qobject.html#Q_GADGET) macro and each of
their attributes is registered as a [Q_PROPERTY](https://doc.qt.io/qt-5/qobject.html#Q_PROPERTY).
* In order to support the above mentioned introspection of QEverCloud types
`Optional` template class implementation was changed: `operator==` and
`operator!=` accepting another `Optional` were added to it. Unfortunately, it
has lead to some complications: you can no longer do comparisons like
```
Optional<int> a = 42;
double b = 1.0;
bool res = (a == b);
```
Instead you need to cast the right hand side expression to proper type:
```
Optional<int> a = 42;
double b = 1.0;
bool res = (a == static_cast<int>(b));
```
* Each QEverCloud type corresponding to Evernote API's type now has a member
called `localData` of class `EverCloudLocalData`. That class encapsulates some
attributes which are not present within Evernote API's types and thus do not
take part in communication with Evernote but they nevertheless can be useful
for implementation of rich Evernote client applications performing full and
partial synchronization of data with Evernote. `EverCloudLocalData`
contains:
* `id` string which by default is generated as a `QUuid` but can be substituted
with any string value
* `dirty`, `local` and `favorited` boolean flags
* `dict` which is a collection of arbitrary data in the form of `QVariant`s
indexed by strings
* Logging system was added to QEverCloud. It exists as `ILogger` interface
which you can implement and thus integrate QEverCloud's logging into your
application's logging system whatever that is. For convenience in debugging
QEverCloud also provides an option to dump log messages to stderr.
* For proper support of logging all QEverCloud's types, enumerations and
exceptions were made printable i.e. they can now be used with `QTextStream`
and `QDebug` to produce human readable representation of their values.
* `NoteStore` and `UserStore` classes were converted to `INoteStore` and
`IUserStore` abstract interfaces. It made the implementation of request retrying
logic simpler and it is now possible to substitute your own implementations
of `INoteStore` and/or `IUserStore`, for example, for unit tests of your code
using QEverCloud.
* Implementation of `NoteStore` and `UserStore` servers was added to QEverCloud.
These classes can be used to implement your own backend substituting real Evernote
service.
* Unit tests using the functionality of the above mentioned servers were added
to QEverCloud. Unit tests ensure the correctness of transport layer's implementation
i.e. the correctness of packing requests to Thrift format and unpacking the
responses ensuring that no data is lost or corrupted on either step. Hundreds
of tests covering literally every single method of `NoteStore` and `UserStore`
were added.
* Some header files were renamed so that they all start from capital letters
now.
* Support for Qt < 5.5 as well as support for building QEverCloud with older
compilers has been dropped. QEverCloud is now built with C++14 standard
although it does not use much of its features so even some not fully compliant
compilers can still build QEverCloud. Minimal supported gcc version is 5.4,
minimal supported Visual Studio version is 2017.

## 4.1.0
* Migrate to Evernote API 1.29 from 1.28. The changes are incremental and API is not broken. ABI is changed though,
hence minor version number increase. The changes in API include:
Expand Down Expand Up @@ -58,7 +149,7 @@

## 2.0
* Qt 4 is no longer supported.
* Asynchronous API is introdused.
* Asynchronous API is introduced.
* Various non-critical fixes and improvements.

## 1.2
Expand Down
64 changes: 17 additions & 47 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required(VERSION 3.5.1)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/QEverCloud/cmake/modules")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/QEverCloud/cmake/modules/sanitizers")

include(QEverCloudCMakePolicies)
SET_POLICIES()

if("${CMAKE_MAJOR_VERSION}" GREATER "2")
project(QEverCloud
VERSION 4.1.0)
else()
project(QEverCloud)
set(PROJECT_VERSION_MAJOR "4")
set(PROJECT_VERSION_MINOR "1")
set(PROJECT_VERSION_PATCH "0")
set(PROJECT_VERSION_COUNT 3)
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
endif()
project(QEverCloud
VERSION 5.0.0)

set(PROJECT_VENDOR "Dmitry Ivanov")
set(PROJECT_COPYRIGHT_YEAR "2015-2019")
Expand All @@ -29,6 +20,7 @@ include(QEverCloudDoxygen)
set(BUILD_DOCUMENTATION ON CACHE BOOL "Build documentation for QEverCloud")
set(BUILD_QCH_DOCUMENTATION OFF CACHE BOOL "Build documentation for QEverCloud in qch format")
set(BUILD_WITH_OAUTH_SUPPORT ON CACHE BOOL "Build QEverCloud with OAuth support")
set(BUILD_WITH_Q_NAMESPACE ON CACHE BOOL "Use Q_NAMESPACE and Q_ENUM_NS macros for introspection")

if(BUILD_DOCUMENTATION)
# set Doxygen documentation properties
Expand All @@ -51,14 +43,9 @@ endif()

include(QEverCloudCompilerSettings)

set(BUILD_WITH_QT4 OFF CACHE BOOL "Build against Qt4 instead of Qt5")
include(QEverCloudSetupQt)

if(BUILD_WITH_QT4)
set(QEVERCLOUD_QT_VERSION "qt4")
else()
set(QEVERCLOUD_QT_VERSION "qt5")
endif()
set(QEVERCLOUD_QT_VERSION "qt5")

if(NOT CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "lib")
Expand All @@ -81,20 +68,13 @@ if(NOT INSTALL_CMAKE_DIR)
endif()

set(BUILD_SHARED ON CACHE BOOL "Build shared library, otherwise static library")
set(MAJOR_VERSION_LIB_NAME_SUFFIX OFF CACHE BOOL "If on, the project's major version would be added to the library's name as a suffix")
set(MAJOR_VERSION_DEV_HEADERS_FOLDER_NAME_SUFFIX OFF CACHE BOOL "If on, the project's major version would be added to the library's development headers' folder name as a suffix")

if(MSVC)
set(QEVERCLOUD_LIBNAME_PREFIX "lib")
else()
set(QEVERCLOUD_LIBNAME_PREFIX "")
endif()

set(QEVERCLOUD_LIBNAME_SUFFIX "")
if(MAJOR_VERSION_LIB_NAME_SUFFIX)
set(QEVERCLOUD_LIBNAME_SUFFIX "${PROJECT_VERSION_MAJOR}")
endif()

if(QEVERCLOUD_USE_QT_WEB_ENGINE)
set(QEVERCLOUD_USES_QT_WEB_ENGINE "set(QEVERCLOUD_USE_QT_WEB_ENGINE TRUE)")
else()
Expand All @@ -114,29 +94,19 @@ configure_file(QEverCloud/cmake/modules/QEverCloudConfig.cmake.in
configure_file(QEverCloud/cmake/modules/QEverCloudConfigVersion.cmake.in
${PROJECT_BINARY_DIR}/QEverCloud-${QEVERCLOUD_QT_VERSION}ConfigVersion.cmake @ONLY)

if(BUILD_WITH_QT4)
if(BUILD_WITH_OAUTH_SUPPORT)
file(COPY QEverCloud/cmake/modules/QEverCloudFindQt4DependenciesWithWebKit.cmake DESTINATION ${PROJECT_BINARY_DIR})
file(RENAME ${PROJECT_BINARY_DIR}/QEverCloudFindQt4DependenciesWithWebKit.cmake ${PROJECT_BINARY_DIR}/QEverCloud-${QEVERCLOUD_QT_VERSION}FindQtDependencies.cmake)
file(COPY QEverCloud/cmake/modules/QEverCloudFindQt5DependenciesCore.cmake DESTINATION ${PROJECT_BINARY_DIR})
file(RENAME ${PROJECT_BINARY_DIR}/QEverCloudFindQt5DependenciesCore.cmake ${PROJECT_BINARY_DIR}/QEverCloud-${QEVERCLOUD_QT_VERSION}FindQtDependencies.cmake)

if(BUILD_WITH_OAUTH_SUPPORT)
if(USE_QT5_WEBKIT)
file(READ QEverCloud/cmake/modules/QEverCloudFindQt5DependenciesWebKit.cmake WEBKIT_DEPS_FILE)
file(APPEND ${PROJECT_BINARY_DIR}/QEverCloud-${QEVERCLOUD_QT_VERSION}FindQtDependencies.cmake "${WEBKIT_DEPS_FILE}")
elseif(Qt5Core_VERSION VERSION_LESS "5.6.0")
file(READ QEverCloud/cmake/modules/QEverCloudFindQt5DependenciesWebEngineNoCore.cmake WEBENGINE_NO_CORE_DEPS_FILE)
file(APPEND ${PROJECT_BINARY_DIR}/QEverCloud-${QEVERCLOUD_QT_VERSION}FindQtDependencies.cmake "${WEBENGINE_NO_CORE_DEPS_FILE}")
else()
file(COPY QEverCloud/cmake/modules/QEverCloudFindQt4Dependencies.cmake DESTINATION ${PROJECT_BINARY_DIR})
file(RENAME ${PROJECT_BINARY_DIR}/QEverCloudFindQt4Dependencies.cmake ${PROJECT_BINARY_DIR}/QEverCloud-${QEVERCLOUD_QT_VERSION}FindQtDependencies.cmake)
endif()
else()
file(COPY QEverCloud/cmake/modules/QEverCloudFindQt5DependenciesCore.cmake DESTINATION ${PROJECT_BINARY_DIR})
file(RENAME ${PROJECT_BINARY_DIR}/QEverCloudFindQt5DependenciesCore.cmake ${PROJECT_BINARY_DIR}/QEverCloud-${QEVERCLOUD_QT_VERSION}FindQtDependencies.cmake)

if(BUILD_WITH_OAUTH_SUPPORT)
if(USE_QT5_WEBKIT OR (Qt5Core_VERSION VERSION_LESS "5.4.0"))
file(READ QEverCloud/cmake/modules/QEverCloudFindQt5DependenciesWebKit.cmake WEBKIT_DEPS_FILE)
file(APPEND ${PROJECT_BINARY_DIR}/QEverCloud-${QEVERCLOUD_QT_VERSION}FindQtDependencies.cmake "${WEBKIT_DEPS_FILE}")
elseif(Qt5Core_VERSION VERSION_LESS "5.6.0")
file(READ QEverCloud/cmake/modules/QEverCloudFindQt5DependenciesWebEngineNoCore.cmake WEBENGINE_NO_CORE_DEPS_FILE)
file(APPEND ${PROJECT_BINARY_DIR}/QEverCloud-${QEVERCLOUD_QT_VERSION}FindQtDependencies.cmake "${WEBENGINE_NO_CORE_DEPS_FILE}")
else()
file(READ QEverCloud/cmake/modules/QEverCloudFindQt5DependenciesWebEngineCore.cmake WEBENGINE_CORE_DEPS_FILE)
file(APPEND ${PROJECT_BINARY_DIR}/QEverCloud-${QEVERCLOUD_QT_VERSION}FindQtDependencies.cmake "${WEBENGINE_CORE_DEPS_FILE}")
endif()
file(READ QEverCloud/cmake/modules/QEverCloudFindQt5DependenciesWebEngineCore.cmake WEBENGINE_CORE_DEPS_FILE)
file(APPEND ${PROJECT_BINARY_DIR}/QEverCloud-${QEVERCLOUD_QT_VERSION}FindQtDependencies.cmake "${WEBENGINE_CORE_DEPS_FILE}")
endif()
endif()

Expand Down
7 changes: 3 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ If you don't have a crash or exception but have some method of QEverCloud return
If you have not only found a bug but have also identified its reason and would like to contribute a bugfix, please note the following:

* `master` branch is meant to contain the current stable version of QEverCloud. Small and safe bugfixes are ok to land in `master`. More complicated bugfixes changing a lot of code or breaking the API/ABI compatibility are not indended for `master`. Instead, please contribute them to `development` branch.
* Make sure the changes you propose agree with the [coding style](CodingStyle.md) of the project. If they don't but the bugfix you are contributing is good enough, there's a chance your contribution would be accepted but the coding style would have to be cleaned up after that. You are encouraged to be a good citizen and not force others to clean up after you.
* Make sure the changes you propose agree with the [coding style](docs/CodingStyle.md) of the project. If they don't but the bugfix you are contributing is good enough, there's a chance your contribution would be accepted but the coding style would have to be cleaned up after that. You are encouraged to be a good citizen and not force others to clean up after you.
* Make sure you don't attempt to change the code residing in `generated` folders, either for header files or cpp files: the code in those folders was [automatically generated](https://github.com/d1vanov/QEverCloudGenerator) from [Thrift IDL](https://github.com/evernote/evernote-thrift) files. So any manual changes there would be overwritten by the next re-generation from Thrift IDL files. Please see whether the fix you propose could belong to Thrift IDL files themselves - if it's a typo within some Doxygen comment, it can definitely be fixed in the Thrift IDL files with the corresponding QEverCloud code regenerated from corrected Thrift IDL files. So the fix for autogenerated code might need to be applied to [the generator](https://github.com/d1vanov/QEverCloudGenerator) of QEverCloud code from Thrift IDL files.

### How to suggest a new feature or improvement
Expand All @@ -40,13 +40,12 @@ or
It is important to discuss that for both preventing the duplication of effort and to ensure the implementation won't confront the vision of others and would be accepted when ready. Please don't start the actual work on the new features before the vision agreement is achieved - it can lead to problems with code acceptance to QEverCloud.

When working on a feature or improvement implementation, please comply with the [coding style](CodingStyle.md) of the project.
When working on a feature or improvement implementation, please comply with the [coding style](docs/CodingStyle.md) of the project.

All the new features and major improvements should be contributed to `development` branch, not `master`.

### Submitting pull requests: which proposed changes are generally NOT approved

* Breaking backward compatibility without a really good reason for that.
* The introduction of dependencies on strictly the latest versions of anything, like, on some feature existing only in the latest version of Qt.
* The direct unconditional usage of C++11/14/17 features breaking the build with older compilers not supporting them (see the [coding style](CodingStyle.md) doc for more info on that)
* The breakage of building/working with Qt4
* The direct unconditional usage of modern C++ features breaking the build with older compilers not supporting them (see the [coding style](docs/CodingStyle.md) doc for more info on that)
Loading

0 comments on commit 845df22

Please sign in to comment.