mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	start script on assembling platform binaries to wrap with nuget install
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
		
							parent
							
								
									4f4463b2b7
								
							
						
					
					
						commit
						c6c4dc4563
					
				
					 1 changed files with 62 additions and 0 deletions
				
			
		
							
								
								
									
										62
									
								
								scripts/mk_nuget_release.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								scripts/mk_nuget_release.py
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,62 @@
 | 
			
		|||
# 
 | 
			
		||||
# Copyright (c) 2018 Microsoft Corporation
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
# 1. download releases from github
 | 
			
		||||
# 2. copy over libz3.dll for the different architectures
 | 
			
		||||
# 3. copy over Microsoft.Z3.dll from suitable distribution
 | 
			
		||||
# 4. copy nuspec file from packages
 | 
			
		||||
# 5. call nuget pack
 | 
			
		||||
 | 
			
		||||
import json
 | 
			
		||||
import os
 | 
			
		||||
import urllib.request
 | 
			
		||||
import zipfile
 | 
			
		||||
import sys
 | 
			
		||||
import os.path
 | 
			
		||||
 | 
			
		||||
data = json.loads(urllib.request.urlopen("https://api.github.com/repos/Z3Prover/z3/releases/latest").read().decode())
 | 
			
		||||
 | 
			
		||||
version_str = data['tag_name']
 | 
			
		||||
 | 
			
		||||
def mk_dir(d):
 | 
			
		||||
    if not os.path.exists(d):
 | 
			
		||||
        os.makedirs(d)
 | 
			
		||||
 | 
			
		||||
def download_installs():
 | 
			
		||||
    for asset in data['assets']:
 | 
			
		||||
        url = asset['browser_download_url']
 | 
			
		||||
        name = asset['name']
 | 
			
		||||
        print("Downloading ", url)
 | 
			
		||||
        sys.stdout.flush()
 | 
			
		||||
        urllib.request.urlretrieve(url, "packages/%s" % name)
 | 
			
		||||
 | 
			
		||||
os_names = ["ubuntu-14", "ubuntu-16", "win", "debian", "osx"]
 | 
			
		||||
 | 
			
		||||
def unpack():
 | 
			
		||||
    for f in os.listdir("packages"):
 | 
			
		||||
        if f.endswith("zip") and "x64" in f:
 | 
			
		||||
            print(f)
 | 
			
		||||
            # determine os from os_names
 | 
			
		||||
            # instead of this string manipulation.
 | 
			
		||||
            
 | 
			
		||||
            name = os.path.splitext(f)[0]
 | 
			
		||||
            os_name = name[name.find("x64")+4:]
 | 
			
		||||
            os_name = os_name[:os_name.find("-")]
 | 
			
		||||
            print(os_name)
 | 
			
		||||
            
 | 
			
		||||
            zip_ref = zipfile.ZipFile("packages/%s" % f, 'r')
 | 
			
		||||
            path = "out/%s" % os_name
 | 
			
		||||
            zip_ref.extract("%s/bin/libz3.so" % name)
 | 
			
		||||
            
 | 
			
		||||
    # unzip files in packages
 | 
			
		||||
    pass
 | 
			
		||||
 | 
			
		||||
def main():
 | 
			
		||||
    mk_dir("packages")
 | 
			
		||||
#   download_installs()
 | 
			
		||||
#    create_nuget_dir()
 | 
			
		||||
    unpack()
 | 
			
		||||
#    create_nuget_package()
 | 
			
		||||
    
 | 
			
		||||
main()
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue