Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion eng/Configurations.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<PropertyGroup>
<InstallerProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'installer'))</InstallerProjectRoot>
<ClickOnceProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'clickonce'))</ClickOnceProjectRoot>
<DotNetReleasesProjectRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'Microsoft.Deployment.DotNet.Releases'))</DotNetReleasesProjectRoot>
<RepoToolsLocalDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'tools-local'))</RepoToolsLocalDir>
<RepoTasksDir>$([MSBuild]::NormalizeDirectory('$(RepoToolsLocalDir)', 'tasks'))</RepoTasksDir>
</PropertyGroup>
Expand Down Expand Up @@ -56,4 +57,4 @@
<!-- Enable NuGet static graph evaluation to optimize incremental restore -->
<RestoreUseStaticGraphEvaluation>true</RestoreUseStaticGraphEvaluation>
</PropertyGroup>
</Project>
</Project>
14 changes: 13 additions & 1 deletion eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
-->

<PropertyGroup>
<DefaultSubsets>clickonce+installer</DefaultSubsets>
<DefaultSubsets>clickonce+installer+dotnet_releases</DefaultSubsets>
<DefaultSubsets Condition="'$(TargetsMobile)' == 'true'">clickonce+installer</DefaultSubsets>
</PropertyGroup>

Expand All @@ -56,11 +56,13 @@
<PropertyGroup>
<DefaultClickOnceSubsets>clickonce</DefaultClickOnceSubsets>
<DefaultInstallerSubsets>installer.pkgprojs</DefaultInstallerSubsets>
<DefaultDotNetReleasesSubsets>dotnet_releases</DefaultDotNetReleasesSubsets>
</PropertyGroup>

<PropertyGroup>
<_subset>$(_subset.Replace('+clickonce+', '+$(DefaultClickOnceSubsets)+'))</_subset>
<_subset>$(_subset.Replace('+installer+', '+$(DefaultInstallerSubsets)+'))</_subset>
<_subset>$(_subset.Replace('+dotnet_releases+', '+$(DefaultDotNetReleasesSubsets)+'))</_subset>

<!-- Surround _subset in dashes to simplify checks below -->
<_subset>+$(_subset.Trim('+'))+</_subset>
Expand All @@ -74,6 +76,9 @@
<SubsetName Include="Installer" Description="Generates installers. This produces installers for deployment tools." />
<SubsetName Include="Installer.PkgProjs" Description="The packaging projects. These produce NETCoreApp assets: NuGet packages, installers, zips, and Linux packages." />
<SubsetName Include="Installer.Publish" OnDemand="true" Description="Builds the installer publish infrastructure." />

<!-- DotNetReleases -->
<SubsetName Include="dotnet_releases" Description="Libary for accessing .NET release data." />
</ItemGroup>

<!-- Default targets, parallelization and configurations. -->
Expand Down Expand Up @@ -105,6 +110,13 @@
<ProjectToBuild Include="$(InstallerProjectRoot)publish\prepare-artifacts.proj" Pack="true" BuildInParallel="false" Category="installer" />
</ItemGroup>

<!-- Releases sets -->
<ItemGroup Condition="$(_subset.Contains('+dotnet_releases+'))">
<DotNetReleasesProjectToBuild Include="$(DotNetReleasesProjectRoot)src\**\*.csproj" Pack="true" SignPhase="Binaries" />
<DotNetReleasesProjectToBuild Include="$(DotNetReleasesProjectRoot)tests\**\*.csproj" Test="$(Test)"/>
<ProjectToBuild Include="@(DotNetReleasesProjectToBuild)" BuildInParallel="true" Category="dotnet_releases" />
</ItemGroup>

<!-- Set default configurations. -->
<ItemGroup>
<ProjectToBuild Update="@(ProjectToBuild)">
Expand Down
6 changes: 3 additions & 3 deletions eng/jobs/windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:

- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- script: >-
build.cmd -subset clickonce+installer -ci -test
build.cmd -subset clickonce+installer+dotnet_releases -ci -test
$(CommonMSBuildArgs)
$(MsbuildSigningArguments)
/p:Sign=true /p:SignBinaries=true
Expand All @@ -79,14 +79,14 @@ jobs:

- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
- script: >-
build.cmd -subset clickonce+installer -ci -test
build.cmd -subset clickonce+installer+dotnet_releases -ci -test
$(CommonMSBuildArgs)
$(MsbuildSigningArguments)
/p:LocalizedBuild=true
displayName: Build

- script: >-
build.cmd -subset clickonce+installer -ci -pack
build.cmd -subset clickonce+installer+dotnet_releases -ci -pack
$(CommonMSBuildArgs)
$(MsbuildSigningArguments)
displayName: Package
Expand Down
173 changes: 173 additions & 0 deletions src/Microsoft.Deployment.DotNet.Releases/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
<Project>

<Import Project="..\..\Directory.Build.props" />

<!--
Before Microsoft.Common.targets, set the extensions path to match the restore dir as Arcade
sets it, so MSBuild packages with targets files will be found and imported.
-->
<PropertyGroup>
<MSBuildProjectExtensionsPath>$(BaseIntermediateOutputPath)</MSBuildProjectExtensionsPath>
</PropertyGroup>

<PropertyGroup>
<ArcadeSdkMSBuildProjectDir>$([System.IO.Path]::GetDirectoryName('$(ArcadeSdkBuildTasksAssembly)'))\..\</ArcadeSdkMSBuildProjectDir>
<ArcadeSdkSignProject>$(ArcadeSdkMSBuildProjectDir)Sign.proj</ArcadeSdkSignProject>

<!-- Clear AssemblyVersion as we need to align with the NuGet conventions, when empty arcade will do that for us. -->
<AssemblyVersion />
</PropertyGroup>

<PropertyGroup Condition="'$(MSBuildProjectExtension)' == '.csproj'">
<!-- SDK-based projects' Platform should default to AnyCPU, not $(TargetArchitecture) like Directory.Build.props sets. -->
<Platform>AnyCPU</Platform>
<UsingNETSdkCompiler>true</UsingNETSdkCompiler>
<DisableBuildToolsRoslynVersion>true</DisableBuildToolsRoslynVersion>
</PropertyGroup>

<PropertyGroup>
<SigningToolsDir>$(InstallerProjectRoot)signing\</SigningToolsDir>
</PropertyGroup>

<!-- Platform detection -->
<PropertyGroup>
<RunningOnUnix Condition="'$(OS)'!='Windows_NT'">true</RunningOnUnix>
<RunningOnCore Condition="'$(MSBuildRuntimeType)' == 'core'">true</RunningOnCore>
</PropertyGroup>

<PropertyGroup>
<TargetArchitecture Condition="'$(TargetArchitecture)' == '' AND '$(BuildArchitecture)' == 'arm64'">$(BuildArchitecture)</TargetArchitecture>
<TargetArchitecture Condition="'$(TargetArchitecture)' == ''">x64</TargetArchitecture>
<Platform Condition="'$(Platform)'==''">$(TargetArchitecture)</Platform>
<TargetOS Condition="'$(TargetOS)' == 'Linux'">Unix</TargetOS>
</PropertyGroup>

<PropertyGroup>
<DebugType Condition="'$(DebugType)' == ''">Portable</DebugType>
</PropertyGroup>

<PropertyGroup Condition="'$(DisableSourceLink)' == 'true'">
<EnableSourceLink>false</EnableSourceLink>
<EnableSourceControlManagerQueries>false</EnableSourceControlManagerQueries>
<DeterministicSourcePaths>false</DeterministicSourcePaths>
</PropertyGroup>

<!-- Set up Default symbol and optimization for Configuration -->
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<DebugSymbols Condition="'$(DebugSymbols)' == ''">true</DebugSymbols>
<Optimize Condition="'$(Optimize)' == ''">false</Optimize>
<DefineConstants>$(DefineConstants),DEBUG,TRACE</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DebugSymbols Condition="'$(DebugSymbols)' == ''">true</DebugSymbols>
<Optimize Condition="'$(Optimize)' == ''">true</Optimize>
<DefineConstants>$(DefineConstants),TRACE</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(OutputRid)' == '' and '$(HostMachineRid)' != ''">
<OutputRid>$(HostMachineRid.Remove($(HostMachineRid.LastIndexOf('-'))))-$(TargetArchitecture)</OutputRid>
</PropertyGroup>

<!-- Portable -->
<PropertyGroup Condition="'$(PortableBuild)' == 'true'">
<OutputRid Condition="'$(TargetOS)' == 'Windows_NT'">win-$(TargetArchitecture)</OutputRid>
</PropertyGroup>

