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.
This commit is contained in:
Zoltan Szabadka 2015-10-02 11:32:42 +02:00
parent cd2538b0a7
commit b5c92e54a6
3 changed files with 26 additions and 4 deletions

View File

@ -3,14 +3,13 @@
#include <bytesobject.h> #include <bytesobject.h>
#include "../enc/encode.h" #include "../enc/encode.h"
#include "../dec/decode.h" #include "../dec/decode.h"
#include "../tools/version.h"
#if PY_MAJOR_VERSION >= 3 #if PY_MAJOR_VERSION >= 3
#define PyInt_Check PyLong_Check #define PyInt_Check PyLong_Check
#define PyInt_AsLong PyLong_AsLong #define PyInt_AsLong PyLong_AsLong
#endif #endif
#define BROTLI_VERSION "0.1.0"
using namespace brotli; using namespace brotli;
static PyObject *BrotliError; static PyObject *BrotliError;

View File

@ -24,8 +24,8 @@ if platform.system() == 'Windows':
def get_version(): def get_version():
""" Return BROTLI_VERSION string as defined in 'brotlimodule.cc' file. """ """ Return BROTLI_VERSION string as defined in 'tools/version.h' file. """
brotlimodule = os.path.join(CURR_DIR, 'python', 'brotlimodule.cc') brotlimodule = os.path.join(CURR_DIR, 'tools', 'version.h')
with open(brotlimodule, 'r') as f: with open(brotlimodule, 'r') as f:
for line in f: for line in f:
m = re.match(r'#define\sBROTLI_VERSION\s"(.*)"', line) m = re.match(r'#define\sBROTLI_VERSION\s"(.*)"', line)

23
tools/version.h Normal file
View File

@ -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_ */