mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-28 03:58:06 +00:00
Update Conan version Automatically (#5027)
* #5026 Add FindFlatBuffers.cmake to Conan Package Signed-off-by: Uilian Ries <uilianries@gmail.com> * #5026 Build Flatbuffers on OSX 10 Signed-off-by: Uilian Ries <uilianries@gmail.com> * #5026 Auto update Conan package version Signed-off-by: Uilian Ries <uilianries@gmail.com> * #5026 Update Conan docker images Signed-off-by: Uilian Ries <uilianries@gmail.com> * #5026 Update tag var on Appveyor Signed-off-by: Uilian Ries <uilianries@gmail.com> * #5026 Filter appveyor brach name Signed-off-by: Uilian Ries <uilianries@gmail.com>
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
ab54e61805
commit
dd8922878d
29
.travis.yml
29
.travis.yml
@@ -5,9 +5,9 @@ env:
|
|||||||
|
|
||||||
conan-linux: &conan-linux
|
conan-linux: &conan-linux
|
||||||
os: linux
|
os: linux
|
||||||
sudo: required
|
dist: xenial
|
||||||
language: python
|
language: python
|
||||||
python: "3.6"
|
python: "3.7"
|
||||||
services:
|
services:
|
||||||
- docker
|
- docker
|
||||||
install:
|
install:
|
||||||
@@ -82,7 +82,7 @@ matrix:
|
|||||||
- make
|
- make
|
||||||
- LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/google/grpc/install/lib make test ARGS=-V
|
- LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/google/grpc/install/lib make test ARGS=-V
|
||||||
- bash .travis/check-generate-code.sh
|
- bash .travis/check-generate-code.sh
|
||||||
- if [ "$CONAN" == "true" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo pip install conan && conan create . google/testing -s build_type=$BUILD_TYPE -tf conan/test_package; fi
|
- if [ "$CONAN" == "true" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo pip install conan && conan create . flatbuffers/${TRAVIS_BRANCH}@google/testing -s build_type=$BUILD_TYPE -tf conan/test_package; fi
|
||||||
|
|
||||||
- language: cpp
|
- language: cpp
|
||||||
os: osx
|
os: osx
|
||||||
@@ -105,23 +105,23 @@ matrix:
|
|||||||
- DYLD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/google/grpc/install/lib ./grpctest
|
- DYLD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/google/grpc/install/lib ./grpctest
|
||||||
|
|
||||||
- <<: *conan-linux
|
- <<: *conan-linux
|
||||||
env: CONAN_GCC_VERSIONS=4.9 CONAN_DOCKER_IMAGE=lasote/conangcc49
|
env: CONAN_GCC_VERSIONS=4.9 CONAN_DOCKER_IMAGE=conanio/gcc49
|
||||||
- <<: *conan-linux
|
- <<: *conan-linux
|
||||||
env: CONAN_GCC_VERSIONS=5 CONAN_DOCKER_IMAGE=lasote/conangcc5
|
env: CONAN_GCC_VERSIONS=5 CONAN_DOCKER_IMAGE=conanio/gcc5
|
||||||
- <<: *conan-linux
|
- <<: *conan-linux
|
||||||
env: CONAN_GCC_VERSIONS=6 CONAN_DOCKER_IMAGE=lasote/conangcc6
|
env: CONAN_GCC_VERSIONS=6 CONAN_DOCKER_IMAGE=conanio/gcc6
|
||||||
- <<: *conan-linux
|
- <<: *conan-linux
|
||||||
env: CONAN_GCC_VERSIONS=7 CONAN_DOCKER_IMAGE=lasote/conangcc7
|
env: CONAN_GCC_VERSIONS=7 CONAN_DOCKER_IMAGE=conanio/gcc7
|
||||||
- <<: *conan-linux
|
- <<: *conan-linux
|
||||||
env: CONAN_GCC_VERSIONS=8 CONAN_DOCKER_IMAGE=lasote/conangcc8
|
env: CONAN_GCC_VERSIONS=8 CONAN_DOCKER_IMAGE=conanio/gcc8
|
||||||
- <<: *conan-linux
|
- <<: *conan-linux
|
||||||
env: CONAN_CLANG_VERSIONS=3.9 CONAN_DOCKER_IMAGE=lasote/conanclang39
|
env: CONAN_CLANG_VERSIONS=3.9 CONAN_DOCKER_IMAGE=conanio/clang39
|
||||||
- <<: *conan-linux
|
- <<: *conan-linux
|
||||||
env: CONAN_CLANG_VERSIONS=4.0 CONAN_DOCKER_IMAGE=lasote/conanclang40
|
env: CONAN_CLANG_VERSIONS=4.0 CONAN_DOCKER_IMAGE=conanio/clang40
|
||||||
- <<: *conan-linux
|
- <<: *conan-linux
|
||||||
env: CONAN_CLANG_VERSIONS=5.0 CONAN_DOCKER_IMAGE=lasote/conanclang50
|
env: CONAN_CLANG_VERSIONS=5.0 CONAN_DOCKER_IMAGE=conanio/clang50
|
||||||
- <<: *conan-linux
|
- <<: *conan-linux
|
||||||
env: CONAN_CLANG_VERSIONS=6.0 CONAN_DOCKER_IMAGE=lasote/conanclang60
|
env: CONAN_CLANG_VERSIONS=6.0 CONAN_DOCKER_IMAGE=conanio/clang60
|
||||||
- <<: *conan-osx
|
- <<: *conan-osx
|
||||||
osx_image: xcode7.3
|
osx_image: xcode7.3
|
||||||
env: CONAN_APPLE_CLANG_VERSIONS=7.3
|
env: CONAN_APPLE_CLANG_VERSIONS=7.3
|
||||||
@@ -132,8 +132,11 @@ matrix:
|
|||||||
osx_image: xcode9
|
osx_image: xcode9
|
||||||
env: CONAN_APPLE_CLANG_VERSIONS=9.0
|
env: CONAN_APPLE_CLANG_VERSIONS=9.0
|
||||||
- <<: *conan-osx
|
- <<: *conan-osx
|
||||||
osx_image: xcode9.3
|
osx_image: xcode9.4
|
||||||
env: CONAN_APPLE_CLANG_VERSIONS=9.1
|
env: CONAN_APPLE_CLANG_VERSIONS=9.1
|
||||||
|
- <<: *conan-osx
|
||||||
|
osx_image: xcode10
|
||||||
|
env: CONAN_APPLE_CLANG_VERSIONS=10.0
|
||||||
|
|
||||||
- language: android
|
- language: android
|
||||||
sudo: true
|
sudo: true
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from cpt.packager import ConanMultiPackager
|
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
|
import subprocess
|
||||||
|
from cpt.packager import ConanMultiPackager
|
||||||
|
|
||||||
|
|
||||||
def set_appveyor_environment():
|
def set_appveyor_environment():
|
||||||
if os.getenv("APPVEYOR") is not None:
|
if os.getenv("APPVEYOR") is not None:
|
||||||
@@ -13,6 +16,39 @@ def set_appveyor_environment():
|
|||||||
os.environ["CONAN_ARCHS"] = ci_platform
|
os.environ["CONAN_ARCHS"] = ci_platform
|
||||||
os.environ["CONAN_BUILD_TYPES"] = os.getenv("Configuration").replace('"', '')
|
os.environ["CONAN_BUILD_TYPES"] = os.getenv("Configuration").replace('"', '')
|
||||||
|
|
||||||
|
|
||||||
|
def get_branch():
|
||||||
|
try:
|
||||||
|
for line in subprocess.check_output("git branch", shell=True).decode().splitlines():
|
||||||
|
line = line.strip()
|
||||||
|
if line.startswith("*") and " (HEAD detached" not in line:
|
||||||
|
return line.replace("*", "", 1).strip()
|
||||||
|
return ""
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
return ""
|
||||||
|
|
||||||
|
|
||||||
|
def get_version():
|
||||||
|
version = get_branch()
|
||||||
|
if os.getenv("TRAVIS", False):
|
||||||
|
version = os.getenv("TRAVIS_BRANCH")
|
||||||
|
|
||||||
|
if os.getenv("APPVEYOR", False):
|
||||||
|
version = os.getenv("APPVEYOR_REPO_BRANCH")
|
||||||
|
if os.getenv("APPVEYOR_REPO_TAG") == "true":
|
||||||
|
version = os.getenv("APPVEYOR_REPO_TAG_NAME")
|
||||||
|
|
||||||
|
match = re.search(r"v(\d+\.\d+\.\d+.*)", version)
|
||||||
|
if match:
|
||||||
|
return match.group(1)
|
||||||
|
return version
|
||||||
|
|
||||||
|
|
||||||
|
def get_reference(username):
|
||||||
|
return "flatbuffers/{}@google/stable".format(get_version())
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
login_username = os.getenv("CONAN_LOGIN_USERNAME", "aardappel")
|
login_username = os.getenv("CONAN_LOGIN_USERNAME", "aardappel")
|
||||||
username = os.getenv("CONAN_USERNAME", "google")
|
username = os.getenv("CONAN_USERNAME", "google")
|
||||||
@@ -22,7 +58,8 @@ if __name__ == "__main__":
|
|||||||
upload_only_when_stable = os.getenv("CONAN_UPLOAD_ONLY_WHEN_STABLE", True)
|
upload_only_when_stable = os.getenv("CONAN_UPLOAD_ONLY_WHEN_STABLE", True)
|
||||||
set_appveyor_environment()
|
set_appveyor_environment()
|
||||||
|
|
||||||
builder = ConanMultiPackager(username=username,
|
builder = ConanMultiPackager(reference=get_reference(username),
|
||||||
|
username=username,
|
||||||
login_username=login_username,
|
login_username=login_username,
|
||||||
upload=upload,
|
upload=upload,
|
||||||
stable_branch_pattern=stable_branch_pattern,
|
stable_branch_pattern=stable_branch_pattern,
|
||||||
|
|||||||
@@ -10,15 +10,15 @@ from conans import ConanFile, CMake, tools
|
|||||||
|
|
||||||
class FlatbuffersConan(ConanFile):
|
class FlatbuffersConan(ConanFile):
|
||||||
name = "flatbuffers"
|
name = "flatbuffers"
|
||||||
version = "1.10.0"
|
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
url = "https://github.com/google/flatbuffers"
|
url = "https://github.com/google/flatbuffers"
|
||||||
homepage = "http://google.github.io/flatbuffers/"
|
homepage = "http://google.github.io/flatbuffers/"
|
||||||
author = "Wouter van Oortmerssen"
|
author = "Wouter van Oortmerssen"
|
||||||
|
topics = ("conan", "flatbuffers", "serialization", "rpc", "json-parser")
|
||||||
description = "Memory Efficient Serialization Library"
|
description = "Memory Efficient Serialization Library"
|
||||||
settings = "os", "compiler", "build_type", "arch"
|
settings = "os", "compiler", "build_type", "arch"
|
||||||
options = {"shared": [True, False], "fPIC": [True, False]}
|
options = {"shared": [True, False], "fPIC": [True, False]}
|
||||||
default_options = "shared=False", "fPIC=True"
|
default_options = {"shared": False, "fPIC": True}
|
||||||
generators = "cmake"
|
generators = "cmake"
|
||||||
exports = "LICENSE.txt"
|
exports = "LICENSE.txt"
|
||||||
exports_sources = ["CMake/*", "include/*", "src/*", "grpc/*", "CMakeLists.txt", "conan/CMakeLists.txt"]
|
exports_sources = ["CMake/*", "include/*", "src/*", "grpc/*", "CMakeLists.txt", "conan/CMakeLists.txt"]
|
||||||
@@ -57,6 +57,7 @@ class FlatbuffersConan(ConanFile):
|
|||||||
cmake = self.configure_cmake()
|
cmake = self.configure_cmake()
|
||||||
cmake.install()
|
cmake.install()
|
||||||
self.copy(pattern="LICENSE.txt", dst="licenses")
|
self.copy(pattern="LICENSE.txt", dst="licenses")
|
||||||
|
self.copy(pattern="FindFlatBuffers.cmake", dst=os.path.join("lib", "cmake", "flatbuffers"), src="CMake")
|
||||||
self.copy(pattern="flathash*", dst="bin", src="bin")
|
self.copy(pattern="flathash*", dst="bin", src="bin")
|
||||||
self.copy(pattern="flatc*", dst="bin", src="bin")
|
self.copy(pattern="flatc*", dst="bin", src="bin")
|
||||||
if self.settings.os == "Windows" and self.options.shared:
|
if self.settings.os == "Windows" and self.options.shared:
|
||||||
|
|||||||
Reference in New Issue
Block a user