<PropertyGroup>
<TestTargetRid Condition="'$(TestTargetRid)' == ''">$(OutputRid)</TestTargetRid>
</PropertyGroup>

<!-- Produce assets into the specified blob feed. -->
<PropertyGroup Condition="'$(DotNetOutputBlobFeedDir)' != ''">
<AssetOutputPath>$(DotNetOutputBlobFeedDir)assets/</AssetOutputPath>
</PropertyGroup>

<!-- Set up the default output and intermediate paths -->
<PropertyGroup>
<OSPlatformConfig>$(OutputRid).$(Configuration)</OSPlatformConfig>

<BaseOutputRootPath>$(ArtifactsBinDir)$(OSPlatformConfig)\</BaseOutputRootPath>

<IntermediateOutputRootPath Condition="'$(IntermediateOutputRootPath)' == ''">$(ArtifactsObjDir)$(OSPlatformConfig)\</IntermediateOutputRootPath>

<PackagesBasePath Condition="'$(PackagesBasePath)'==''">$(ArtifactsBinDir)$(OSPlatformConfig)/</PackagesBasePath>
<PackageSymbolsBinDir Condition="'$(PackageSymbolsBinDir)' == ''">$(PackagesBasePath)symbols/</PackageSymbolsBinDir>

<AssetOutputPath Condition="'$(AssetOutputPath)'==''">$(ArtifactsShippingPackagesDir)</AssetOutputPath>
<SymbolPackageOutputPath Condition="'$(SymbolPackageOutputPath)'==''">$(ArtifactsShippingPackagesDir)</SymbolPackageOutputPath>
</PropertyGroup>

<!-- Set up handling of build warnings -->
<PropertyGroup>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<PropertyGroup>
<TargetsWindows>true</TargetsWindows>
<TargetsOSX>false</TargetsOSX>
<TargetsLinux>false</TargetsLinux>
<TargetsUnix>false</TargetsUnix>
<TargetsUbuntu>false</TargetsUbuntu>
<TargetsLinuxMint>false</TargetsLinuxMint>
<TargetsDebian>false</TargetsDebian>
<TargetsRhel>false</TargetsRhel>
<TargetsOpensuse>false</TargetsOpensuse>
<TargetsFedora>false</TargetsFedora>
<TargetsCentos>false</TargetsCentos>
<TargetsOracle>false</TargetsOracle>
<TargetsSles>false</TargetsSles>
</PropertyGroup>

<!-- Use actual publishable (non-dummy) package name produced by the build system for this RID -->
<PropertyGroup Condition="'$(OutputRid)' != ''">
<PackageTargetRid>$(OutputRid)</PackageTargetRid>
</PropertyGroup>

<PropertyGroup Condition="'$(UsingNETSdkCompiler)' != 'true'">
<!-- Disable some standard properties for building our projects -->
<NoStdLib>true</NoStdLib>
<NoExplicitReferenceToStdLib>true</NoExplicitReferenceToStdLib>
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>

<!-- We do not want to target a portable profile.
TODO: Make this the default in buildtools so this is not necessary. -->
<TargetFrameworkProfile></TargetFrameworkProfile>
<!-- We set this property to avoid MSBuild errors regarding not setting TargetFrameworkProfile (see above line) -->
<PortableNuGetMode>true</PortableNuGetMode>
</PropertyGroup>

<PropertyGroup>
<!-- Never use the NuGet fallback folder that comes with the SDK we use to build.
The NuGet fallback folder can/will contain packages we are building in this repo, and we
want to ensure we use the correct packages.
-->
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
</PropertyGroup>

<PropertyGroup>
<!-- Disable NuGet static graph evaluation as pkgprojs do their own restore. -->
<RestoreUseStaticGraphEvaluation>false</RestoreUseStaticGraphEvaluation>
</PropertyGroup>

<PropertyGroup>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RequireLicenseAcceptance Condition="'$(RequireLicenseAcceptance)' == ''">false</RequireLicenseAcceptance>
<PackageRequireLicenseAcceptance>$(RequireLicenseAcceptance)</PackageRequireLicenseAcceptance>
<!-- This link should be updated for each release milestone, currently this points to 1.0.0 -->
<ReleaseNotes>https://go.microsoft.com/fwlink/?LinkID=799417</ReleaseNotes>
<ProjectUrl>https://github.com/dotnet/deployment-tools</ProjectUrl>
<PackagePlatform Condition="'$(PackagePlatform)' == ''">$(Platform)</PackagePlatform>
<PackagePlatform Condition="'$(PackagePlatform)' == 'amd64'">x64</PackagePlatform>

