Skip to content

Commit

Permalink
Remove bootstrap.proj (#5164)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffkl authored May 11, 2023
1 parent 5c64a80 commit ac6b25a
Show file tree
Hide file tree
Showing 31 changed files with 356 additions and 417 deletions.
7 changes: 7 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@

<ItemGroup>
<PackageVersion Include="FluentAssertions" Version="6.6.0" />
<PackageVersion Include="ILMerge" Version="3.0.21" />
<PackageVersion Include="Lucene.Net" Version="3.0.3" />
<PackageVersion Include="MessagePack" Version="2.2.60" />
<PackageVersion Include="Microsoft.Build" Version="$(MicrosoftBuildVersion)" />
<PackageVersion Include="Microsoft.Build.Artifacts" Version="4.2.0" />
<PackageVersion Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildVersion)" />
<PackageVersion Include="Microsoft.Build.Locator" Version="1.5.5" />
<PackageVersion Include="Microsoft.Build.Runtime" Version="$(MicrosoftBuildVersion)" />
Expand All @@ -39,6 +41,8 @@
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.3.1" />
<PackageVersion Include="Microsoft.CSharp" Version="$(SystemPackagesVersion)" />
<PackageVersion Include="Microsoft.DataAI.NuGetRecommender.Contracts" Version="2.1.0" />
<PackageVersion Include="Microsoft.DotNet.Build.Tasks.Feed" Version="6.0.0-beta.20528.5" />
<PackageVersion Include="Microsoft.DotNet.Maestro.Tasks" Version="1.1.0-beta.21378.2" />
<PackageVersion Include="Microsoft.Extensions.CommandLineUtils.Sources" Version="3.0.0-preview6.19253.5" />
<PackageVersion Include="Microsoft.Extensions.FileProviders.Abstractions" Version="$(MicrosoftExtensionsFileProvidersAbstractionsPackageVersion)" />
<PackageVersion Include="Microsoft.Extensions.FileSystemGlobbing" Version="$(MicrosoftExtensionsFileSystemGlobbingPackageVersion)" />
Expand Down Expand Up @@ -69,7 +73,9 @@
<PackageVersion Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageVersion Include="MSTest.TestFramework" Version="2.2.10" />
<PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
<PackageVersion Include="NuGet.Client.EndToEnd.TestData" Version="1.0.0" />
<PackageVersion Include="NuGet.Core" Version="2.14.0-rtm-832" />
<PackageVersion Include="NuGetValidator" version="2.1.1" />
<PackageVersion Include="Portable.BouncyCastle" Version="1.8.10" />
<PackageVersion Include="SharpZipLib" Version="1.3.3" />
<PackageVersion Include="System.Collections" Version="$(SystemPackagesVersion)" />
Expand Down Expand Up @@ -120,6 +126,7 @@

<ItemGroup>
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" Condition="'$(Shipping)' == 'true' AND '$(IsXPlat)' != 'true'" />
<GlobalPackageReference Include="Microsoft.VisualStudioEng.MicroBuild.Core" version="1.0.0" />
</ItemGroup>

<ItemGroup Condition=" '$(UsePublicApiAnalyzer)' == 'true' ">
Expand Down
13 changes: 9 additions & 4 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,15 @@ Invoke-BuildStep $VSMessage {
-ev +BuildErrors

Invoke-BuildStep 'Creating the EndToEnd test package' {
param($Configuration)
$EndToEndScript = Join-Path $PSScriptRoot scripts\cibuild\CreateEndToEndTestPackage.ps1 -Resolve
$OutDir = Join-Path $Artifacts VS15
& $EndToEndScript -c $Configuration -out $OutDir
$msbuildArgs = "test\TestUtilities\CreateEndToEndTestPackage\CreateEndToEndTestPackage.proj", "/p:Configuration=$Configuration", "/restore:false", "/property:BuildProjectReferences=false"

if ($Binlog)
{
$restoreArgs += "-bl:msbuild.createendtoendtestpackage.binlog"
}

Trace-Log ". `"$MSBuildExe`" $msbuildArgs"
& $MSBuildExe @msbuildArgs
} `
-args $Configuration `
-skip:(-not $PackageEndToEnd) `
Expand Down
3 changes: 0 additions & 3 deletions build.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ if [ "$CLEAR_CACHE" == "1" ]; then
fi

# restore packages
echo "dotnet msbuild build/bootstrap.proj /t:Restore"
dotnet msbuild build/bootstrap.proj /t:Restore

echo "dotnet msbuild build/build.proj /t:Restore /p:Configuration=Release /p:BuildNumber=1 /p:ReleaseLabel=beta"
dotnet msbuild build/build.proj /t:Restore /p:Configuration=Release /p:BuildNumber=1 /p:ReleaseLabel=beta

Expand Down
63 changes: 63 additions & 0 deletions build/BuildValidator.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<Project Sdk="Microsoft.Build.NoTargets">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<NuGetValidatorToolPath>$(PkgNuGetValidator)\tools\NuGetValidator.exe</NuGetValidatorToolPath>
<RepoRoot Condition="'$(RepoRoot)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildThisFileDirectory)', '.git\index'))</RepoRoot>
<LocalizationRepository>$(RepoRoot)\submodules\NuGet.Build.Localization\localize\comments\15</LocalizationRepository>
<TempDirectory Condition="'$(TempDirectory)' == ''">$(Temp)</TempDirectory>
<LogsBasePath Condition="'$(LogsBasePath)' == ''">$(MSBuildThisFileDirectory)BuildValidatorLogs</LogsBasePath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NuGetValidator" />
</ItemGroup>

<Target Name="ValidateConfiguration">
<Error Text="NuGet validator tool not found at '$(NuGetValidatorToolPath)'." Condition="!Exists('$(NuGetValidatorToolPath)')" />
<Error Text="Unable to determine the repository root, specify the path with the command-line argument /property:RepoRoot=&lt;path&gt;" Condition="'$(RepoRoot)' == ''" />
<Error Text="The localization repository was not found at '$(LocalizationRepository)'" Condition="!Exists('$(LocalizationRepository)')" />
</Target>

<Target Name="ValidateVsix"
DependsOnTargets="ValidateConfiguration"
Condition="'$(BuildRTM)' != 'true'">
<PropertyGroup>
<VsixLocation>$(RepoRoot)\artifacts\VS15\NuGet.Tools.vsix</VsixLocation>
<VsixExtractLocation>$(TempDirectory)\extractedVsix</VsixExtractLocation>
<LogsPath>$(LogsBasePath)\vsix</LogsPath>
</PropertyGroup>

<Delete Files="$(LogsPath)\**" />

<Message Text="Validating NuGet.Tools.Vsix localization..." Importance="High" />

<Exec Command="&quot;$(NuGetValidatorToolPath)&quot; localization --vsix --vsix-path &quot;$(VsixLocation)&quot; --vsix-extract-path &quot;$(VsixExtractLocation)&quot; --output-path &quot;$(LogsPath)&quot; --comments-path &quot;$(LocalizationRepository)&quot;" IgnoreStandardErrorWarningFormat="true" LogStandardErrorAsError="true" />

<OnError ExecuteTargets="IncludeValidatorLogsInBinLog"/>
</Target>

<Target Name="ValidateArtifacts"
DependsOnTargets="ValidateConfiguration"
Condition="'$(BuildRTM)' != 'true'">
<PropertyGroup>
<ArtifactsLocation>$(RepoRoot)\artifacts</ArtifactsLocation>
<VsixExtractLocation>$(TempDirectory)\extractedVsix</VsixExtractLocation>
<LogsPath>$(LogsBasePath)\artifacts</LogsPath>
</PropertyGroup>

<Delete Files="$(LogsPath)\**" />

<Message Text="Validating NuGet.Tools.Vsix localization..." Importance="High" />

<Exec Command="&quot;$(NuGetValidatorToolPath)&quot; localization --artifacts-path &quot;$(ArtifactsLocation)&quot; --output-path &quot;$(LogsPath)&quot; --comments-path &quot;$(LocalizationRepository)&quot; --filter-paths-containing net45" IgnoreStandardErrorWarningFormat="true" LogStandardErrorAsError="true" />

<OnError ExecuteTargets="IncludeValidatorLogsInBinLog"/>
</Target>

<Target Name="IncludeValidatorLogsInBinLog"
Condition="'$(LogsPath)' != ''">
<ItemGroup>
<EmbedInBinlog Include="$(LogsPath)\**" />
</ItemGroup>
</Target>
</Project>
24 changes: 0 additions & 24 deletions build/bootstrap.proj

This file was deleted.

4 changes: 2 additions & 2 deletions build/build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@
<Target Name="BuildNoVSIX" AfterTargets="BuildVS" Condition=" '$(IsXPlat)' != 'true' ">
<Message Text="Building" Importance="high" />

<MSBuild Projects="@(SolutionProjectsWithoutVSIX)"
<MSBuild Projects="@(SolutionProjects)"
Targets="Build"
Properties="$(CommonMSBuildProperties)" />
Properties="$(CommonMSBuildProperties);CreateVsixContainer=false" />
</Target>

<!--
Expand Down
6 changes: 0 additions & 6 deletions build/common.project.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'README.md'))\packages\Microsoft.VisualStudioEng.MicroBuild.Core\1.0.0\build\Microsoft.VisualStudioEng.MicroBuild.Core.props" Condition="Exists('$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), &quot;README.md&quot;))\packages\Microsoft.VisualStudioEng.MicroBuild.Core\1.0.0\build\Microsoft.VisualStudioEng.MicroBuild.Core.props')" />

<!-- Helper properties -->
<PropertyGroup>
<IsXPlat>false</IsXPlat>
Expand Down Expand Up @@ -40,17 +38,13 @@
<SharedDirectory>$(BuildCommonDirectory)Shared</SharedDirectory>
<NupkgOutputDirectory>$(ArtifactsDirectory)nupkgs\</NupkgOutputDirectory>
<SolutionPackagesFolder>$(RepositoryRootDirectory)packages\</SolutionPackagesFolder>
<ILMergeExePath>$(SolutionPackagesFolder)ilmerge\3.0.21\tools\net452\ILMerge.exe</ILMergeExePath>
<EnlistmentRoot>$(RepositoryRootDirectory)</EnlistmentRoot>
<EnlistmentRootSrc>$(RepositoryRootDirectory)src</EnlistmentRootSrc>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(RepositoryRootDirectory)</SolutionDir>
<ArtifactRoot>$(ArtifactsDirectory)</ArtifactRoot>
<NuGetBuildLocalizationRepository>$(RepositoryRootDirectory)submodules\NuGet.Build.Localization\</NuGetBuildLocalizationRepository>
<LocalizationRootDirectory>$(NuGetBuildLocalizationRepository)localize</LocalizationRootDirectory>
<LocalizationWorkDirectory>$(RepositoryRootDirectory)localize</LocalizationWorkDirectory>
<MicroBuildDirectory>$(SolutionPackagesFolder)microsoft.visualstudioeng.microbuild.core\1.0.0\build\</MicroBuildDirectory>
<MicrosoftDotNetBuildTasksFeedFilePath>$(SolutionPackagesFolder)microsoft.dotnet.build.tasks.feed\6.0.0-beta.20528.5\tools\netcoreapp2.1\Microsoft.DotNet.Build.Tasks.Feed.dll</MicrosoftDotNetBuildTasksFeedFilePath>
<MicrosoftDotNetMaestroTasksFilePath>$(SolutionPackagesFolder)microsoft.dotnet.maestro.tasks\1.1.0-beta.21378.2\tools\netcoreapp3.1\Microsoft.DotNet.Maestro.Tasks.dll</MicrosoftDotNetMaestroTasksFilePath>
<NoWarn>$(NoWarn);NU5105;MSB3277;NETSDK1138</NoWarn>
<!-- additional warnings new in .NET 6 that we need to disable when building with source-build -->
<NoWarn Condition="'$(DotNetBuildFromSource)' == 'true'">$(NoWarn);CS1998;CA1416;CS0618;CS1574</NoWarn>
Expand Down
17 changes: 0 additions & 17 deletions build/common.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ $ConfigureJson = Join-Path $Artifacts configure.json
$BuiltInVsWhereExe = "${Env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$VSVersion = $env:VisualStudioVersion
$DotNetExe = Join-Path $CLIRoot 'dotnet.exe'
$ILMerge = Join-Path $NuGetClientRoot 'packages\ilmerge\2.14.1208\tools\ILMerge.exe'

Set-Alias dotnet $DotNetExe
Set-Alias ilmerge $ILMerge

Function Read-PackageSources {
param($NuGetConfig)
Expand Down Expand Up @@ -309,18 +307,3 @@ Function Clear-Nupkgs {
Remove-Item $Nupkgs\*.nupkg -Force
}
}

Function Restore-SolutionPackages {
[CmdletBinding()]
param(
)
$opts = 'msbuild', '-t:restore'
$opts += "${NuGetClientRoot}\build\bootstrap.proj"

Trace-Log "Restoring packages @""$NuGetClientRoot"""
Trace-Log "dotnet $opts"
& dotnet $opts
if (-not $?) {
Error-Log "Restore failed @""$NuGetClientRoot"". Code: ${LASTEXITCODE}"
}
}
3 changes: 0 additions & 3 deletions build/common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,4 @@ Condition=" ('%(Extension)' == '.dll' OR '%(Filename)' == 'NuGet.CommandLine.XPl
Text="Newtonsoft.Json must be version $(NewtonsoftJsonPackageVersion) but resolved %(Reference.NuGetPackageVersion)"
Condition=" %(Reference.NuGetPackageId) == 'Newtonsoft.Json' AND %(Reference.NuGetPackageVersion) != '$(NewtonsoftJsonPackageVersion)' " />
</Target>

<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'README.md'))\packages\Microsoft.VisualStudioEng.MicroBuild.Core\1.0.0\build\Microsoft.VisualStudioEng.MicroBuild.Core.targets" Condition="Exists('$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), &quot;README.md&quot;))\packages\Microsoft.VisualStudioEng.MicroBuild.Core\1.0.0\build\Microsoft.VisualStudioEng.MicroBuild.Core.targets')" />

</Project>
30 changes: 17 additions & 13 deletions build/loc.proj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project DefaultTargets="AfterBuild">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'README.md'))\build\common.props" />
<Project Sdk="Microsoft.Build.NoTargets" DefaultTargets="AfterBuild">

<!-- Configuration/global properties -->
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<CommonMSBuildProperties>
Configuration=$(Configuration);
ReleaseLabel=$(ReleaseLabel);
Expand All @@ -12,22 +12,27 @@
<OutDir>$(ArtifactsDirectory)</OutDir>
<IntermediateOutputPath>$(ArtifactsDirectory)</IntermediateOutputPath>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Web.Xdt" GeneratePathProperty="true" />
</ItemGroup>

<Target Name="LocalizeNonProjectFiles">
<ItemGroup>
<NonProjectFilesToMove Include="$(SolutionPackagesFolder)microsoft.web.xdt\3.0.0\lib\netstandard2.0\Microsoft.Web.XmlTransform.dll">
<DestinationDir>$(ArtifactsDirectory)microsoft.web.xdt\3.0.0\lib\netstandard2.0\Microsoft.Web.XmlTransform.dll</DestinationDir>
<NonProjectFilesToMove Include="$(PkgMicrosoft_Web_Xdt)\lib\netstandard2.0\Microsoft.Web.XmlTransform.dll">
<DestinationDir>$(ArtifactsDirectory)microsoft.web.xdt\lib\netstandard2.0\</DestinationDir>
</NonProjectFilesToMove>
<NonProjectFilesToMove Include="$(SolutionPackagesFolder)microsoft.web.xdt\3.0.0\lib\net40\Microsoft.Web.XmlTransform.dll">
<DestinationDir>$(ArtifactsDirectory)microsoft.web.xdt\3.0.0\lib\net40\Microsoft.Web.XmlTransform.dll</DestinationDir>
<NonProjectFilesToMove Include="$(PkgMicrosoft_Web_Xdt)\lib\net40\Microsoft.Web.XmlTransform.dll">
<DestinationDir>$(ArtifactsDirectory)microsoft.web.xdt\lib\net40\</DestinationDir>
</NonProjectFilesToMove>
<NonProjectFilesToMove Include="..\src\NuGet.Clients\NuGet.VisualStudio.Client\extension.vsixlangpack">
<DestinationDir>$(ArtifactsDirectory)vsixlangpack\extension.vsixlangpack</DestinationDir>
<DestinationDir>$(ArtifactsDirectory)vsixlangpack\</DestinationDir>
</NonProjectFilesToMove>
</ItemGroup>
<Copy SourceFiles="@(NonProjectFilesToMove)" DestinationFiles="@(NonProjectFilesToMove->'%(DestinationDir)')"/>
<Copy SourceFiles="@(NonProjectFilesToMove)" DestinationFiles="@(NonProjectFilesToMove->'%(DestinationDir)%(Filename)%(Extension)')">
<Output TaskParameter="CopiedFiles" ItemName="FilesToLocalize"/>
</Copy>
<ItemGroup>
<FilesToLocalize Include="@(NonProjectFilesToMove->'%(DestinationDir)')">
<FilesToLocalize Update="@(FilesToLocalize)">
<TranslationFile>$(LocalizationWorkDirectory)\{Lang}\15\%(Filename)%(Extension).lcl</TranslationFile> <!--Required: translation file-->
<LciCommentFile>$(LocalizationWorkDirectory)\comments\15\%(Filename)%(Extension).lci</LciCommentFile>
<Parser Condition="'%(Extension)' == '.vsixlangpack'">210</Parser>
Expand All @@ -37,7 +42,9 @@
</ItemGroup>
</Target>

<Target Name="BatchLocalize">
<Target Name="BatchLocalize"
BeforeTargets="AfterBuild"
DependsOnTargets="LocalizeNonProjectFiles">
<ItemGroup>
<_SubmoduleRepo Include="$(LocalizationRootDirectory)\**\*" />
<_SubmoduleFiles Include="@(_SubmoduleRepo)">
Expand Down Expand Up @@ -99,7 +106,4 @@
<Copy SourceFiles="@(_EnglishBinaries)" DestinationFiles="@(_EnglishBinaries->'%(DestinationPath)')" />
<Copy SourceFiles="@(_LocalizeFiles)" DestinationFiles="@(_LocalizeFiles->'%(DestinationPath)')" />
</Target>

<Target Name="AfterBuild" DependsOnTargets="LocalizeNonProjectFiles;BatchLocalize"/>
<Import Project="$(MicroBuildDirectory)Microsoft.VisualStudioEng.MicroBuild.Core.targets" />
</Project>
Loading

0 comments on commit ac6b25a

Please sign in to comment.