From b5c92e54a632aaba44559839c79b820ea202f123 Mon Sep 17 00:00:00 2001 From: Zoltan Szabadka Date: Fri, 2 Oct 2015 11:32:42 +0200 Subject: [PATCH] Add tools/version.h that conatins the brotli version. This can be reused by all of the tools. Set the version to the next git release tag. --- python/brotlimodule.cc | 3 +-- setup.py | 4 ++-- tools/version.h | 23 +++++++++++++++++++++++ 3 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 tools/version.h diff --git a/python/brotlimodule.cc b/python/brotlimodule.cc index 4294664..bc7ea08 100644 --- a/python/brotlimodule.cc +++ b/python/brotlimodule.cc @@ -3,14 +3,13 @@ #include #include "../enc/encode.h" #include "../dec/decode.h" +#include "../tools/version.h" #if PY_MAJOR_VERSION >= 3 #define PyInt_Check PyLong_Check #define PyInt_AsLong PyLong_AsLong #endif -#define BROTLI_VERSION "0.1.0" - using namespace brotli; static PyObject *BrotliError; diff --git a/setup.py b/setup.py index 5b5e615..02547ff 100644 --- a/setup.py +++ b/setup.py @@ -24,8 +24,8 @@ if platform.system() == 'Windows': def get_version(): - """ Return BROTLI_VERSION string as defined in 'brotlimodule.cc' file. """ - brotlimodule = os.path.join(CURR_DIR, 'python', 'brotlimodule.cc') + """ Return BROTLI_VERSION string as defined in 'tools/version.h' file. """ + brotlimodule = os.path.join(CURR_DIR, 'tools', 'version.h') with open(brotlimodule, 'r') as f: for line in f: m = re.match(r'#define\sBROTLI_VERSION\s"(.*)"', line) diff --git a/tools/version.h b/tools/version.h new file mode 100644 index 0000000..4532fcc --- /dev/null +++ b/tools/version.h @@ -0,0 +1,23 @@ +/* Copyright 2015 Google Inc. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + Defines a common version string used by all of the brotli tools. +*/ + +#ifndef BROTLI_TOOLS_VERSION_H_ +#define BROTLI_TOOLS_VERSION_H_ + +#define BROTLI_VERSION "0.3.0" + +#endif /* BROTLI_TOOLS_VERSION_H_ */