From a121c7ef9b51e89157c3da6b995efbdc61eb44d0 Mon Sep 17 00:00:00 2001 From: Adam Reeve Date: Tue, 17 Oct 2023 12:49:21 +1300 Subject: [PATCH] Build and project tidy up * Remove appveyor config and build scripts * Only support netstandard2.0 * Store signing key unencrypted (as recommended at https://learn.microsoft.com/en-us/dotnet/standard/library-guidance/strong-naming#create-strong-named-net-libraries) --- SemanticVersioning.sln | 47 +- appveyor.yml | 28 - build/build.ps1 | 12 - build/decrypt-snk.ps1 | 12 - build/dotnet-install.ps1 | 510 ------------------ build/install.ps1 | 1 - build/semver-key.snk | Bin 0 -> 596 bytes build/semver-key.snk.enc | 6 - build/test.ps1 | 11 - src/SemanticVersioning/InternalsVisibleTo.cs | 8 + .../Properties/AssemblyInfo.cs | 20 - .../SemanticVersioning.csproj | 33 +- .../SemanticVersioning.Tests.csproj | 6 +- 13 files changed, 16 insertions(+), 678 deletions(-) delete mode 100644 appveyor.yml delete mode 100644 build/build.ps1 delete mode 100644 build/decrypt-snk.ps1 delete mode 100644 build/dotnet-install.ps1 delete mode 100644 build/install.ps1 create mode 100644 build/semver-key.snk delete mode 100644 build/semver-key.snk.enc delete mode 100644 build/test.ps1 create mode 100644 src/SemanticVersioning/InternalsVisibleTo.cs delete mode 100644 src/SemanticVersioning/Properties/AssemblyInfo.cs diff --git a/SemanticVersioning.sln b/SemanticVersioning.sln index cfeca2d..5f5e943 100644 --- a/SemanticVersioning.sln +++ b/SemanticVersioning.sln @@ -5,21 +5,11 @@ MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution", "Solution", "{04DC58CE-98CC-4B50-ABFE-F7CC430214EA}" ProjectSection(SolutionItems) = preProject .gitignore = .gitignore - .travis.yml = .travis.yml - appveyor.yml = appveyor.yml LICENSE = LICENSE README.md = README.md EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{2812B094-14CA-4639-BCD1-627AB1F2D143}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{53D398CA-9DAD-4AE8-B902-9ABA523366A2}" - ProjectSection(SolutionItems) = preProject - build\build.ps1 = build\build.ps1 - build\install.ps1 = build\install.ps1 - build\installDotnet.ps1 = build\installDotnet.ps1 - build\test.ps1 = build\test.ps1 - EndProjectSection +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{2812B094-14CA-4639-BCD1-627AB1F2D143}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{92C43A55-E62D-4E0B-A2EC-C7762A426CD7}" EndProject @@ -72,39 +62,4 @@ Global GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {67BB09FF-65F5-45FB-89BB-2ED3BBCA7D43} EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution - StartupItem = SemanticVersioning\SemanticVersioning.csproj - Policies = $0 - $0.DotNetNamingPolicy = $1 - $1.DirectoryNamespaceAssociation = None - $1.ResourceNamePolicy = FileFormatDefault - $0.TextStylePolicy = $7 - $2.FileWidth = 120 - $2.inheritsSet = VisualStudio - $2.inheritsScope = text/plain - $2.scope = text/x-csharp - $0.CSharpFormattingPolicy = $3 - $3.AfterDelegateDeclarationParameterComma = True - $3.inheritsSet = Mono - $3.inheritsScope = text/x-csharp - $3.scope = text/x-csharp - $4.FileWidth = 120 - $4.inheritsSet = VisualStudio - $4.inheritsScope = text/plain - $4.scope = text/plain - $5.FileWidth = 120 - $5.inheritsSet = VisualStudio - $5.inheritsScope = text/plain - $5.scope = application/config+xml - $0.XmlFormattingPolicy = $8 - $6.inheritsSet = null - $6.scope = application/config+xml - $7.FileWidth = 120 - $7.inheritsSet = VisualStudio - $7.inheritsScope = text/plain - $7.scope = application/xml - $8.inheritsSet = Mono - $8.inheritsScope = application/xml - $8.scope = application/xml - EndGlobalSection EndGlobal diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 35c9f13..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: 2.0.{build} -branches: - only: - - master -pull_requests: - do_not_increment_build_number: true -install: - - nuget install secure-file -ExcludeVersion - - ps: .\build\decrypt-snk.ps1 - - ps: .\build\install.ps1 -build_script: -- ps: .\build\build.ps1 $env:APPVEYOR_BUILD_VERSION $env:APPVEYOR_REPO_TAG_NAME -test_script: -- ps: .\build\test.ps1 -artifacts: -- path: '**\*.nupkg' -deploy: -- provider: NuGet - api_key: - secure: WTwBtSCr00tsRs7grEpu8r5la7vdCtjT9KHnWfkcnwKEjaPxcTU9ZV+mTP5O9awl - skip_symbols: true - artifact: /SemanticVersioning.*\.nupkg/ - on: - branch: master # release from master branch only - appveyor_repo_tag: true # deploy on tag push only -environment: - ENCRYPTION_KEY: - secure: hbiBHn0JfRy73jn/e8rUKMI5Z3T78zXCmpD8dRexuc3uJivS5I5WNf6JiZOdEM8G diff --git a/build/build.ps1 b/build/build.ps1 deleted file mode 100644 index f04f198..0000000 --- a/build/build.ps1 +++ /dev/null @@ -1,12 +0,0 @@ -param ( - [string]$BuildVersionNumber=$(throw "-BuildVersionNumber is required."), - [string]$TagVersionNumber -) - -& dotnet restore .\src\SemanticVersioning\SemanticVersioning.csproj #2>1 - -if ($TagVersionNumber) { - & dotnet pack .\src\SemanticVersioning\SemanticVersioning.csproj -c Release /p:VersionPrefix="$TagVersionNumber" 2>&1 -} else { - & dotnet pack .\src\SemanticVersioning\SemanticVersioning.csproj -c Release /p:VersionPrefix="$BuildVersionNumber" 2>&1 -} diff --git a/build/decrypt-snk.ps1 b/build/decrypt-snk.ps1 deleted file mode 100644 index 44f31f5..0000000 --- a/build/decrypt-snk.ps1 +++ /dev/null @@ -1,12 +0,0 @@ -if ($env:APPVEYOR_PULL_REQUEST_NUMBER) { - Write-Host "Build is for a pull request, not decrypting SNK file" -} else { - Write-Host "Decrypting SNK file" - .\secure-file\tools\secure-file -decrypt .\build\semver-key.snk.enc -secret $env:ENCRYPTION_KEY -out .\build\semver-key.snk - - Write-Host "Updating AssemblyInfo.cs" - $assemblyInfo = '.\src\SemanticVersioning\Properties\AssemblyInfo.cs' - (Get-Content $assemblyInfo) | - Foreach-Object {$_ -replace 'InternalsVisibleTo\("SemanticVersioning.Tests"\)', 'InternalsVisibleTo("SemanticVersioning.Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010019351d4288017757df1b69b4d0da9a775e6eec498ec93d209d6db4d62e9962476c8da01545cc47335cdc39ba803f4db368ce5f2fdd6cd395196f3328f9039dccdeb3c0f9aece7b8751cd3bc2cb2297d4f463a376eff61b7295b96af9b9faf3eef6005dc967a7a97431cc42cff72e60f05797f3e16186f8fbaf26074e96a2b5e1")'} | - Out-File $assemblyInfo -} diff --git a/build/dotnet-install.ps1 b/build/dotnet-install.ps1 deleted file mode 100644 index 89e6e74..0000000 --- a/build/dotnet-install.ps1 +++ /dev/null @@ -1,510 +0,0 @@ -# -# Copyright (c) .NET Foundation and contributors. All rights reserved. -# Licensed under the MIT license. See LICENSE file in the project root for full license information. -# - -<# -.SYNOPSIS - Installs dotnet cli -.DESCRIPTION - Installs dotnet cli. If dotnet installation already exists in the given directory - it will update it only if the requested version differs from the one already installed. -.PARAMETER Channel - Default: LTS - Download from the Channel specified. Possible values: - - Current - most current release - - LTS - most current supported release - - 2-part version in a format A.B - represents a specific release - examples: 2.0; 1.0 - - Branch name - examples: release/2.0.0; Master -.PARAMETER Version - Default: latest - Represents a build version on specific channel. Possible values: - - latest - most latest build on specific channel - - coherent - most latest coherent build on specific channel - coherent applies only to SDK downloads - - 3-part version in a format A.B.C - represents specific version of build - examples: 2.0.0-preview2-006120; 1.1.0 -.PARAMETER InstallDir - Default: %LocalAppData%\Microsoft\dotnet - Path to where to install dotnet. Note that binaries will be placed directly in a given directory. -.PARAMETER Architecture - Default: - this value represents currently running OS architecture - Architecture of dotnet binaries to be installed. - Possible values are: , x64 and x86 -.PARAMETER SharedRuntime - Default: false - Installs just the shared runtime bits, not the entire SDK -.PARAMETER DryRun - If set it will not perform installation but instead display what command line to use to consistently install - currently requested version of dotnet cli. In example if you specify version 'latest' it will display a link - with specific version so that this command can be used deterministicly in a build script. - It also displays binaries location if you prefer to install or download it yourself. -.PARAMETER NoPath - By default this script will set environment variable PATH for the current process to the binaries folder inside installation folder. - If set it will display binaries location but not set any environment variable. -.PARAMETER Verbose - Displays diagnostics information. -.PARAMETER AzureFeed - Default: https://dotnetcli.azureedge.net/dotnet - This parameter typically is not changed by the user. - It allows to change URL for the Azure feed used by this installer. -.PARAMETER UncachedFeed - This parameter typically is not changed by the user. - It allows to change URL for the Uncached feed used by this installer. -.PARAMETER ProxyAddress - If set, the installer will use the proxy when making web requests -.PARAMETER ProxyUseDefaultCredentials - Default: false - Use default credentials, when using proxy address. -.PARAMETER SkipNonVersionedFiles - Default: false - Skips installing non-versioned files if they already exist, such as dotnet.exe. -#> -[cmdletbinding()] -param( - [string]$Channel="LTS", - [string]$Version="Latest", - [string]$InstallDir="", - [string]$Architecture="", - [switch]$SharedRuntime, - [switch]$DryRun, - [switch]$NoPath, - [string]$AzureFeed="https://dotnetcli.azureedge.net/dotnet", - [string]$UncachedFeed="https://dotnetcli.blob.core.windows.net/dotnet", - [string]$ProxyAddress, - [switch]$ProxyUseDefaultCredentials, - [switch]$SkipNonVersionedFiles -) - -Set-StrictMode -Version Latest -$ErrorActionPreference="Stop" -$ProgressPreference="SilentlyContinue" - -$BinFolderRelativePath="" - -# example path with regex: shared/1.0.0-beta-12345/somepath -$VersionRegEx="/\d+\.\d+[^/]+/" -$OverrideNonVersionedFiles = !$SkipNonVersionedFiles - -function Say($str) { - Write-Host "dotnet-install: $str" -} - -function Say-Verbose($str) { - Write-Verbose "dotnet-install: $str" -} - -function Say-Invocation($Invocation) { - $command = $Invocation.MyCommand; - $args = (($Invocation.BoundParameters.Keys | foreach { "-$_ `"$($Invocation.BoundParameters[$_])`"" }) -join " ") - Say-Verbose "$command $args" -} - -function Invoke-With-Retry([ScriptBlock]$ScriptBlock, [int]$MaxAttempts = 3, [int]$SecondsBetweenAttempts = 1) { - $Attempts = 0 - - while ($true) { - try { - return $ScriptBlock.Invoke() - } - catch { - $Attempts++ - if ($Attempts -lt $MaxAttempts) { - Start-Sleep $SecondsBetweenAttempts - } - else { - throw - } - } - } -} - -function Get-Machine-Architecture() { - Say-Invocation $MyInvocation - - # possible values: AMD64, IA64, x86 - return $ENV:PROCESSOR_ARCHITECTURE -} - -# TODO: Architecture and CLIArchitecture should be unified -function Get-CLIArchitecture-From-Architecture([string]$Architecture) { - Say-Invocation $MyInvocation - - switch ($Architecture.ToLower()) { - { $_ -eq "" } { return Get-CLIArchitecture-From-Architecture $(Get-Machine-Architecture) } - { ($_ -eq "amd64") -or ($_ -eq "x64") } { return "x64" } - { $_ -eq "x86" } { return "x86" } - default { throw "Architecture not supported. If you think this is a bug, please report it at https://github.com/dotnet/cli/issues" } - } -} - -function Get-Version-Info-From-Version-Text([string]$VersionText) { - Say-Invocation $MyInvocation - - $Data = @($VersionText.Split([char[]]@(), [StringSplitOptions]::RemoveEmptyEntries)); - - $VersionInfo = @{} - $VersionInfo.CommitHash = $Data[0].Trim() - $VersionInfo.Version = $Data[1].Trim() - return $VersionInfo -} - -function Load-Assembly([string] $Assembly) { - try { - Add-Type -Assembly $Assembly | Out-Null - } - catch { - # On Nano Server, Powershell Core Edition is used. Add-Type is unable to resolve base class assemblies because they are not GAC'd. - # Loading the base class assemblies is not unnecessary as the types will automatically get resolved. - } -} - -function GetHTTPResponse([Uri] $Uri) -{ - Invoke-With-Retry( - { - - $HttpClient = $null - - try { - # HttpClient is used vs Invoke-WebRequest in order to support Nano Server which doesn't support the Invoke-WebRequest cmdlet. - Load-Assembly -Assembly System.Net.Http - - if(-not $ProxyAddress) { - try { - # Despite no proxy being explicitly specified, we may still be behind a default proxy - $DefaultProxy = [System.Net.WebRequest]::DefaultWebProxy; - if($DefaultProxy -and (-not $DefaultProxy.IsBypassed($Uri))) { - $ProxyAddress = $DefaultProxy.GetProxy($Uri).OriginalString - $ProxyUseDefaultCredentials = $true - } - } catch { - # Eat the exception and move forward as the above code is an attempt - # at resolving the DefaultProxy that may not have been a problem. - $ProxyAddress = $null - Say-Verbose("Exception ignored: $_.Exception.Message - moving forward...") - } - } - - if($ProxyAddress) { - $HttpClientHandler = New-Object System.Net.Http.HttpClientHandler - $HttpClientHandler.Proxy = New-Object System.Net.WebProxy -Property @{Address=$ProxyAddress;UseDefaultCredentials=$ProxyUseDefaultCredentials} - $HttpClient = New-Object System.Net.Http.HttpClient -ArgumentList $HttpClientHandler - } - else { - $HttpClient = New-Object System.Net.Http.HttpClient - } - # Default timeout for HttpClient is 100s. For a 50 MB download this assumes 500 KB/s average, any less will time out - # 10 minutes allows it to work over much slower connections. - $HttpClient.Timeout = New-TimeSpan -Minutes 10 - $Response = $HttpClient.GetAsync($Uri).Result - if (($Response -eq $null) -or (-not ($Response.IsSuccessStatusCode))) { - $ErrorMsg = "Failed to download $Uri." - if ($Response -ne $null) { - $ErrorMsg += " $Response" - } - - throw $ErrorMsg - } - - return $Response - } - finally { - if ($HttpClient -ne $null) { - $HttpClient.Dispose() - } - } - }) -} - - -function Get-Latest-Version-Info([string]$AzureFeed, [string]$Channel, [bool]$Coherent) { - Say-Invocation $MyInvocation - - $VersionFileUrl = $null - if ($SharedRuntime) { - $VersionFileUrl = "$UncachedFeed/Runtime/$Channel/latest.version" - } - else { - if ($Coherent) { - $VersionFileUrl = "$UncachedFeed/Sdk/$Channel/latest.coherent.version" - } - else { - $VersionFileUrl = "$UncachedFeed/Sdk/$Channel/latest.version" - } - } - - $Response = GetHTTPResponse -Uri $VersionFileUrl - $StringContent = $Response.Content.ReadAsStringAsync().Result - - switch ($Response.Content.Headers.ContentType) { - { ($_ -eq "application/octet-stream") } { $VersionText = $StringContent } - { ($_ -eq "text/plain") } { $VersionText = $StringContent } - { ($_ -eq "text/plain; charset=UTF-8") } { $VersionText = $StringContent } - default { throw "``$Response.Content.Headers.ContentType`` is an unknown .version file content type." } - } - - $VersionInfo = Get-Version-Info-From-Version-Text $VersionText - - return $VersionInfo -} - - -function Get-Specific-Version-From-Version([string]$AzureFeed, [string]$Channel, [string]$Version) { - Say-Invocation $MyInvocation - - switch ($Version.ToLower()) { - { $_ -eq "latest" } { - $LatestVersionInfo = Get-Latest-Version-Info -AzureFeed $AzureFeed -Channel $Channel -Coherent $False - return $LatestVersionInfo.Version - } - { $_ -eq "coherent" } { - $LatestVersionInfo = Get-Latest-Version-Info -AzureFeed $AzureFeed -Channel $Channel -Coherent $True - return $LatestVersionInfo.Version - } - default { return $Version } - } -} - -function Get-Download-Link([string]$AzureFeed, [string]$SpecificVersion, [string]$CLIArchitecture) { - Say-Invocation $MyInvocation - - if ($SharedRuntime) { - $PayloadURL = "$AzureFeed/Runtime/$SpecificVersion/dotnet-runtime-$SpecificVersion-win-$CLIArchitecture.zip" - } - else { - $PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-sdk-$SpecificVersion-win-$CLIArchitecture.zip" - } - - Say-Verbose "Constructed primary payload URL: $PayloadURL" - - return $PayloadURL -} - -function Get-LegacyDownload-Link([string]$AzureFeed, [string]$SpecificVersion, [string]$CLIArchitecture) { - Say-Invocation $MyInvocation - - if ($SharedRuntime) { - $PayloadURL = "$AzureFeed/Runtime/$SpecificVersion/dotnet-win-$CLIArchitecture.$SpecificVersion.zip" - } - else { - $PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-dev-win-$CLIArchitecture.$SpecificVersion.zip" - } - - Say-Verbose "Constructed legacy payload URL: $PayloadURL" - - return $PayloadURL -} - -function Get-User-Share-Path() { - Say-Invocation $MyInvocation - - $InstallRoot = $env:DOTNET_INSTALL_DIR - if (!$InstallRoot) { - $InstallRoot = "$env:LocalAppData\Microsoft\dotnet" - } - return $InstallRoot -} - -function Resolve-Installation-Path([string]$InstallDir) { - Say-Invocation $MyInvocation - - if ($InstallDir -eq "") { - return Get-User-Share-Path - } - return $InstallDir -} - -function Get-Version-Info-From-Version-File([string]$InstallRoot, [string]$RelativePathToVersionFile) { - Say-Invocation $MyInvocation - - $VersionFile = Join-Path -Path $InstallRoot -ChildPath $RelativePathToVersionFile - Say-Verbose "Local version file: $VersionFile" - - if (Test-Path $VersionFile) { - $VersionText = cat $VersionFile - Say-Verbose "Local version file text: $VersionText" - return Get-Version-Info-From-Version-Text $VersionText - } - - Say-Verbose "Local version file not found." - - return $null -} - -function Is-Dotnet-Package-Installed([string]$InstallRoot, [string]$RelativePathToPackage, [string]$SpecificVersion) { - Say-Invocation $MyInvocation - - $DotnetPackagePath = Join-Path -Path $InstallRoot -ChildPath $RelativePathToPackage | Join-Path -ChildPath $SpecificVersion - Say-Verbose "Is-Dotnet-Package-Installed: Path to a package: $DotnetPackagePath" - return Test-Path $DotnetPackagePath -PathType Container -} - -function Get-Absolute-Path([string]$RelativeOrAbsolutePath) { - # Too much spam - # Say-Invocation $MyInvocation - - return $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($RelativeOrAbsolutePath) -} - -function Get-Path-Prefix-With-Version($path) { - $match = [regex]::match($path, $VersionRegEx) - if ($match.Success) { - return $entry.FullName.Substring(0, $match.Index + $match.Length) - } - - return $null -} - -function Get-List-Of-Directories-And-Versions-To-Unpack-From-Dotnet-Package([System.IO.Compression.ZipArchive]$Zip, [string]$OutPath) { - Say-Invocation $MyInvocation - - $ret = @() - foreach ($entry in $Zip.Entries) { - $dir = Get-Path-Prefix-With-Version $entry.FullName - if ($dir -ne $null) { - $path = Get-Absolute-Path $(Join-Path -Path $OutPath -ChildPath $dir) - if (-Not (Test-Path $path -PathType Container)) { - $ret += $dir - } - } - } - - $ret = $ret | Sort-Object | Get-Unique - - $values = ($ret | foreach { "$_" }) -join ";" - Say-Verbose "Directories to unpack: $values" - - return $ret -} - -# Example zip content and extraction algorithm: -# Rule: files if extracted are always being extracted to the same relative path locally -# .\ -# a.exe # file does not exist locally, extract -# b.dll # file exists locally, override only if $OverrideFiles set -# aaa\ # same rules as for files -# ... -# abc\1.0.0\ # directory contains version and exists locally -# ... # do not extract content under versioned part -# abc\asd\ # same rules as for files -# ... -# def\ghi\1.0.1\ # directory contains version and does not exist locally -# ... # extract content -function Extract-Dotnet-Package([string]$ZipPath, [string]$OutPath) { - Say-Invocation $MyInvocation - - Load-Assembly -Assembly System.IO.Compression.FileSystem - Set-Variable -Name Zip - try { - $Zip = [System.IO.Compression.ZipFile]::OpenRead($ZipPath) - - $DirectoriesToUnpack = Get-List-Of-Directories-And-Versions-To-Unpack-From-Dotnet-Package -Zip $Zip -OutPath $OutPath - - foreach ($entry in $Zip.Entries) { - $PathWithVersion = Get-Path-Prefix-With-Version $entry.FullName - if (($PathWithVersion -eq $null) -Or ($DirectoriesToUnpack -contains $PathWithVersion)) { - $DestinationPath = Get-Absolute-Path $(Join-Path -Path $OutPath -ChildPath $entry.FullName) - $DestinationDir = Split-Path -Parent $DestinationPath - $OverrideFiles=$OverrideNonVersionedFiles -Or (-Not (Test-Path $DestinationPath)) - if ((-Not $DestinationPath.EndsWith("\")) -And $OverrideFiles) { - New-Item -ItemType Directory -Force -Path $DestinationDir | Out-Null - [System.IO.Compression.ZipFileExtensions]::ExtractToFile($entry, $DestinationPath, $OverrideNonVersionedFiles) - } - } - } - } - finally { - if ($Zip -ne $null) { - $Zip.Dispose() - } - } -} - -function DownloadFile([Uri]$Uri, [string]$OutPath) { - $Stream = $null - - try { - $Response = GetHTTPResponse -Uri $Uri - $Stream = $Response.Content.ReadAsStreamAsync().Result - $File = [System.IO.File]::Create($OutPath) - $Stream.CopyTo($File) - $File.Close() - } - finally { - if ($Stream -ne $null) { - $Stream.Dispose() - } - } -} - -function Prepend-Sdk-InstallRoot-To-Path([string]$InstallRoot, [string]$BinFolderRelativePath) { - $BinPath = Get-Absolute-Path $(Join-Path -Path $InstallRoot -ChildPath $BinFolderRelativePath) - if (-Not $NoPath) { - Say "Adding to current process PATH: `"$BinPath`". Note: This change will not be visible if PowerShell was run as a child process." - $env:path = "$BinPath;" + $env:path - } - else { - Say "Binaries of dotnet can be found in $BinPath" - } -} - -$CLIArchitecture = Get-CLIArchitecture-From-Architecture $Architecture -$SpecificVersion = Get-Specific-Version-From-Version -AzureFeed $AzureFeed -Channel $Channel -Version $Version -$DownloadLink = Get-Download-Link -AzureFeed $AzureFeed -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture -$LegacyDownloadLink = Get-LegacyDownload-Link -AzureFeed $AzureFeed -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture - -if ($DryRun) { - Say "Payload URLs:" - Say "Primary - $DownloadLink" - Say "Legacy - $LegacyDownloadLink" - Say "Repeatable invocation: .\$($MyInvocation.Line)" - exit 0 -} - -$InstallRoot = Resolve-Installation-Path $InstallDir -Say-Verbose "InstallRoot: $InstallRoot" - -$IsSdkInstalled = Is-Dotnet-Package-Installed -InstallRoot $InstallRoot -RelativePathToPackage "sdk" -SpecificVersion $SpecificVersion -Say-Verbose ".NET SDK installed? $IsSdkInstalled" -if ($IsSdkInstalled) { - Say ".NET SDK version $SpecificVersion is already installed." - Prepend-Sdk-InstallRoot-To-Path -InstallRoot $InstallRoot -BinFolderRelativePath $BinFolderRelativePath - exit 0 -} - -New-Item -ItemType Directory -Force -Path $InstallRoot | Out-Null - -$installDrive = $((Get-Item $InstallRoot).PSDrive.Name); -$free = Get-CimInstance -Class win32_logicaldisk | where Deviceid -eq "${installDrive}:" -if ($free.Freespace / 1MB -le 100 ) { - Say "There is not enough disk space on drive ${installDrive}:" - exit 0 -} - -$ZipPath = [System.IO.Path]::combine([System.IO.Path]::GetTempPath(), [System.IO.Path]::GetRandomFileName()) -Say-Verbose "Zip path: $ZipPath" -Say "Downloading link: $DownloadLink" -try { - DownloadFile -Uri $DownloadLink -OutPath $ZipPath -} -catch { - Say "Cannot download: $DownloadLink" - $DownloadLink = $LegacyDownloadLink - $ZipPath = [System.IO.Path]::combine([System.IO.Path]::GetTempPath(), [System.IO.Path]::GetRandomFileName()) - Say-Verbose "Legacy zip path: $ZipPath" - Say "Downloading legacy link: $DownloadLink" - DownloadFile -Uri $DownloadLink -OutPath $ZipPath -} - -Say "Extracting zip from $DownloadLink" -Extract-Dotnet-Package -ZipPath $ZipPath -OutPath $InstallRoot - -Remove-Item $ZipPath - -Prepend-Sdk-InstallRoot-To-Path -InstallRoot $InstallRoot -BinFolderRelativePath $BinFolderRelativePath - -Say "Installation finished" -exit 0 diff --git a/build/install.ps1 b/build/install.ps1 deleted file mode 100644 index 2b4ca7c..0000000 --- a/build/install.ps1 +++ /dev/null @@ -1 +0,0 @@ -Invoke-Expression ".\build\dotnet-install.ps1 -Channel Current -Version 2.0.0" diff --git a/build/semver-key.snk b/build/semver-key.snk new file mode 100644 index 0000000000000000000000000000000000000000..ae8a55f218058c783b04277dcb0c6bf5103af212 GIT binary patch literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50096QH622T0e4s58)>xA+M0J>ZtO{p$vq&Q zZM4=dnPNw5ji41p%ttd^+&Q{{KTWe}&R;LxY}1t)Z!;+Q1D(v?v%vYT&U=SZ%{#)& zBA3+kW21KO_8W4QxoY{j`t$Dg0A0yvr>S%?%tFuiE@1Fim-FFahWPuhCI?QIqP5{! z`zb+YGAk_fU_Yt$H}bs!H$UN%Rxq04myEv=lb9&39oBgy-Y*%W-F=3@NzG6SNT<~` z>a4oYs7gzPwi*4wkB}_N8PonZoTwAuJu8oj`m}FGA{EmgkeUbPpocKPm!qose7cCn zf5qqaw-5;VvIeJ_KJAs4hmDRkmrLaNQ7P8js;3=&t%bum(0uuzB>jc{oh+K=P=nBu z(lbIV7tOmU zwTnBk)(I=pHN#lAbbZsn6m>3xez0ndjih)MD1VMO#-S&>PI%`MB#(m_N0v=CL_8s2 zW(uT%ciO?vDZn%KWock(>tbsZ&ntmT z92Zc$ZeG&?qWUti9N-v?&%})&-r;VDMv;t2?xI(Z3HS^5*^c;|={Ri|V9Hi~4m@d^ zdlaljxa_5wUYY(%fN41QmewN&jv|QuBSlf|^9NnX!qGcbVvtw%1QzVBAz5kD@>ntc i`$Ueyvp6o3H!+N40Ba^_q^nX9gb?|(HNFcMU`+`Dh9!ak literal 0 HcmV?d00001 diff --git a/build/semver-key.snk.enc b/build/semver-key.snk.enc deleted file mode 100644 index b40fd49..0000000 --- a/build/semver-key.snk.enc +++ /dev/null @@ -1,6 +0,0 @@ -úÂöÛäìê¯<è -„‡çÕ â×5⌢åÑP7å®Î;\ü_ÐöhW|eý:°"ÛôR°Cnüj|©[º—-·…W6³åž]ŽÃi ÏMd ƒ§Ë) %úFŸÜr›Ë%t1Òšž=Gü…`B Ûîàb-^ÊÎk[Ø!Ò:YŸ[»TM;Íâ»é×I wÇþÀ]Í\l§ ¡÷°KʤÛVý‘ònQ|fßµ˜Óã±E *øØ÷â¿ ;Èfè¸É -ÑÙ'ˈyY­©Ð§èx)fºÚ?ؘüj4åØ…¬ÓæZnÎè¶$^5/ïúBy”xnêk:Â;ÉWÒŒòaˆ1â’nÉàÉâÕ5X s}˜xcå!HÇ`àM˜,§¤)Áª³€å°YI‘K‡—ÛN}™•`Ÿ· …£”.ëcÐ_\mw9Ò{â%åœûÐwªÁ³°o´íÔl$ßá/ª¤)ðÿ L3Õø?óµð¦%t½5‚þ¼Örm䊩%Õ9Ý‚Àè= -Ûú'Xh 9 U;·f3ims.lp·ºÞ«Eˆz‹Þ²5–ð'•¹R‡·Ø[J ‚DÜàqÚ #8ætnþÞSk¾C* 9?cŸLŸ¡×m*Žá°9Ý :Ø&ž¾ö¨:bÚ1g‡ð±‡f€ícÝò^ -½@Þõ﹇‚­ÖÂöBSï¼”§.á¿4£ŒË‰½ªá¦'ëá4ÙÝ€yóó -T†óÙfôDüOG+ä_”\îOjÄÀ°Ítë9܈ì›jZ•jN\¡ª–*¬ \ No newline at end of file diff --git a/build/test.ps1 b/build/test.ps1 deleted file mode 100644 index 710cdca..0000000 --- a/build/test.ps1 +++ /dev/null @@ -1,11 +0,0 @@ -# run restore on all project.json files in the src folder including 2>1 to redirect stderr to stdout for badly behaved tools -& dotnet restore 2>&1 -if ($lastExitCode -ne 0) { - $host.SetShouldExit($lastExitCode) -} - -# run tests -& dotnet test .\test\SemanticVersioning.Tests\SemanticVersioning.Tests.csproj -c Release 2>&1 -if ($lastExitCode -ne 0) { - $host.SetShouldExit($lastExitCode) -} diff --git a/src/SemanticVersioning/InternalsVisibleTo.cs b/src/SemanticVersioning/InternalsVisibleTo.cs new file mode 100644 index 0000000..df9e132 --- /dev/null +++ b/src/SemanticVersioning/InternalsVisibleTo.cs @@ -0,0 +1,8 @@ +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("SemanticVersioning.Tests, PublicKey=" + + "002400000480000094000000060200000024000052534131000400000100010019351d" + + "4288017757df1b69b4d0da9a775e6eec498ec93d209d6db4d62e9962476c8da01545cc" + + "47335cdc39ba803f4db368ce5f2fdd6cd395196f3328f9039dccdeb3c0f9aece7b8751" + + "cd3bc2cb2297d4f463a376eff61b7295b96af9b9faf3eef6005dc967a7a97431cc42cf" + + "f72e60f05797f3e16186f8fbaf26074e96a2b5e1")] diff --git a/src/SemanticVersioning/Properties/AssemblyInfo.cs b/src/SemanticVersioning/Properties/AssemblyInfo.cs deleted file mode 100644 index c8caacd..0000000 --- a/src/SemanticVersioning/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("SemanticVersioning")] -[assembly: AssemblyTrademark("")] -[assembly: InternalsVisibleTo("SemanticVersioning.Tests")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("a3ff1b6d-68bb-4a0a-a487-858aaa8e3573")] diff --git a/src/SemanticVersioning/SemanticVersioning.csproj b/src/SemanticVersioning/SemanticVersioning.csproj index 4666481..d0c1453 100644 --- a/src/SemanticVersioning/SemanticVersioning.csproj +++ b/src/SemanticVersioning/SemanticVersioning.csproj @@ -1,43 +1,20 @@ - - net45;netstandard1.1;netstandard2.0;net35 - - - - netstandard2.0 - - This library implements the Semantic Versioning 2.0.0 specification and the version range specification used by npm. - Copyright 2016 Adam Reeve + netstandard2.0 + Copyright Adam Reeve SemanticVersioning - 1.0.0 Adam Reeve SemanticVersioning SemanticVersioning + 3.0.0-alpha https://github.com/adamreeve/semver.net https://github.com/adamreeve/semver.net/blob/master/LICENSE git https://github.com/adamreeve/semver.net - $(PackageTargetFallback);dnxcore50 - 1.6.0 - false - false - false - ..\..\build\semver-key.snk - $(SemVerKeyFile) - true - true + ..\..\build\semver-key.snk + true - - - - - - - $(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client - - diff --git a/test/SemanticVersioning.Tests/SemanticVersioning.Tests.csproj b/test/SemanticVersioning.Tests/SemanticVersioning.Tests.csproj index 6978d10..89dc20b 100644 --- a/test/SemanticVersioning.Tests/SemanticVersioning.Tests.csproj +++ b/test/SemanticVersioning.Tests/SemanticVersioning.Tests.csproj @@ -4,10 +4,8 @@ net7.0 SemanticVersioning.Tests SemanticVersioning.Tests - ..\..\build\semver-key.snk - $(SemVerKeyFile) - true - true + ..\..\build\semver-key.snk + true