Skip to content

Commit f3e5684

Browse files
committed
fixed cpack destination directory and added script to get the zip file
1 parent 73f309e commit f3e5684

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

conanfile.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,6 @@ def package(self):
188188

189189
if self.options.cpack and self.settings.build_type == 'Release':
190190
print("Packaging agent with cpack")
191-
self.run("cpack -G ZIP", cwd=self.build_folder)
191+
self.run("cpack -G ZIP -B {}".format(self.package_folder), cwd=self.build_folder)
192192

193193

get_package_zip.py

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
import json
3+
import os
4+
import subprocess
5+
6+
def first(h):
7+
return list(h.items())[0][1]
8+
9+
proc = subprocess.run(['conan', 'list', '-f', 'json', 'mtconnect_agent/*:*' ], capture_output=True)
10+
11+
js = json.loads(proc.stdout)
12+
name = list(first(js))[0]
13+
package = list(first(first(first(first(js))))['packages'].keys())[0]
14+
15+
build_dir_proc = subprocess.run(['conan', 'cache', 'path',
16+
f"{name:}:{package:}"], capture_output=True)
17+
18+
build_dir = build_dir_proc.stdout.strip().decode('utf-8')
19+
20+
files = os.listdir(f"{build_dir:}")
21+
22+
release = [f for f in files if os.listdir(f"{build_dir:}") if f.startswith('agent') and f.endswith('.zip')]
23+
24+
print(f"{build_dir:}/{release[0]:}")
25+

0 commit comments

Comments
 (0)