Skip to content

Commit 1d4a9d8

Browse files
committed
Pull all pdbs from all packages. This needs a filter.
1 parent 8077f49 commit 1d4a9d8

File tree

2 files changed

+56
-4
lines changed

2 files changed

+56
-4
lines changed

BranchSDK/Windows/BranchInstaller/Components.wxs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,15 @@
932932
</ComponentGroup>
933933
<ComponentGroup Id="ThirdPartyLibrariesX64">
934934
<Component Directory="X64DEBUGLIBFOLDER" Guid="5a94d40d-f719-40f4-86a1-8b897cfc4b70" Id="X64DEBUGLIBFOLDER">
935+
<File Id="Debugx64.stage.lib.Crypto.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debugx64\stage\lib\Crypto.pdb"/>
936+
<File Id="Debugx64.stage.lib.Data.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debugx64\stage\lib\Data.pdb"/>
937+
<File Id="Debugx64.stage.lib.Encodings.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debugx64\stage\lib\Encodings.pdb"/>
938+
<File Id="Debugx64.stage.lib.Foundation.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debugx64\stage\lib\Foundation.pdb"/>
939+
<File Id="Debugx64.stage.lib.JSON.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debugx64\stage\lib\JSON.pdb"/>
935940
<File Id="Debugx64.stage.lib.libeay32.lib" Source="$(var.ProjectDir)\..\..\..\build\Debugx64\stage\lib\libeay32.lib"/>
941+
<File Id="Debugx64.stage.lib.Net.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debugx64\stage\lib\Net.pdb"/>
942+
<File Id="Debugx64.stage.lib.NetSSL.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debugx64\stage\lib\NetSSL.pdb"/>
943+
<File Id="Debugx64.stage.lib.NetSSLWin.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debugx64\stage\lib\NetSSLWin.pdb"/>
936944
<File Id="Debugx64.stage.lib.PocoCryptomdd.lib" Source="$(var.ProjectDir)\..\..\..\build\Debugx64\stage\lib\PocoCryptomdd.lib"/>
937945
<File Id="Debugx64.stage.lib.PocoDatamdd.lib" Source="$(var.ProjectDir)\..\..\..\build\Debugx64\stage\lib\PocoDatamdd.lib"/>
938946
<File Id="Debugx64.stage.lib.PocoEncodingsmdd.lib" Source="$(var.ProjectDir)\..\..\..\build\Debugx64\stage\lib\PocoEncodingsmdd.lib"/>
@@ -945,7 +953,13 @@
945953
<File Id="Debugx64.stage.lib.PocoUtilmdd.lib" Source="$(var.ProjectDir)\..\..\..\build\Debugx64\stage\lib\PocoUtilmdd.lib"/>
946954
<File Id="Debugx64.stage.lib.PocoXMLmdd.lib" Source="$(var.ProjectDir)\..\..\..\build\Debugx64\stage\lib\PocoXMLmdd.lib"/>
947955
<File Id="Debugx64.stage.lib.PocoZipmdd.lib" Source="$(var.ProjectDir)\..\..\..\build\Debugx64\stage\lib\PocoZipmdd.lib"/>
956+
<File Id="Debugx64.stage.lib.Redis.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debugx64\stage\lib\Redis.pdb"/>
948957
<File Id="Debugx64.stage.lib.ssleay32.lib" Source="$(var.ProjectDir)\..\..\..\build\Debugx64\stage\lib\ssleay32.lib"/>
958+
<File Id="Debugx64.stage.lib.unit_tests.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debugx64\stage\lib\unit_tests.pdb"/>
959+
<File Id="Debugx64.stage.lib.Util.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debugx64\stage\lib\Util.pdb"/>
960+
<File Id="Debugx64.stage.lib.vc142.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debugx64\stage\lib\vc142.pdb"/>
961+
<File Id="Debugx64.stage.lib.XML.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debugx64\stage\lib\XML.pdb"/>
962+
<File Id="Debugx64.stage.lib.Zip.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debugx64\stage\lib\Zip.pdb"/>
949963
<File Id="Debugx64.stage.lib.zlib.lib" Source="$(var.ProjectDir)\..\..\..\build\Debugx64\stage\lib\zlib.lib"/>
950964
</Component>
951965
<Component Directory="X64RELEASELIBFOLDER" Guid="c9f2a7b9-560d-4ff7-bd7b-5535a60b1123" Id="X64RELEASELIBFOLDER">
@@ -977,7 +991,15 @@
977991
</ComponentGroup>
978992
<ComponentGroup Id="ThirdPartyLibrariesX86">
979993
<Component Directory="X86DEBUGLIBFOLDER" Guid="0db87ca1-c644-47df-a72e-85913578c98a" Id="X86DEBUGLIBFOLDER">
994+
<File Id="Debug.stage.lib.Crypto.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debug\stage\lib\Crypto.pdb"/>
995+
<File Id="Debug.stage.lib.Data.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debug\stage\lib\Data.pdb"/>
996+
<File Id="Debug.stage.lib.Encodings.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debug\stage\lib\Encodings.pdb"/>
997+
<File Id="Debug.stage.lib.Foundation.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debug\stage\lib\Foundation.pdb"/>
998+
<File Id="Debug.stage.lib.JSON.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debug\stage\lib\JSON.pdb"/>
980999
<File Id="Debug.stage.lib.libeay32.lib" Source="$(var.ProjectDir)\..\..\..\build\Debug\stage\lib\libeay32.lib"/>
1000+
<File Id="Debug.stage.lib.Net.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debug\stage\lib\Net.pdb"/>
1001+
<File Id="Debug.stage.lib.NetSSL.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debug\stage\lib\NetSSL.pdb"/>
1002+
<File Id="Debug.stage.lib.NetSSLWin.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debug\stage\lib\NetSSLWin.pdb"/>
9811003
<File Id="Debug.stage.lib.PocoCryptomdd.lib" Source="$(var.ProjectDir)\..\..\..\build\Debug\stage\lib\PocoCryptomdd.lib"/>
9821004
<File Id="Debug.stage.lib.PocoDatamdd.lib" Source="$(var.ProjectDir)\..\..\..\build\Debug\stage\lib\PocoDatamdd.lib"/>
9831005
<File Id="Debug.stage.lib.PocoEncodingsmdd.lib" Source="$(var.ProjectDir)\..\..\..\build\Debug\stage\lib\PocoEncodingsmdd.lib"/>
@@ -990,7 +1012,13 @@
9901012
<File Id="Debug.stage.lib.PocoUtilmdd.lib" Source="$(var.ProjectDir)\..\..\..\build\Debug\stage\lib\PocoUtilmdd.lib"/>
9911013
<File Id="Debug.stage.lib.PocoXMLmdd.lib" Source="$(var.ProjectDir)\..\..\..\build\Debug\stage\lib\PocoXMLmdd.lib"/>
9921014
<File Id="Debug.stage.lib.PocoZipmdd.lib" Source="$(var.ProjectDir)\..\..\..\build\Debug\stage\lib\PocoZipmdd.lib"/>
1015+
<File Id="Debug.stage.lib.Redis.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debug\stage\lib\Redis.pdb"/>
9931016
<File Id="Debug.stage.lib.ssleay32.lib" Source="$(var.ProjectDir)\..\..\..\build\Debug\stage\lib\ssleay32.lib"/>
1017+
<File Id="Debug.stage.lib.unit_tests.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debug\stage\lib\unit_tests.pdb"/>
1018+
<File Id="Debug.stage.lib.Util.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debug\stage\lib\Util.pdb"/>
1019+
<File Id="Debug.stage.lib.vc142.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debug\stage\lib\vc142.pdb"/>
1020+
<File Id="Debug.stage.lib.XML.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debug\stage\lib\XML.pdb"/>
1021+
<File Id="Debug.stage.lib.Zip.pdb" Source="$(var.ProjectDir)\..\..\..\build\Debug\stage\lib\Zip.pdb"/>
9941022
<File Id="Debug.stage.lib.zlib.lib" Source="$(var.ProjectDir)\..\..\..\build\Debug\stage\lib\zlib.lib"/>
9951023
</Component>
9961024
<Component Directory="X86RELEASELIBFOLDER" Guid="db6ede4d-cc8f-4c26-918a-01de8c5ea904" Id="X86RELEASELIBFOLDER">

