forked from bincrafters/conan-icu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.py
executable file
·118 lines (79 loc) · 3.79 KB
/
build.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
from conan.packager import ConanMultiPackager
if __name__ == "__main__":
builder = ConanMultiPackager(username="bitprim", channel="stable", archs=["x86_64"])
builder.add_common_builds(shared_option_name="icu:shared", pure_c=False)
filtered_builds = []
for settings, options, env_vars, build_requires in builder.builds:
# print(settings)
if (settings["build_type"] == "Release" or settings["build_type"] == "Debug") \
and not options["icu:shared"] \
and (not "compiler.libcxx" in settings or settings["compiler.libcxx"] != "libstdc++11"):
# and not ("compiler.libcxx" in settings and settings["compiler.libcxx"] == "libstdc++"):
filtered_builds.append([settings, options, env_vars, build_requires])
builder.builds = filtered_builds
builder.run()
# #!/usr/bin/env python
# # -*- coding: utf-8 -*-
# from conan.packager import ConanMultiPackager, split_colon_env
# import os
# import re
# import platform
# def get_value_from_recipe(search_string):
# with open("conanfile.py", "r") as conanfile:
# contents = conanfile.read()
# result = re.search(search_string, contents)
# return result
# def get_name_from_recipe():
# return get_value_from_recipe(r'''name\s*=\s*["'](\S*)["']''').groups()[0]
# def get_version_from_recipe():
# return get_value_from_recipe(r'''version\s*=\s*["'](\S*)["']''').groups()[0]
# def get_default_vars():
# username = os.getenv("CONAN_USERNAME", "bincrafters")
# channel = os.getenv("CONAN_CHANNEL", "testing")
# version = get_version_from_recipe()
# return username, channel, version
# def is_ci_running():
# return os.getenv("APPVEYOR_REPO_NAME", "") or os.getenv("TRAVIS_REPO_SLUG", "")
# def get_ci_vars():
# reponame_a = os.getenv("APPVEYOR_REPO_NAME", "")
# repobranch_a = os.getenv("APPVEYOR_REPO_BRANCH", "")
# reponame_t = os.getenv("TRAVIS_REPO_SLUG", "")
# repobranch_t = os.getenv("TRAVIS_BRANCH", "")
# username, _ = reponame_a.split("/") if reponame_a else reponame_t.split("/")
# channel, version = repobranch_a.split("/") if repobranch_a else repobranch_t.split("/")
# return username, channel, version
# def get_env_vars():
# return get_ci_vars() if is_ci_running() else get_default_vars()
# def get_os():
# return platform.system().replace("Darwin", "Macos")
# def get_build_types():
# # Only Appveyor has CONFIGURATION, Travis uses both types anyway.
# build_types_a = split_colon_env("CONFIGURATION") or ['Release', 'Debug']
# build_types = split_colon_env("CONAN_BUILD_TYPES") or build_types_a
# return build_types
# def get_remotes():
# user_remote = "https://api.bintray.com/conan/{0}/public-conan".format(username)
# bincrafters_remote = 'https://api.bintray.com/conan/bincrafters/public-conan'
# remotes = [user_remote, bincrafters_remote]
# # If the user supplied a remote manually we give him priority
# # e.g. maybe he is trying to override user_remote or the bincrafters_remote repo.
# remote_env = split_colon_env("CONAN_REMOTES")
# if remote_env:
# remotes = remote_env + remotes
# return remotes
# if __name__ == "__main__":
# name = get_name_from_recipe()
# username, channel, version = get_env_vars()
# reference = "{0}/{1}".format(name, version)
# upload = "https://api.bintray.com/conan/{0}/public-conan".format(username)
# builder = ConanMultiPackager(
# username=username,
# channel=channel,
# reference=reference,
# build_types=get_build_types(),
# upload=upload,
# remotes=get_remotes(),
# upload_only_when_stable=True,
# stable_branch_pattern="stable/*")
# builder.add_common_builds(shared_option_name=name + ":shared")
# builder.run()