Browse Source

Merge branch 'release/2.0' into release/2.1

Nate McMaster 7 years ago
parent
commit
ca4e81b975

+ 2 - 2
build/RepositoryBuild.targets

@@ -22,7 +22,7 @@
     </ItemGroup>
   </Target>
 
-  <Target Name="_BuildRepositories" DependsOnTargets="GetRepoBatches">
+  <Target Name="_BuildRepositories" DependsOnTargets="GetRepoBatches" Condition=" @(RepositoryBuildOrder->Count()) != 0 ">
     <MSBuild
       Projects="@(BatchedRepository)"
       BuildInParallel="true"
@@ -35,7 +35,7 @@
     </PropertyGroup>
   </Target>
 
-  <Target Name="_TestRepositories" DependsOnTargets="GetRepoBatches">
+  <Target Name="_TestRepositories" DependsOnTargets="GetRepoBatches" Condition=" @(RepositoryBuildOrder->Count()) != 0 ">
     <!--
       Use the task to sort instead of batching (i.e. using %(BatchedRepository.BuildGroup))
       When batching, StopOnFirstFailure doesn't help because the MSBuild task would be invoked multiple times

+ 1 - 0
build/lineups/Internal.AspNetCore.Universe.Lineup.nuspec

@@ -11,5 +11,6 @@
   </metadata>
   <files>
     <file src="$dependenciesPropsFile$" target="build/dependencies.props" />
+    <file src="$brandingPropsFile$" target="build/branding.props" />
   </files>
 </package>

+ 26 - 2
build/repo.targets

@@ -14,6 +14,7 @@
   <PropertyGroup>
     <GeneratedPackageVersionPropsPath>$(IntermediateDir)dependencies.g.props</GeneratedPackageVersionPropsPath>
     <GeneratedRestoreSourcesPropsPath>$(IntermediateDir)sources.g.props</GeneratedRestoreSourcesPropsPath>
+    <GeneratedBrandingPropsPath>$(IntermediateDir)branding.g.props</GeneratedBrandingPropsPath>
 
     <PrepareDependsOn>PreinstallBundledPackages;SetTeamCityBuildNumberToVersion;$(PrepareDependsOn);VerifyPackageArtifactConfig;VerifyExternalDependencyConfig;PrepareOutputPaths</PrepareDependsOn>
     <CleanDependsOn>$(CleanDependsOn);CleanArtifacts;CleanUniverseArtifacts</CleanDependsOn>
@@ -113,10 +114,33 @@
       Sources="@(_RestoreSources)"
       OutputPath="$(GeneratedRestoreSourcesPropsPath)" />
 
+    <PropertyGroup>
+      <!-- Generate an MSBuild file that can be imported and used by Windows Installer builds to keep our versions consistent. -->
+      <BrandingPropsContent>
+<![CDATA[
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <AspNetCoreMajorVersion>$(AspNetCoreMajorVersion)</AspNetCoreMajorVersion>
+    <AspNetCoreMinorVersion>$(AspNetCoreMinorVersion)</AspNetCoreMinorVersion>
+    <AspNetCorePatchVersion>$(AspNetCorePatchVersion)</AspNetCorePatchVersion>
+    <AspNetCorePrereleaseVersionLabel>$(PrereleaseVersionLabel)</AspNetCorePrereleaseVersionLabel>
+    <AspNetCoreBuildNumber>$(BuildNumber)</AspNetCoreBuildNumber>
+    <AspNetCoreBrandingVersion>$(PackageBrandingVersion)</AspNetCoreBrandingVersion>
+  </PropertyGroup>
+</Project>
+]]>
+      </BrandingPropsContent>
+    </PropertyGroup>
+
+    <WriteLinesToFile File="$(GeneratedBrandingPropsPath)" Overwrite="true" Lines="$(BrandingPropsContent)"/>
+
+    <Copy SourceFiles="$(GeneratedPackageVersionPropsPath);$(GeneratedBrandingPropsPath)" DestinationFolder="$(ArtifactsDir)" />
+
     <PackNuSpec NuSpecPath="$(MSBuildThisFileDirectory)lineups\Internal.AspNetCore.Universe.Lineup.nuspec"
                 DestinationFolder="$(BuildDir)"
                 Overwrite="true"
-                Properties="version=$(PackageVersion);dependenciesPropsFile=$(GeneratedPackageVersionPropsPath)">
+                Properties="version=$(PackageVersion);dependenciesPropsFile=$(GeneratedPackageVersionPropsPath);brandingPropsFile=$(GeneratedBrandingPropsPath)">
       <Output TaskParameter="Packages" ItemName="LineupPackage" />
     </PackNuSpec>
   </Target>
@@ -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)" />
 
     <!-- Skipped to workaround #1014. The order is hardcoded in buildorder.props -->
     <RepoTasks.AnalyzeBuildGraph Condition=" ! $([MSBuild]::IsOSUnixLike())"

+ 1 - 0
build/tasks/ProjectModel/ProjectInfo.cs

@@ -43,5 +43,6 @@ namespace RepoTasks.ProjectModel
 
         public IReadOnlyList<ProjectFrameworkInfo> Frameworks { get; }
         public IReadOnlyList<DotNetCliReferenceInfo> Tools { get; }
+        public SolutionInfo SolutionInfo { get; internal set; }
     }
 }

+ 8 - 0
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<string, string>()
             {
                 ["DesignTimeBuild"] = "true",
+                 // Isolate the project from post-restore side effects
                 ["ExcludeRestorePackageImports"] = "true",
             };
 

+ 2 - 0
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; }

+ 2 - 0
build/tools/dotnet-deb-tool-consumer/dotnet-deb-tool-consumer.csproj

@@ -1,5 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
+  <Import Project="..\..\sources.props" />
+
   <PropertyGroup>
     <TargetFramework>netcoreapp2.0</TargetFramework>
     <RestoreSources>$(RestoreSources);https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json</RestoreSources>

+ 0 - 34
build/tools/packaging/store_debian_config.json

@@ -1,34 +0,0 @@
-{
-    "maintainer_name": "Microsoft",
-    "maintainer_email": "[email protected]",
-
-    "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": {}
-    }
-}

+ 5 - 0
build/tools/templates/Archive/Archive.csproj

@@ -8,6 +8,11 @@
     <DotnetCliToolTargetFramework>netcoreapp2.1</DotnetCliToolTargetFramework>
     <RestoreSources>$(RestoreSources);$(DotNetRestoreSources);</RestoreSources>
     <DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
+    <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
   </PropertyGroup>
 
+  <ItemGroup>
+    <PackageReference Include="Microsoft.NETCore.App" Version="$(RuntimeFrameworkVersion)" />
+  </ItemGroup>
+
 </Project>

+ 23 - 0
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'

+ 66 - 0
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
+    }
+}
+
+

+ 3 - 0
version.props

@@ -6,6 +6,9 @@
     <VersionPrefix>$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).$(AspNetCorePatchVersion)</VersionPrefix>
     <PrereleaseVersionLabel>rtm</PrereleaseVersionLabel>
 
+    <!-- The 'human friendly' version to display in installers. In pre-release builds, this might be "2.0.7 Preview 2" -->
+    <PackageBrandingVersion>$(VersionPrefix)</PackageBrandingVersion>
+
     <ExperimentalVersionPrefix>0.1.1</ExperimentalVersionPrefix>
     <ExperimentalVersionSuffix>rtm</ExperimentalVersionSuffix>