Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffkl committed Feb 27, 2023
1 parent ab98b47 commit fc50b25
Show file tree
Hide file tree
Showing 15 changed files with 129 additions and 202 deletions.
2 changes: 2 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<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.4.1" />
<PackageVersion Include="Microsoft.Build.Runtime" Version="$(MicrosoftBuildVersion)" />
Expand Down Expand Up @@ -72,6 +73,7 @@
<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" />
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
2 changes: 0 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ 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
15 changes: 0 additions & 15 deletions build/common.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -325,18 +325,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}"
}
}
5 changes: 0 additions & 5 deletions configure.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ Invoke-BuildStep 'Installing .NET CLI' {
Install-DotnetCLI -Force:$Force
} -ev +BuildErrors

# Restoring tools required for build
Invoke-BuildStep 'Restoring solution packages' {
Restore-SolutionPackages
} -ev +BuildErrors

Invoke-BuildStep 'Cleaning package cache' {
Clear-PackageCache
} -skip:(-not $CleanCache) -ev +BuildErrors
Expand Down
20 changes: 10 additions & 10 deletions eng/pipelines/templates/Build_and_UnitTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ steps:
inputs:
solution: "setup\\Microsoft.VisualStudio.NuGet.Core\\Microsoft.VisualStudio.NuGet.Core.vsmanproj"
configuration: "$(BuildConfiguration)"
msbuildArguments: "/restore:false /property:ManifestDirPath=$(Build.ArtifactStagingDirectory)/sbom /binarylogger:$(Build.StagingDirectory)\\binlog\\14.GenerateVSManifestForVSIX.binlog"
msbuildArguments: "/property:ManifestDirPath=$(Build.ArtifactStagingDirectory)/sbom /binarylogger:$(Build.StagingDirectory)\\binlog\\14.GenerateVSManifestForVSIX.binlog"
condition: " and(succeeded(),eq(variables['BuildRTM'], 'false')) "

- task: MSBuild@1
Expand All @@ -300,12 +300,12 @@ steps:
msbuildArguments: "/property:IsVsixBuild=false /property:ManifestDirPath=$(Build.ArtifactStagingDirectory)/sbom /binarylogger:$(Build.StagingDirectory)\\binlog\\15.GenerateVSManifestForToolsVSIX.binlog"
condition: " and(succeeded(),eq(variables['BuildRTM'], 'false')) "

- task: PowerShell@1
- task: MSBuild@1
displayName: "Create EndToEnd Test Package"
inputs:
scriptName: "$(Build.Repository.LocalPath)\\scripts\\cibuild\\CreateEndToEndTestPackage.ps1"
arguments: "-c $(BuildConfiguration) -out $(Build.Repository.LocalPath)\\artifacts\\VS15"
failOnStandardError: "true"
solution: "$(Build.Repository.LocalPath)\\test\\TestUtilities\\CreateEndToEndTestPackage\\CreateEndToEndTestPackage.proj"
configuration: "$(BuildConfiguration)"
msbuildArguments: "/property:EndToEndPackageOutputPath=$(Build.Repository.LocalPath)\\artifacts\\VS15 /binarylogger:$(Build.StagingDirectory)\\binlog\\16.CreateEndToEndTestPackage.binlog"
condition: " and(succeeded(),eq(variables['BuildRTM'], 'false')) "

- task: NuGetCommand@2
Expand Down Expand Up @@ -360,7 +360,7 @@ steps:
displayName: 'Generate .runsettings files'
inputs:
solution: 'build\runsettings.proj'
msbuildArguments: '/restore:false /property:OutputPath="$(Build.Repository.LocalPath)\artifacts\RunSettings" /property:TestDrop="RunSettings/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildId)" /property:ProfilingInputsDrop="ProfilingInputs/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildId)" /binarylogger:$(Build.StagingDirectory)\\binlog\\16.GenerateRunSettings.binlog'
msbuildArguments: '/restore:false /property:OutputPath="$(Build.Repository.LocalPath)\artifacts\RunSettings" /property:TestDrop="RunSettings/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildId)" /property:ProfilingInputsDrop="ProfilingInputs/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildId)" /binarylogger:$(Build.StagingDirectory)\\binlog\\17.GenerateRunSettings.binlog'
condition: "and(succeeded(), eq(variables['BuildRTM'], 'false'))"

- task: PowerShell@1
Expand Down Expand Up @@ -430,7 +430,7 @@ steps:
inputs:
solution: "build\\symbols.proj"
configuration: "$(BuildConfiguration)"
msbuildArguments: "/restore:false /property:IsSymbolBuild=true /property:BuildRTM=$(BuildRTM) /binarylogger:$(Build.StagingDirectory)\\binlog\\17.CollectBuildSymbols.binlog"
msbuildArguments: "/restore:false /property:IsSymbolBuild=true /property:BuildRTM=$(BuildRTM) /binarylogger:$(Build.StagingDirectory)\\binlog\\18.CollectBuildSymbols.binlog"
maximumCpuCount: true
condition: " and(succeeded(), eq(variables['IsOfficialBuild'], 'true')) "

Expand All @@ -457,15 +457,15 @@ steps:
inputs:
solution: "build\\BuildValidator.proj"
configuration: "$(BuildConfiguration)"
msbuildArguments: "/target:ValidateVsix /property:BuildRTM=$(BuildRTM) /property:LogsBasePath=$(Build.Repository.LocalPath)\\logs\\BuildValidatorLogs /property:TempDirectory=$(Agent.TempDirectory) /binarylogger:$(Build.StagingDirectory)\\binlog\\18.ValidateVsixLocalization.binlog"
msbuildArguments: "/target:ValidateVsix /property:BuildRTM=$(BuildRTM) /property:LogsBasePath=$(Build.Repository.LocalPath)\\logs\\BuildValidatorLogs /property:TempDirectory=$(Agent.TempDirectory) /binarylogger:$(Build.StagingDirectory)\\binlog\\19.ValidateVsixLocalization.binlog"
condition: "and(succeeded(), eq(variables['BuildRTM'], 'false'))"

- task: MSBuild@1
displayName: "LocValidation: Verify Artifacts"
inputs:
solution: "build\\BuildValidator.proj"
configuration: "$(BuildConfiguration)"
msbuildArguments: "/target:ValidateArtifacts /property:BuildRTM=$(BuildRTM) /property:LogsBasePath=$(Build.Repository.LocalPath)\\logs\\BuildValidatorLogs /property:TempDirectory=$(Agent.TempDirectory) /binarylogger:$(Build.StagingDirectory)\\binlog\\19.ValidateArtifactsLocalization.binlog"
msbuildArguments: "/target:ValidateArtifacts /property:BuildRTM=$(BuildRTM) /property:LogsBasePath=$(Build.Repository.LocalPath)\\logs\\BuildValidatorLogs /property:TempDirectory=$(Agent.TempDirectory) /binarylogger:$(Build.StagingDirectory)\\binlog\\20.ValidateArtifactsLocalization.binlog"
condition: "and(succeeded(), eq(variables['BuildRTM'], 'false'))"

- task: PublishPipelineArtifact@1
Expand All @@ -482,7 +482,7 @@ steps:
- task: CmdLine@2
displayName: "Publish to the .NET Core build asset registry (BAR)"
inputs:
script: dotnet msbuild $(Build.Repository.LocalPath)\build\publish.proj /t:PublishToBuildAssetRegistry /property:NuGetClientNupkgsDirectoryPath=$(Build.Repository.LocalPath)\artifacts\$(NupkgOutputDir) /property:BUILD_BUILDNUMBER=$(Build.BuildNumber) /property:BUILD_SOURCEBRANCH=$(Build.SourceBranchName) /property:BUILD_SOURCEVERSION=$(Build.SourceVersion) /property:BUILD_REPOSITORY_URI=$(Build.Repository.Uri) /property:BUILD_REPOSITORY_NAME=$(Build.Repository.Name) /property:ArtifactsLogDir=$(Build.Repository.LocalPath)\artifacts\manifests\ /property:MaestroApiEndpoint=$(MaestroApiEndpoint) /property:MaestroAccessToken=$(MaestroAccessToken) /binarylogger:$(Build.StagingDirectory)\binlog\PublishToBuildAssetRegistry.binlog
script: dotnet msbuild $(Build.Repository.LocalPath)\build\publish.proj /t:PublishToBuildAssetRegistry /property:NuGetClientNupkgsDirectoryPath=$(Build.Repository.LocalPath)\artifacts\$(NupkgOutputDir) /property:BUILD_BUILDNUMBER=$(Build.BuildNumber) /property:BUILD_SOURCEBRANCH=$(Build.SourceBranchName) /property:BUILD_SOURCEVERSION=$(Build.SourceVersion) /property:BUILD_REPOSITORY_URI=$(Build.Repository.Uri) /property:BUILD_REPOSITORY_NAME=$(Build.Repository.Name) /property:ArtifactsLogDir=$(Build.Repository.LocalPath)\artifacts\manifests\ /property:MaestroApiEndpoint=$(MaestroApiEndpoint) /property:MaestroAccessToken=$(MaestroAccessToken) /binarylogger:$(Build.StagingDirectory)\binlog\21.PublishToBuildAssetRegistry.binlog
workingDirectory: cli
failOnStderr: true
env:
Expand Down
140 changes: 0 additions & 140 deletions scripts/cibuild/CreateEndToEndTestPackage.ps1

This file was deleted.

9 changes: 0 additions & 9 deletions scripts/funcTests/runFuncTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,6 @@ rm -rf "/tmp/"dotnet.*
echo "second dotnet cli install finished at `date -u +"%Y-%m-%dT%H:%M:%S"`"
echo "================="

#restore solution packages
dotnet msbuild -t:restore "$DIR/build/bootstrap.proj" -bl:"$BUILD_STAGINGDIRECTORY/binlog/01.RestoreBootstrap.binlog"
if [ $? -ne 0 ]; then
echo "Restore failed!!"
exit 1
fi

echo "bootstrap project restore finished at `date -u +"%Y-%m-%dT%H:%M:%S"`"

# init the repo

git submodule init
Expand Down
6 changes: 6 additions & 0 deletions setup/After.Microsoft.Common.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project>
<PropertyGroup Condition="'$(MSBuildProjectExtension)' == '.vsmanproj'">
<OutputType />
<TargetExt />
</PropertyGroup>
</Project>
6 changes: 4 additions & 2 deletions setup/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
<PropertyGroup>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<GenerateAdditionalSources>false</GenerateAdditionalSources>
<SetupShouldNotImportMicrosoftCommonTargets>true</SetupShouldNotImportMicrosoftCommonTargets>
<CustomAfterMicrosoftCommonTargets>$(CustomAfterMicrosoftCommonTargets);$(MSBuildThisFileDirectory)After.Microsoft.Common.targets</CustomAfterMicrosoftCommonTargets>
</PropertyGroup>
</Project>
</Project>
11 changes: 11 additions & 0 deletions setup/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)../'))" />
<PropertyGroup>
<PackageOutputPath>$(OutputPath)$(OutputName)</PackageOutputPath>
<CompileDependsOn Condition="'$(MSBuildProjectExtension)' == '.vsmanproj'">$(CompileDependsOn);GenerateSetupManifest</CompileDependsOn>
</PropertyGroup>
<PropertyGroup Condition="'$(MSBuildProjectExtension)' == '.vsmanproj'">
<TargetFileName>$(TargetName)$(TargetExt)</TargetFileName>
<TargetPath>$(TargetDir)$(TargetFileName)</TargetPath>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<Project Sdk="Microsoft.Build.NoTargets">
<Project>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<OutputArchitecture>neutral</OutputArchitecture>
<OutputLocalized>false</OutputLocalized>
<OutputName>$(MSBuildProjectName)</OutputName>
<TargetName>Microsoft.VisualStudio.NuGet.BuildTools</TargetName>
<OutputName>$(TargetName)</OutputName>
<OutputType>vsix</OutputType>
<IsPackage>true</IsPackage>
<MajorVSVersion>$([MSBuild]::Add($(MajorNuGetVersion), 11))</MajorVSVersion>
<!-- We set this to false here so we can batch sign the vsix later -->
<MicroBuild_SigningEnabled>false</MicroBuild_SigningEnabled>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -28,12 +29,10 @@
<Package Include="Microsoft.VisualStudio.NuGet.BuildTools.swr" />
</ItemGroup>

<Target Name="TriggerBuildDependsOn"
BeforeTargets="Build"
DependsOnTargets="$(BuildDependsOn)" />

<Target Name="CopyToDropFolder" AfterTargets="Build">
<Copy SourceFiles="$(OutputPath)$(MSBuildProjectName).vsix" DestinationFolder="$(VsixPublishDestination)" />
<Copy SourceFiles="$(OutputPath)$(MSBuildProjectName).json" DestinationFolder="$(VsixPublishDestination)" />
<Copy SourceFiles="$(OutputPath)$(TargetName).vsix" DestinationFolder="$(VsixPublishDestination)" />
<Copy SourceFiles="$(OutputPath)$(TargetName).json" DestinationFolder="$(VsixPublishDestination)" />
</Target>

<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
</Project>
Loading

0 comments on commit fc50b25

Please sign in to comment.