mirror of
https://github.com/Z3Prover/z3
synced 2025-04-22 16:45:31 +00:00
Merge branch 'master' of https://github.com/z3prover/z3
This commit is contained in:
commit
433064dee9
3 changed files with 85 additions and 30 deletions
|
@ -20,19 +20,23 @@ import subprocess
|
|||
import mk_util
|
||||
import mk_project
|
||||
|
||||
data = json.loads(urllib.request.urlopen("https://api.github.com/repos/Z3Prover/z3/releases/latest").read().decode())
|
||||
release_data = json.loads(urllib.request.urlopen("https://api.github.com/repos/Z3Prover/z3/releases/latest").read().decode())
|
||||
release_tag_name = release_data['tag_name']
|
||||
release_tag_ref_data = json.loads(urllib.request.urlopen("https://api.github.com/repos/Z3Prover/z3/git/refs/tags/%s" % release_tag_name).read().decode())
|
||||
release_tag_sha = release_tag_ref_data['object']['sha']
|
||||
release_tag_data = json.loads(urllib.request.urlopen("https://api.github.com/repos/Z3Prover/z3/git/tags/%s" % release_tag_sha).read().decode())
|
||||
|
||||
version_str = data['tag_name']
|
||||
version_num = version_str[3:]
|
||||
release_version = release_tag_name[3:]
|
||||
release_commit = release_tag_data['object']['sha']
|
||||
|
||||
print(version_str)
|
||||
print(release_version)
|
||||
|
||||
def mk_dir(d):
|
||||
if not os.path.exists(d):
|
||||
os.makedirs(d)
|
||||
|
||||
def download_installs():
|
||||
for asset in data['assets']:
|
||||
for asset in release_data['assets']:
|
||||
url = asset['browser_download_url']
|
||||
name = asset['name']
|
||||
print("Downloading ", url)
|
||||
|
@ -42,7 +46,8 @@ def download_installs():
|
|||
os_info = {"z64-ubuntu-14" : ('so', 'ubuntu.14.04-x64'),
|
||||
'ubuntu-16' : ('so', 'ubuntu-x64'),
|
||||
'x64-win' : ('dll', 'win-x64'),
|
||||
'x86-win' : ('dll', 'win-x86'),
|
||||
# Skip x86 as I can't get dotnet build to produce AnyCPU TargetPlatform
|
||||
# 'x86-win' : ('dll', 'win-x86'),
|
||||
'osx' : ('dylib', 'macos'),
|
||||
'debian' : ('so', 'debian.8-x64') }
|
||||
|
||||
|
@ -82,14 +87,15 @@ def unpack():
|
|||
shutil.move("tmp/%s/bin/%s" % (package_dir, b), "out/lib/netstandard1.4/%s" % b)
|
||||
|
||||
def mk_targets():
|
||||
shutil.copy("../src/api/dotnet/Microsoft.Z3.targets.in", "out/Microsoft.Z3.targets")
|
||||
mk_dir("out/build")
|
||||
shutil.copy("../src/api/dotnet/Microsoft.Z3.targets.in", "out/build/Microsoft.Z3.targets")
|
||||
|
||||
def create_nuget_spec():
|
||||
contents = """<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>Microsoft.Z3</id>
|
||||
<version>%s</version>
|
||||
<id>Microsoft.Z3.x64</id>
|
||||
<version>{0}</version>
|
||||
<authors>Microsoft</authors>
|
||||
<description>
|
||||
Z3 is a satisfiability modulo theories solver from Microsoft Research.
|
||||
|
@ -97,19 +103,24 @@ Z3 is a satisfiability modulo theories solver from Microsoft Research.
|
|||
Linux Dependencies:
|
||||
libgomp.so.1 installed
|
||||
</description>
|
||||
<copyright>Copyright Microsoft Corporation. All rights reserved.</copyright>
|
||||
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
|
||||
<tags>smt constraint solver theorem prover</tags>
|
||||
<iconUrl>https://raw.githubusercontent.com/Z3Prover/z3/master/package/icon.jpg</iconUrl>
|
||||
<iconUrl>https://raw.githubusercontent.com/Z3Prover/z3/{1}/package/icon.jpg</iconUrl>
|
||||
<projectUrl>https://github.com/Z3Prover/z3</projectUrl>
|
||||
<licenseUrl>https://raw.githubusercontent.com/Z3Prover/z3/master/LICENSE.txt</licenseUrl>
|
||||
<repository type="git" url="https://github.com/Z3Prover/z3.git" />
|
||||
<licenseUrl>https://raw.githubusercontent.com/Z3Prover/z3/{1}/LICENSE.txt</licenseUrl>
|
||||
<repository
|
||||
type="git"
|
||||
url="https://github.com/Z3Prover/z3.git"
|
||||
branch="master"
|
||||
commit="{1}"
|
||||
/>
|
||||
<requireLicenseAcceptance>true</requireLicenseAcceptance>
|
||||
<language>en</language>
|
||||
</metadata>
|
||||
</package>"""
|
||||
</package>""".format(release_version, release_commit)
|
||||
|
||||
with open("out/Microsoft.Z3.nuspec", 'w') as f:
|
||||
f.write(contents % version_num)
|
||||
with open("out/Microsoft.Z3.x64.nuspec", 'w') as f:
|
||||
f.write(contents)
|
||||
|
||||
def create_nuget_package():
|
||||
subprocess.call(["nuget", "pack"], cwd="out")
|
||||
|
@ -128,8 +139,8 @@ nuget_sign_input = """
|
|||
"SignRequestFiles": [
|
||||
{
|
||||
"CustomerCorrelationId": "42fc9577-af9e-4ac9-995d-1788d8721d17",
|
||||
"SourceLocation": "Microsoft.Z3.%s.nupkg",
|
||||
"DestinationLocation": "Microsoft.Z3.%s.nupkg"
|
||||
"SourceLocation": "Microsoft.Z3.x64.%s.nupkg",
|
||||
"DestinationLocation": "Microsoft.Z3.x64.%s.nupkg"
|
||||
}
|
||||
],
|
||||
"SigningInfo": {
|
||||
|
@ -155,11 +166,11 @@ nuget_sign_input = """
|
|||
}"""
|
||||
|
||||
def sign_nuget_package():
|
||||
package_name = "Microsoft.Z3.%s.nupkg" % version_num
|
||||
package_name = "Microsoft.Z3.x64.%s.nupkg" % release_version
|
||||
input_file = "out/nuget_sign_input.json"
|
||||
output_path = os.path.abspath("out").replace("\\","\\\\")
|
||||
with open(input_file, 'w') as f:
|
||||
f.write(nuget_sign_input % (output_path, output_path, version_num, version_num))
|
||||
f.write(nuget_sign_input % (output_path, output_path, release_version, release_version))
|
||||
subprocess.call(["EsrpClient.exe", "sign", "-a", "authorization.json", "-p", "policy.json", "-i", input_file, "-o", "out\\diagnostics.json"])
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue