diff --git a/src/SourceBuild/Arcade/eng/common/templates/job/source-build-run-tarball-build.yml b/src/SourceBuild/Arcade/eng/common/templates/job/source-build-run-tarball-build.yml index 06bfd2b15dbd..5459e84150cd 100644 --- a/src/SourceBuild/Arcade/eng/common/templates/job/source-build-run-tarball-build.yml +++ b/src/SourceBuild/Arcade/eng/common/templates/job/source-build-run-tarball-build.yml @@ -36,32 +36,32 @@ jobs: installerBuildResourceId: ${{ parameters.installerBuildResourceId }} matrix: CentOSStream8-Online: - _BootstrapPrep: false + _BootstrapPrep: true _Container: ${{ parameters.centOSStream8Container }} _EnablePoison: false _ExcludeOmniSharpTests: true _RunOnline: true CentOSStream8-Offline: - _BootstrapPrep: false + _BootstrapPrep: true _Container: ${{ parameters.centOSStream8Container }} _EnablePoison: false _ExcludeOmniSharpTests: true _RunOnline: false ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: CentOSStream9-Offline: - _BootstrapPrep: false + _BootstrapPrep: true _Container: ${{ parameters.centOSStream9Container }} _EnablePoison: false _ExcludeOmniSharpTests: false _RunOnline: false Fedora36-Offline: - _BootstrapPrep: false + _BootstrapPrep: true _Container: ${{ parameters.fedora36Container }} _EnablePoison: true _ExcludeOmniSharpTests: false _RunOnline: false Ubuntu2004-Offline: - _BootstrapPrep: false + _BootstrapPrep: true _Container: ${{ parameters.ubuntu2004Container }} _EnablePoison: false _ExcludeOmniSharpTests: false diff --git a/src/SourceBuild/Arcade/tools/SourceBuildArcadeTarball.targets b/src/SourceBuild/Arcade/tools/SourceBuildArcadeTarball.targets index e7a9698c658d..97f4b4ce3b76 100644 --- a/src/SourceBuild/Arcade/tools/SourceBuildArcadeTarball.targets +++ b/src/SourceBuild/Arcade/tools/SourceBuildArcadeTarball.targets @@ -285,10 +285,6 @@ - - diff --git a/src/SourceBuild/tarball/content/Directory.Build.props b/src/SourceBuild/tarball/content/Directory.Build.props index a0feed9d1e2a..6ca72bb7a337 100644 --- a/src/SourceBuild/tarball/content/Directory.Build.props +++ b/src/SourceBuild/tarball/content/Directory.Build.props @@ -23,19 +23,6 @@ x64 false - - false - - true - true - - - false - false - true - false @@ -236,12 +223,8 @@ - - - - @@ -253,6 +236,10 @@ + + + + diff --git a/src/SourceBuild/tarball/content/eng/bootstrap/OverrideBootstrapVersions.props b/src/SourceBuild/tarball/content/eng/bootstrap/OverrideBootstrapVersions.props index d0a05029f861..ced02e9605b1 100644 --- a/src/SourceBuild/tarball/content/eng/bootstrap/OverrideBootstrapVersions.props +++ b/src/SourceBuild/tarball/content/eng/bootstrap/OverrideBootstrapVersions.props @@ -7,5 +7,9 @@ $(NonshippingRuntimeVersionFor700) $(NonshippingRuntimeVersionFor700) $(NonshippingRuntimeVersionFor700) + + 7.0.0 + 7.0.0 + 7.0.0 diff --git a/src/SourceBuild/tarball/content/eng/bootstrap/buildBootstrapPreviouslySB.csproj b/src/SourceBuild/tarball/content/eng/bootstrap/buildBootstrapPreviouslySB.csproj index a22d70373da7..4f2bbd079174 100644 --- a/src/SourceBuild/tarball/content/eng/bootstrap/buildBootstrapPreviouslySB.csproj +++ b/src/SourceBuild/tarball/content/eng/bootstrap/buildBootstrapPreviouslySB.csproj @@ -13,36 +13,40 @@ - + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + @@ -73,6 +77,30 @@ Targets="CopyDownloadedPackage" Properties="SourcePath=$(RestorePackagesPath);DestinationPath=$(UnpackedTarPath);PackageName=%(PackageDownload.Identity);PackageVersion=%(PackageDownload.Version)" /> + + + + + + + + + + + + + + + + + + diff --git a/src/SourceBuild/tarball/content/global.json b/src/SourceBuild/tarball/content/global.json index 1bf480e4e9ca..01432c8967bf 100644 --- a/src/SourceBuild/tarball/content/global.json +++ b/src/SourceBuild/tarball/content/global.json @@ -1,6 +1,6 @@ { "tools": { - "dotnet": "7.0.100" + "dotnet": "7.0.102" }, "msbuild-sdks": { "Microsoft.Build.CentralPackageVersions": "2.0.1", diff --git a/src/SourceBuild/tarball/content/repos/aspnetcore.proj b/src/SourceBuild/tarball/content/repos/aspnetcore.proj index ee6b65aaeae2..ff9d9fda172e 100644 --- a/src/SourceBuild/tarball/content/repos/aspnetcore.proj +++ b/src/SourceBuild/tarball/content/repos/aspnetcore.proj @@ -9,6 +9,7 @@ $(BuildCommandArgs) --no-build-repo-tasks $(BuildCommandArgs) --no-build-nodejs $(BuildCommandArgs) /p:PublishCompressedFilesPathPrefix=$(SourceBuiltAspNetCoreRuntime) + $(BuildCommandArgs) /p:PortableBuild=false /p:TargetRuntimeIdentifier=$(TargetRid) $(BuildCommandArgs) /p:MicrosoftNetFrameworkReferenceAssembliesVersion=1.0.0 diff --git a/src/SourceBuild/tarball/content/repos/installer.proj b/src/SourceBuild/tarball/content/repos/installer.proj index 0168d3ad63ba..6cbda514bb0d 100644 --- a/src/SourceBuild/tarball/content/repos/installer.proj +++ b/src/SourceBuild/tarball/content/repos/installer.proj @@ -30,7 +30,7 @@ $(BuildCommandArgs) /p:Rid=$(TargetRid) $(BuildCommandArgs) /p:DOTNET_INSTALL_DIR=$(DotNetCliToolDir) - $(BuildCommandArgs) /p:AspNetCoreInstallerRid=linux-$(Platform) + $(BuildCommandArgs) /p:AspNetCoreInstallerRid=$(TargetRid) $(BuildCommandArgs) /p:CoreSetupRid=freebsd-x64 /p:PortableBuild=true $(BuildCommandArgs) /p:CoreSetupRid=osx-x64 diff --git a/src/SourceBuild/tarball/content/repos/known-good.proj b/src/SourceBuild/tarball/content/repos/known-good.proj index 7adea7e84b0f..989d6e20df07 100644 --- a/src/SourceBuild/tarball/content/repos/known-good.proj +++ b/src/SourceBuild/tarball/content/repos/known-good.proj @@ -43,7 +43,6 @@ - diff --git a/src/SourceBuild/tarball/content/repos/package-source-build.proj b/src/SourceBuild/tarball/content/repos/package-source-build.proj index 0ada671fbe48..fbc5a0cc1a3a 100644 --- a/src/SourceBuild/tarball/content/repos/package-source-build.proj +++ b/src/SourceBuild/tarball/content/repos/package-source-build.proj @@ -50,7 +50,7 @@ $(OutputPath)$(SourceBuiltArtifactsTarballName).$(installerOutputPackageVersion).tar.gz - diff --git a/src/SourceBuild/tarball/content/repos/runtime-portable.proj b/src/SourceBuild/tarball/content/repos/runtime-portable.proj deleted file mode 100644 index 09b4625e9d29..000000000000 --- a/src/SourceBuild/tarball/content/repos/runtime-portable.proj +++ /dev/null @@ -1,47 +0,0 @@ - - - - - runtime - - - - - - - - - - - - - - - $(ProjectDirectory)artifacts/portableLog - $(ProjectDirectory)artifacts/portableObj - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/SourceBuild/tarball/content/repos/runtime.common.props b/src/SourceBuild/tarball/content/repos/runtime.common.props deleted file mode 100644 index cb02932f9982..000000000000 --- a/src/SourceBuild/tarball/content/repos/runtime.common.props +++ /dev/null @@ -1,47 +0,0 @@ - - - runtime - - - - - - - true - - - $(StandardSourceBuildArgs.Replace('-bl', '-nobl')) - - $(StandardSourceBuildCommand) $(BuildCommandArgs) - $(ArmEnvironmentVariables) $(StandardSourceBuildCommand) $(BuildCommandArgs) - - $(ProjectDirectory)/clean$(ShellExtension) - - - - - $(ProjectDirectory)global.json - $(ProjectDirectory)NuGet.config - false - true - - - - - - - - - - - - - - - - - - - - - diff --git a/src/SourceBuild/tarball/content/repos/runtime.common.targets b/src/SourceBuild/tarball/content/repos/runtime.common.targets deleted file mode 100644 index 862b70dc832d..000000000000 --- a/src/SourceBuild/tarball/content/repos/runtime.common.targets +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - $(ProjectDirectory)pkg/Microsoft.NETCore.Platforms/runtime.json - - - - - - - - - <_builtRuntimePackages Include="$(SourceBuiltAssetsDir)*.symbols.nupkg" /> - <_builtRuntimePackages> - $([System.String]::Copy('%(FileName)').Replace('symbols', 'nupkg')) - - - - - - - - - - - - diff --git a/src/SourceBuild/tarball/content/repos/runtime.proj b/src/SourceBuild/tarball/content/repos/runtime.proj index 59ea1d6fc3f0..85d0efa77c24 100644 --- a/src/SourceBuild/tarball/content/repos/runtime.proj +++ b/src/SourceBuild/tarball/content/repos/runtime.proj @@ -1,18 +1,57 @@ - + + + true + + $(ProjectDirectory)/clean$(ShellExtension) + $(TargetRid) osx-x64 freebsd-x64 win-x64 + <_platformIndex>$(NETCoreSdkRuntimeIdentifier.LastIndexOf('-')) + $(NETCoreSdkRuntimeIdentifier.Substring(0, $(_platformIndex))) + + <_platformIndex>$(NETCoreSdkPortableRuntimeIdentifier.LastIndexOf('-')) + $(NETCoreSdkPortableRuntimeIdentifier.Substring(0, $(_platformIndex))) + $(StandardSourceBuildArgs) $(BuildCommandArgs) /p:TargetRid=$(OverrideTargetRid) + $(BuildCommandArgs) /p:RuntimeOS=$(RuntimeOS) + $(BuildCommandArgs) /p:BaseOS=$(BaseOS) $(BuildCommandArgs) /p:SourceBuildNonPortable=true $(StandardSourceBuildCommand) $(BuildCommandArgs) + + + $(ProjectDirectory)global.json + $(ProjectDirectory)NuGet.config + false + true + + + + + + + + + + + + + + + + + + + + @@ -20,8 +59,49 @@ - - + + + + + + + + + + + + + $(ProjectDirectory)pkg/Microsoft.NETCore.Platforms/runtime.json + + + + + + + + + <_builtRuntimePackages Include="$(SourceBuiltAssetsDir)*.symbols.nupkg" /> + <_builtRuntimePackages> + $([System.String]::Copy('%(FileName)').Replace('symbols', 'nupkg')) + + + + + + + + + + + diff --git a/src/SourceBuild/tarball/content/repos/sdk.proj b/src/SourceBuild/tarball/content/repos/sdk.proj index 5d0fe449da45..442c548e667c 100644 --- a/src/SourceBuild/tarball/content/repos/sdk.proj +++ b/src/SourceBuild/tarball/content/repos/sdk.proj @@ -7,6 +7,9 @@ $(BuildCommandArgs) /p:PackageProjectUrl=https://github.com/dotnet/sdk $(BuildCommandArgs) /p:PublishCompressedFilesPathPrefix=$(SourceBuiltToolsetDir) + + $(BuildCommandArgs) /p:NativeAotSupported=false + true $(BuildCommandArgs) -v $(LogVerbosity) diff --git a/src/SourceBuild/tarball/content/repos/source-build-reference-packages.proj b/src/SourceBuild/tarball/content/repos/source-build-reference-packages.proj index a4fb27340f67..9f7c3853c4f3 100644 --- a/src/SourceBuild/tarball/content/repos/source-build-reference-packages.proj +++ b/src/SourceBuild/tarball/content/repos/source-build-reference-packages.proj @@ -4,7 +4,11 @@ $(BaseIntermediatePath)source-build-reference-package-cache - $(StandardSourceBuildCommand) $(StandardSourceBuildArgs) /p:LocalNuGetPackageCacheDirectory=$(LocalNuGetPackageCacheDirectory) + $(StandardSourceBuildArgs) + $(BuildCommandArgs) /p:MicrosoftNetCoreIlasmPackageRuntimeId=$(NETCoreSdkRuntimeIdentifier) + $(BuildCommandArgs) /p:LocalNuGetPackageCacheDirectory=$(LocalNuGetPackageCacheDirectory) + + $(StandardSourceBuildCommand) $(BuildCommandArgs) $(ProjectDirectory)NuGet.config $(ProjectDirectory)global.json @@ -12,6 +16,8 @@ true + + NU1504 diff --git a/src/SourceBuild/tarball/content/tools-local/init-build.proj b/src/SourceBuild/tarball/content/tools-local/init-build.proj index b2c3beed1e4d..0405ad8f1754 100644 --- a/src/SourceBuild/tarball/content/tools-local/init-build.proj +++ b/src/SourceBuild/tarball/content/tools-local/init-build.proj @@ -9,6 +9,7 @@ + @@ -22,6 +23,7 @@ + + + + + + -Date: Tue, 15 Nov 2022 17:34:00 +0000 -Subject: [PATCH] Address Microsoft.Build.Locator prebuilt - -Backport: https://github.com/dotnet/format/issues/1759 ---- - Directory.Packages.props | 2 +- - eng/Versions.props | 1 + - 2 files changed, 2 insertions(+), 1 deletion(-) - -diff --git a/Directory.Packages.props b/Directory.Packages.props -index c4bf3cf..f7e85b2 100644 ---- a/Directory.Packages.props -+++ b/Directory.Packages.props -@@ -10,7 +10,7 @@ - - - -- -+ - - - -diff --git a/eng/Versions.props b/eng/Versions.props -index fcd583b..2933963 100644 ---- a/eng/Versions.props -+++ b/eng/Versions.props -@@ -14,6 +14,7 @@ - - - 17.3.0-preview-22302-02 -+ 1.5.5 - 3.3.3 - 7.0.0-rc.1.22426.10 - diff --git a/src/redist/targets/Crossgen.targets b/src/redist/targets/Crossgen.targets index 399529689fce..753b86c67639 100644 --- a/src/redist/targets/Crossgen.targets +++ b/src/redist/targets/Crossgen.targets @@ -6,7 +6,7 @@ microsoft.netcore.app.runtime.$(SharedFrameworkRid) - microsoft.netcore.app.crossgen2.$(HostOSName)-$(BuildArchitecture) + microsoft.netcore.app.crossgen2.$(Crossgen2Rid) $(NuGetPackageRoot)/$(RuntimeNETCrossgenPackageName)/$(MicrosoftNETCoreAppRuntimePackageVersion)/tools/crossgen2$(ExeExtension) diff --git a/src/redist/targets/GenerateLayout.targets b/src/redist/targets/GenerateLayout.targets index ae911ab1c090..308fdfb2b6a9 100644 --- a/src/redist/targets/GenerateLayout.targets +++ b/src/redist/targets/GenerateLayout.targets @@ -84,6 +84,9 @@ dotnet-runtime$(PgoTerm)-$(VSRedistCommonNetCoreSharedFrameworkx6470PackageVersion)-$(SharedFrameworkRid)$(ArchiveExtension) windowsdesktop-runtime-$(MicrosoftWindowsDesktopAppRuntimePackageVersion)-$(SharedFrameworkRid)$(ArchiveExtension) + $(HostOSName)-$(BuildArchitecture) + $(SharedFrameworkRid) + $(SharedFrameworkRid) linux-x64 $(AspNetCoreInstallerRid) diff --git a/test/EndToEnd/ProjectBuildTests.cs b/test/EndToEnd/ProjectBuildTests.cs index ec6684750379..c231a7fc8849 100644 --- a/test/EndToEnd/ProjectBuildTests.cs +++ b/test/EndToEnd/ProjectBuildTests.cs @@ -2,6 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.InteropServices; @@ -248,6 +249,47 @@ public void ItCanCreateItemTemplate(string templateName) Assert.True(directory.EnumerateFileSystemInfos().Any()); } + [Theory] + // microsoft.dotnet.common.itemtemplates templates + [InlineData("class")] + [InlineData("struct")] + [InlineData("enum")] + [InlineData("record")] + [InlineData("interface")] + [InlineData("class", "C#")] + [InlineData("class", "VB")] + [InlineData("struct", "VB")] + [InlineData("enum", "VB")] + [InlineData("interface", "VB")] + public void ItCanCreateItemTemplateWithProjectRestriction(string templateName, string language = "") + { + var languageExtensionMap = new Dictionary() + { + { "", ".cs" }, + { "C#", ".cs" }, + { "VB", ".vb" } + }; + + DirectoryInfo directory = InstantiateProjectTemplate("classlib", language, withNoRestore: false); + string projectDirectory = directory.FullName; + string expectedItemName = $"TestItem_{templateName}"; + string newArgs = $"{templateName} --name {expectedItemName} --debug:ephemeral-hive"; + if (!string.IsNullOrWhiteSpace(language)) + { + newArgs += $" --language {language}"; + } + + new NewCommandShim() + .WithWorkingDirectory(projectDirectory) + .Execute(newArgs) + .Should().Pass(); + + //check if the template created files + Assert.True(directory.Exists); + Assert.True(directory.EnumerateFileSystemInfos().Any()); + Assert.True(directory.GetFile($"{expectedItemName}.{languageExtensionMap[language]}") != null); + } + [WindowsOnlyTheory] [InlineData("wpf", Skip = "https://github.com/dotnet/wpf/issues/2363")] [InlineData("winforms", Skip = "https://github.com/dotnet/wpf/issues/2363")] @@ -402,20 +444,9 @@ private static string DetectExpectedDefaultFramework(string template = "") private static void TestTemplateCreateAndBuild(string templateName, bool build = true, bool selfContained = false, string language = "", string framework = "") { - DirectoryInfo directory = TestAssets.CreateTestDirectory(identifier: string.IsNullOrWhiteSpace(language) ? templateName : $"{templateName}[{language}]"); + DirectoryInfo directory = InstantiateProjectTemplate(templateName, language); string projectDirectory = directory.FullName; - string newArgs = $"{templateName} --debug:ephemeral-hive --no-restore"; - if (!string.IsNullOrWhiteSpace(language)) - { - newArgs += $" --language {language}"; - } - - new NewCommandShim() - .WithWorkingDirectory(projectDirectory) - .Execute(newArgs) - .Should().Pass(); - if (!string.IsNullOrWhiteSpace(framework)) { //check if MSBuild TargetFramework property for *proj is set to expected framework @@ -454,5 +485,27 @@ private static void TestTemplateCreateAndBuild(string templateName, bool build = .Should().Pass(); } } + + private static DirectoryInfo InstantiateProjectTemplate(string templateName, string language = "", bool withNoRestore = true) + { + DirectoryInfo directory = TestAssets.CreateTestDirectory( + identifier: string.IsNullOrWhiteSpace(language) + ? templateName + : $"{templateName}[{language}]"); + string projectDirectory = directory.FullName; + + string newArgs = $"{templateName} --debug:ephemeral-hive {(withNoRestore ? "--no-restore" : "")}"; + if (!string.IsNullOrWhiteSpace(language)) + { + newArgs += $" --language {language}"; + } + + new NewCommandShim() + .WithWorkingDirectory(projectDirectory) + .Execute(newArgs) + .Should().Pass(); + + return directory; + } } }