-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdemo.py
executable file
·31 lines (24 loc) · 1.19 KB
/
demo.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
#! /usr/bin/env python
import os
def run(cmd):
print("\n%s\n" % cmd)
ret = os.system(cmd)
if ret != 0:
raise Exception("Error running: %s" % cmd)
# This should work, but would pollute the current directory with temporary files
# run("conan source .")
# run("mkdir build")
# run("cd build && conan install ..")
# run('cd build && cmake ../hello"')
# run('cd build && cmake --build . --config Release')
# run('conan export-pkg . user/testing --build-folder=build')
run("conan source . --source-folder=tmp/source")
run("conan install . --install-folder=tmp/install")
run("conan build . --source-folder=tmp/source --install-folder=tmp/install --build-folder=tmp/build")
run("conan package . --source-folder=tmp/source --install-folder=tmp/install --build-folder=tmp/build --package-folder=tmp/package")
# NOTE: prevent ERROR: Package already exists
run("conan export-pkg . user/testing --source-folder=tmp/source --install-folder=tmp/install --build-folder=tmp/build --force")
# You can also test the package that was just exported
run("conan test test_package Hello/1.1@user/testing")
# Finally, run a full create, does all of the above + test_package
run('conan create . user/testing')