|
5 | 5 | import tarfile |
6 | 6 | import zipfile |
7 | 7 | from future.standard_library import install_aliases |
| 8 | +import requests |
8 | 9 | import utility |
9 | 10 |
|
10 | 11 | install_aliases() |
11 | 12 |
|
| 13 | +SQLTOOLSSERVICE_RELEASE = "v3.0.0-release.72" |
| 14 | + |
12 | 15 | SQLTOOLSSERVICE_BASE = os.path.join(utility.ROOT_DIR, 'sqltoolsservice/') |
13 | 16 |
|
14 | 17 | # Supported platform key's must match those in mssqlscript's setup.py. |
15 | 18 | SUPPORTED_PLATFORMS = { |
16 | 19 | 'manylinux1_x86_64': SQLTOOLSSERVICE_BASE + 'manylinux1/' + |
17 | | - 'Microsoft.SqlTools.ServiceLayer-rhel-x64-netcoreapp2.2.tar.gz', |
| 20 | + 'Microsoft.SqlTools.ServiceLayer-rhel-x64-netcoreapp3.1.tar.gz', |
18 | 21 | 'macosx_10_11_intel': SQLTOOLSSERVICE_BASE + 'macosx_10_11_intel/' + |
19 | | - 'Microsoft.SqlTools.ServiceLayer-osx-x64-netcoreapp2.2.tar.gz', |
| 22 | + 'Microsoft.SqlTools.ServiceLayer-osx-x64-netcoreapp3.1.tar.gz', |
20 | 23 | 'win_amd64': SQLTOOLSSERVICE_BASE + 'win_amd64/' + |
21 | | - 'Microsoft.SqlTools.ServiceLayer-win-x64-netcoreapp2.2.zip', |
| 24 | + 'Microsoft.SqlTools.ServiceLayer-win-x64-netcoreapp3.1.zip', |
22 | 25 | 'win32': SQLTOOLSSERVICE_BASE + 'win32/' + |
23 | | - 'Microsoft.SqlTools.ServiceLayer-win-x86-netcoreapp2.2.zip' |
| 26 | + 'Microsoft.SqlTools.ServiceLayer-win-x86-netcoreapp3.1.zip' |
24 | 27 | } |
25 | 28 |
|
26 | 29 | TARGET_DIRECTORY = os.path.abspath(os.path.join(os.path.abspath(__file__), '..', 'bin')) |
27 | 30 |
|
| 31 | +def download_sqltoolsservice_binaries(): |
| 32 | + """ |
| 33 | + Download each for the plaform specific sqltoolsservice packages |
| 34 | + """ |
| 35 | + for packageFilePath in SUPPORTED_PLATFORMS.values(): |
| 36 | + if not os.path.exists(os.path.dirname(packageFilePath)): |
| 37 | + os.makedirs(os.path.dirname(packageFilePath)) |
| 38 | + |
| 39 | + packageFileName = os.path.basename(packageFilePath) |
| 40 | + githubUrl = 'https://github.com/microsoft/sqltoolsservice/releases/download/{}/{}'.format(SQLTOOLSSERVICE_RELEASE, packageFileName) |
| 41 | + print('Downloading {}'.format(githubUrl)) |
| 42 | + r = requests.get(githubUrl) |
| 43 | + with open(packageFilePath, 'wb') as f: |
| 44 | + f.write(r.content) |
28 | 45 |
|
29 | 46 | def copy_sqltoolsservice(platform): |
30 | 47 | """ |
|
0 commit comments