3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-10 19:27:06 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-12-21 13:43:50 -08:00
parent d67f9fb3f1
commit 0c94d6dab6
2 changed files with 21 additions and 10 deletions

View file

@ -43,7 +43,7 @@ def replace(src, dst):
except:
shutil.move(src, dst)
def unpack(packages):
def unpack(packages, symbols):
# unzip files in packages
# out
# +- runtimes
@ -64,11 +64,14 @@ def unpack(packages):
mk_dir(f"out/runtimes/{dst}/native")
replace(f"tmp/{package_dir}/bin/libz3.{ext}", f"out/runtimes/{dst}/native/libz3.{ext}")
if "x64-win" in f:
zip_ref.extract(f"{package_dir}/bin/libz3.pdb", "tmp")
mk_dir(f"out/runtimes/{dst}/native")
replace(f"tmp/{package_dir}/bin/libz3.pdb", f"out/runtimes/{dst}/native/libz3.pdb")
mk_dir("out/lib/netstandard1.4/")
for b in ["Microsoft.Z3.dll", "Microsoft.Z3.pdb"]:
if symbols:
zip_ref.extract(f"{package_dir}/bin/libz3.pdb", "tmp")
replace(f"tmp/{package_dir}/bin/libz3.pdb", f"out/runtimes/{dst}/native/libz3.pdb")
files = ["Microsoft.Z3.dll"]
if symbols:
files += ["Microsoft.Z3.pdb"]
for b in files:
zip_ref.extract(f"{package_dir}/bin/{b}", "tmp")
replace(f"tmp/{package_dir}/bin/{b}", f"out/lib/netstandard1.4/{b}")
@ -82,7 +85,7 @@ def mk_icon(source_root):
print(shutil.copy(f"{source_root}/resources/icon.jpg", "out/content/icon.jpg"))
def create_nuget_spec(version, repo, branch, commit):
def create_nuget_spec(version, repo, branch, commit, symbols):
contents = """<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
@ -109,7 +112,10 @@ Linux Dependencies:
</metadata>
</package>""".format(version, repo, branch, commit)
print(contents)
with open("out/Microsoft.Z3.x64.nuspec", 'w') as f:
prefix = ""
if symbols:
prefix = "s"
with open("out/Microsoft.Z3.x64.{prefix}nuspec", 'w') as f:
f.write(contents)
def main():
@ -119,11 +125,14 @@ def main():
branch = sys.argv[4]
commit = sys.argv[5]
source_root = sys.argv[6]
symbols = False
if len(sys.argv) > 7 and "symbols" == sys.argv[7]:
symbols = True
print(packages)
mk_dir(packages)
unpack(packages)
unpack(packages, symbols)
mk_targets(source_root)
mk_icon(source_root)
create_nuget_spec(version, repo, branch, commit)
create_nuget_spec(version, repo, branch, commit, symbols)
main()

View file

@ -137,6 +137,7 @@ stages:
$(Build.SourceBranchName)
$(Build.SourceVersion)
$(Build.SourcesDirectory)
nosymbols
- task: NuGetToolInstaller@0
inputs:
versionSpec: 5.x
@ -166,11 +167,12 @@ stages:
$(Build.SourceBranchName)
$(Build.SourceVersion)
$(Build.SourcesDirectory)
symbols
- task: NugetCommand@2
displayName: 'NuGet Pack Symbols'
inputs:
command: custom
arguments: 'pack $(Agent.TempDirectory)\package\out\Microsoft.Z3.x64.nuspec -OutputDirectory $(Build.ArtifactStagingDirectory) -Verbosity detailed -Symbols -SymbolPackageFormat snupkg -BasePath $(Agent.TempDirectory)\package\out'
arguments: 'pack $(Agent.TempDirectory)\package\out\Microsoft.Z3.x64.snuspec -OutputDirectory $(Build.ArtifactStagingDirectory) -Verbosity detailed -Symbols -SymbolPackageFormat snupkg -BasePath $(Agent.TempDirectory)\package\out'
- task: PublishPipelineArtifact@1
inputs:
targetPath: $(Build.ArtifactStagingDirectory)