This repository has been archived by the owner on Jan 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.py
48 lines (37 loc) · 1.47 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
import os
import re
from conan.packager import ConanMultiPackager
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]
if __name__ == "__main__":
header_only = False
name = get_name_from_recipe()
version = get_version_from_recipe()
reference = "{0}/{1}".format(name, version)
username = "conan"
login_username = "conanbot"
upload_remote = "https://api.bintray.com/conan/conan-community/{0}".format(username)
builder = ConanMultiPackager(
stable_branch_pattern="stable/*",
upload_only_when_stable=True,
username=username,
login_username=login_username,
reference=reference,
upload=upload_remote,
remotes=upload_remote)
if header_only:
filtered_builds = []
for settings, options, env_vars, build_requires, reference in builder.items:
if settings["compiler"] == "gcc":
filtered_builds.append([settings, options, env_vars, build_requires])
break
builder.builds = filtered_builds
builder.add_common_builds(shared_option_name="wiringpi:shared", pure_c=True)
builder.run()