diff --git a/build/RepositoryBuild.targets b/build/RepositoryBuild.targets index f4ac942283..4a42a91fff 100644 --- a/build/RepositoryBuild.targets +++ b/build/RepositoryBuild.targets @@ -22,7 +22,7 @@ - + - + + + + + + $(AspNetCoreMajorVersion) + $(AspNetCoreMinorVersion) + $(AspNetCorePatchVersion) + $(PrereleaseVersionLabel) + $(BuildNumber) + $(PackageBrandingVersion) + + +]]> + + + + + + + + Properties="version=$(PackageVersion);dependenciesPropsFile=$(GeneratedPackageVersionPropsPath);brandingPropsFile=$(GeneratedBrandingPropsPath)"> @@ -168,7 +192,7 @@ Solutions="@(Solution)" Artifacts="@(ArtifactInfo);@(ShippedArtifactInfo)" Repositories="@(Repository);@(ShippedRepository)" - Properties="Configuration=$(Configuration);BuildNumber=$(BuildNumber);DotNetPackageVersionPropsPath=$(GeneratedPackageVersionPropsPath);DotNetRestoreSourcePropsPath=$(GeneratedRestoreSourcePropsPath)" /> + Properties="Configuration=$(Configuration);BuildNumber=$(BuildNumber);DotNetPackageVersionPropsPath=$(GeneratedPackageVersionPropsPath);DotNetRestoreSourcePropsPath=$(GeneratedRestoreSourcesPropsPath)" /> Frameworks { get; } public IReadOnlyList Tools { get; } + public SolutionInfo SolutionInfo { get; internal set; } } } diff --git a/build/tasks/ProjectModel/ProjectInfoFactory.cs b/build/tasks/ProjectModel/ProjectInfoFactory.cs index 350fed398d..40592f30fa 100644 --- a/build/tasks/ProjectModel/ProjectInfoFactory.cs +++ b/build/tasks/ProjectModel/ProjectInfoFactory.cs @@ -58,6 +58,13 @@ namespace RepoTasks.ProjectModel var tools = GetTools(instance).ToArray(); bool.TryParse(instance.GetPropertyValue("IsPackable"), out var isPackable); + + if (isPackable) + { + // the default packable setting is disabled for projects referencing this package. + isPackable = !frameworks.SelectMany(f => f.Dependencies.Keys).Any(d => d.Equals("Microsoft.NET.Test.Sdk", StringComparison.OrdinalIgnoreCase)); + } + var packageId = instance.GetPropertyValue("PackageId"); var packageVersion = instance.GetPropertyValue("PackageVersion"); @@ -86,6 +93,7 @@ namespace RepoTasks.ProjectModel var globalProps = new Dictionary() { ["DesignTimeBuild"] = "true", + // Isolate the project from post-restore side effects ["ExcludeRestorePackageImports"] = "true", }; diff --git a/build/tasks/ProjectModel/SolutionInfo.cs b/build/tasks/ProjectModel/SolutionInfo.cs index 21af5e5291..1085ccf105 100644 --- a/build/tasks/ProjectModel/SolutionInfo.cs +++ b/build/tasks/ProjectModel/SolutionInfo.cs @@ -21,6 +21,7 @@ namespace RepoTasks.ProjectModel throw new ArgumentException(nameof(configName)); } + Directory = Path.GetDirectoryName(fullPath); FullPath = fullPath; Directory = Path.GetDirectoryName(fullPath); ConfigName = configName; @@ -34,6 +35,7 @@ namespace RepoTasks.ProjectModel } } + public string Directory { get; } public string FullPath { get; } public string Directory { get; } public string ConfigName { get; } diff --git a/build/tools/dotnet-deb-tool-consumer/dotnet-deb-tool-consumer.csproj b/build/tools/dotnet-deb-tool-consumer/dotnet-deb-tool-consumer.csproj index d2fa226fc4..1db0d022dc 100644 --- a/build/tools/dotnet-deb-tool-consumer/dotnet-deb-tool-consumer.csproj +++ b/build/tools/dotnet-deb-tool-consumer/dotnet-deb-tool-consumer.csproj @@ -1,5 +1,7 @@  + + netcoreapp2.0 $(RestoreSources);https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json diff --git a/build/tools/packaging/store_debian_config.json b/build/tools/packaging/store_debian_config.json deleted file mode 100644 index 70dffe42a9..0000000000 --- a/build/tools/packaging/store_debian_config.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "maintainer_name": "Microsoft", - "maintainer_email": "nugetaspnet@microsoft.com", - - "package_name": "aspnetcore-store", - "install_root": "/usr/share/dotnet", - - "short_description": "Microsoft ASP.NET Core DEB_VERSION Runtime Package Store", - "long_description": "Runtime package store for Microsoft ASP.NET Core. It is open source, cross-platform and is supported by Microsoft. We hope you enjoy using it! If you do, please consider joining the active community of developers that are contributing to the project on GitHub (https://github.com/aspnet/home). We happily accept issues and PRs.", - "homepage": "https://www.asp.net/", - - "release":{ - "package_version":"0.0.0.0", - "package_revision":"1", - "urgency" : "low", - "changelog_message" : "" - }, - - "control": { - "priority":"standard", - "section":"devel", - "architecture":"any" - }, - - "copyright": "Microsoft", - "license": { - "type": "Apache-2.0", - "full_text": "Copyright (c) .NET Foundation. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthese files except in compliance with the License. You may obtain a copy of the\nLicense at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed\nunder the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\nCONDITIONS OF ANY KIND, either express or implied. See the License for the\nspecific language governing permissions and limitations under the License." - }, - - "debian_dependencies": { - "aspnetcore-store-2.0.0": {} - } -} \ No newline at end of file diff --git a/build/tools/templates/Archive/Archive.csproj b/build/tools/templates/Archive/Archive.csproj index 3699f0e4bc..e993fa7126 100644 --- a/build/tools/templates/Archive/Archive.csproj +++ b/build/tools/templates/Archive/Archive.csproj @@ -8,6 +8,11 @@ netcoreapp2.1 $(RestoreSources);$(DotNetRestoreSources); true + true + + + + diff --git a/scripts/ListRepoVersions.ps1 b/scripts/ListRepoVersions.ps1 new file mode 100644 index 0000000000..62dfba8592 --- /dev/null +++ b/scripts/ListRepoVersions.ps1 @@ -0,0 +1,23 @@ +#!/usr/bin/env pwsh + +<# +.SYNOPSIS + Tags each repo according to VersionPrefix in version.props of that repo +.PARAMETER Shipping + Only list repos that are shipping +#> +[cmdletbinding(SupportsShouldProcess = $true)] +param( + [switch]$Shipping = $false +) + +Set-StrictMode -Version 2 +$ErrorActionPreference = 'Stop' + +Import-Module -Scope Local -Force "$PSScriptRoot/common.psm1" + +Assert-Git + +$RepoRoot = Resolve-Path "$PSScriptRoot/../" + +Get-Submodules $RepoRoot -Shipping:$Shipping | Format-Table -Property 'module','versionPrefix' diff --git a/scripts/TagRepos.ps1 b/scripts/TagRepos.ps1 new file mode 100644 index 0000000000..2bb595027c --- /dev/null +++ b/scripts/TagRepos.ps1 @@ -0,0 +1,66 @@ +#!/usr/bin/env pwsh + +<# +.SYNOPSIS + Tags each repo according to VersionPrefix in version.props of that repo +.PARAMETER Push + Push all updated tags +.PARAMETER ForceUpdateTag + This will call git tag --force +#> +[cmdletbinding(SupportsShouldProcess = $true)] +param( + [switch]$Push = $false, + [switch]$ForceUpdateTag = $false +) + +Set-StrictMode -Version 2 +$ErrorActionPreference = 'Stop' + +Import-Module -Scope Local -Force "$PSScriptRoot/common.psm1" + +Assert-Git + +$RepoRoot = Resolve-Path "$PSScriptRoot/../" + +Get-Submodules $RepoRoot -Shipping | % { + Push-Location $_.path | Out-Null + try { + + if (-not $_.versionPrefix) { + Write-Warning "Could not determine tag version for $(_.path)" + } + else { + $tag = $_.versionPrefix + Write-Host "$($_.module) => $tag" + + $gitTagArgs = @() + if ($ForceUpdateTag) { + $gitTagArgs += '--force' + } + + Invoke-Block { & git tag @gitTagArgs $tag } + + if ($Push) { + $gitPushArgs = @() + if ($WhatIfPreference) { + $gitPushArgs += '--dry-run' + } + Invoke-Block { & git push @gitPushArgs origin "refs/tags/${tag}" } + } + + if ($WhatIfPreference) { + Invoke-Block { & git tag -d $tag } | Out-Null + } + } + } + catch { + Write-Host -ForegroundColor Red "Could not update $_" + throw + } + finally { + Pop-Location + } +} + + diff --git a/version.props b/version.props index ce3f035075..a6263b44b2 100644 --- a/version.props +++ b/version.props @@ -6,6 +6,9 @@ $(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).$(AspNetCorePatchVersion) rtm + + $(VersionPrefix) + 0.1.1 rtm