<!-- this repo doesn't currently use the index so don't force it to be in sync -->
<SkipIndexCheck>true</SkipIndexCheck>
</PropertyGroup>

<PropertyGroup>
<PackagesIntermediateDir>$(IntermediateOutputRootPath)packages/</PackagesIntermediateDir>
</PropertyGroup>

</Project>
37 changes: 37 additions & 0 deletions src/Microsoft.Deployment.DotNet.Releases/releases.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30623.217
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{738213FF-7EC5-40F8-ACBE-F12C2578FC8B}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
..\..\eng\Subsets.props = ..\..\eng\Subsets.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Deployment.DotNet.Releases", "src\Microsoft.Deployment.DotNet.Releases.csproj", "{61248599-2D6B-4EDE-9AB3-C423E02BE649}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Deployment.DotNet.Releases.Tests", "tests\Microsoft.Deployment.DotNet.Releases.Tests.csproj", "{155F0C7B-BCA9-4711-BA87-94319C89F6AE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{61248599-2D6B-4EDE-9AB3-C423E02BE649}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{61248599-2D6B-4EDE-9AB3-C423E02BE649}.Debug|Any CPU.Build.0 = Debug|Any CPU
{61248599-2D6B-4EDE-9AB3-C423E02BE649}.Release|Any CPU.ActiveCfg = Release|Any CPU
{61248599-2D6B-4EDE-9AB3-C423E02BE649}.Release|Any CPU.Build.0 = Release|Any CPU
{155F0C7B-BCA9-4711-BA87-94319C89F6AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{155F0C7B-BCA9-4711-BA87-94319C89F6AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{155F0C7B-BCA9-4711-BA87-94319C89F6AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{155F0C7B-BCA9-4711-BA87-94319C89F6AE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {536768EF-52D5-4CDB-A8B4-B06F3A5E1DE1}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.Collections.ObjectModel;
using Newtonsoft.Json.Linq;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use System.Text.Json instead of an external 3rd party package?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to support 4.5.2 for some enterprise scenarios, which takes System.Text.Json off the table for us. If you want the latest copy you can only get that by going, but if you downloaded the files and laid them out on an internal machine you can use the local set of files without having to go online.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you know to download them, that is somewhat unintuitive? How does a consumer know when there is a "latest copy", what if they never have internet connection. The idea of relying on parsing these JSON files is a bit fragile, there are inconsistencies. What about codifying this metadata in the package itself, so that it doesn't need to relying on parsing JSON and making HTTP requests. All the past releases are not changing, maybe this would be a use-case for code generators?


namespace Microsoft.Deployment.DotNet.Releases
{
/// <summary>
/// Describes an ASP.NET Core release.
/// </summary>
public class AspNetCoreReleaseComponent : ReleaseComponent
{
/// <summary>
/// The versions of the ASP.NET Core Module in this release.
/// </summary>
public ReadOnlyCollection<Version> AspNetCoreModuleVersions
{
get;
}

/// <summary>
/// The friendly display name for the component.
/// </summary>
public override string Name => ReleasesResources.AspNetCoreReleaseName;

/// <summary>
/// The versions of Visual Studio that includes this runtime. Multiple versions may be listed, e.g.
/// &quot;15.9.25, 16.0.16, 16.4.11, 16.6.4&quot;
/// </summary>
public string VisualStudioVersion
{
get;
}

internal AspNetCoreReleaseComponent(JToken token, ProductRelease release) : base(token, release)
{
#pragma warning disable CA1825 // Avoid zero-length array allocations, Array.Empty<T> is only supported in netstandard2.1
AspNetCoreModuleVersions = new ReadOnlyCollection<Version>(token["version-aspnetcoremodule"]?.ToObject<Version[]>(Utils.DefaultSerializer) ?? new Version[] { });
#pragma warning restore CA1825 // Avoid zero-length array allocations
VisualStudioVersion = (string)token["vs-version"];
}
}
}
Loading