BranchSDK/tools/stage.py

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,34 @@ def copyall(src, dst, excludes=[]):
1414
files = [f for f in all_files if f not in rejected]
1515

1616
for f in files:
17-
path = src + "/" + f
18-
if os.path.isdir(path) and os.path.exists(dst + "/" +f):
17+
path = os.path.join(src, f)
18+
destination = os.path.join(dst, f)
19+
if os.path.isdir(path) and os.path.exists(destination):
1920
# copytree fails if the destination directory already exists.
2021
# That's the purpose of this function. Call it recursively in
2122
# this case.
22-
copyall(path, dst + "/" +f, excludes=excludes)
23+
copyall(path, destination, excludes=excludes)
2324
elif os.path.isdir(path):
24-
shutil.copytree(path, dst + "/" + f, ignore=ignores)
25+
shutil.copytree(path, destination, ignore=ignores)
2526
else:
2627
shutil.copy(path, dst)
2728

29+
# TODO: Collapse this and the above and/or rethink this whole idea, remove conan
30+
# from build process. Makes a flat copy of all *.pdb files from a recursive search.
31+
def copy_pdbs(src, dst):
32+
if not os.path.exists(src):
33+
return
34+
all_files = os.listdir(src)
35+
36+
# TODO: Use a re with os.path.splitext or something
37+
for f in [f for f in all_files if f.endswith(".pdb") or f.endswith(".PDB")]:
38+
path = os.path.join(src, f)
39+
shutil.copy(path, dst)
40+
41+
for d in [f for f in all_files if os.path.isdir(os.path.join(src, f))]:
42+
path = os.path.join(src, d)
43+
copy_pdbs(path, dst)
44+
2845
# Generated by conan create
2946
f = open("conan-install.json", "r")
3047
install_data = json.loads(f.read())
@@ -49,8 +66,15 @@ def copyall(src, dst, excludes=[]):
4966
package_name = recipe["name"]
5067

5168
for package in item["packages"]:
69+
# headers and libs are under rootpath
5270
rootpath = package["cpp_info"]["rootpath"]
71+
build_id = package["id"]
72+
5373
print(" " + rootpath + " -> stage")
5474

5575
copyall(rootpath + "/include", "stage/include", excludes=excludes)
5676
copyall(rootpath + "/lib", "stage/lib", excludes=excludes)
77+
78+
# pdbs are under build_path
79+
build_path = os.path.join((os.path.dirname(os.path.dirname(rootpath))), "build", build_id)
80+
copy_pdbs(build_path, "stage/lib")

0 commit comments

Comments
 (0)