diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..21e4302b9 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,149 @@ +# editorconfig.org + +# top-most EditorConfig file +root = true + +# Default settings: +# A newline ending every file +# Use 4 spaces as indentation +[*] +insert_final_newline = true +indent_style = space +indent_size = 4 + +[project.json] +indent_size = 2 + +# C# files +[*.cs] +# New line preferences +csharp_new_line_before_open_brace = all +csharp_new_line_before_else = true +csharp_new_line_before_catch = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_within_query_expression_clauses = true + +# Indentation preferences +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_switch_labels = true +csharp_indent_labels = flush_left + +# avoid this. unless absolutely necessary +dotnet_style_qualification_for_field = false:suggestion +dotnet_style_qualification_for_property = false:suggestion +dotnet_style_qualification_for_method = false:suggestion +dotnet_style_qualification_for_event = false:suggestion + +# only use var when it's obvious what the variable type is +csharp_style_var_for_built_in_types = false:none +csharp_style_var_when_type_is_apparent = false:none +csharp_style_var_elsewhere = false:suggestion + +# use language keywords instead of BCL types +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion +dotnet_style_predefined_type_for_member_access = true:suggestion + +# name all constant fields using PascalCase +dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields +dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style + +dotnet_naming_symbols.constant_fields.applicable_kinds = field +dotnet_naming_symbols.constant_fields.required_modifiers = const + +dotnet_naming_style.pascal_case_style.capitalization = pascal_case + +# internal and private fields should be _camelCase +dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion +dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields +dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style + +dotnet_naming_symbols.private_internal_fields.applicable_kinds = field +dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal + +dotnet_naming_style.camel_case_underscore_style.required_prefix = _ +dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case + +# Code style defaults +dotnet_sort_system_directives_first = true +csharp_preserve_single_line_blocks = true +csharp_preserve_single_line_statements = false + +# Expression-level preferences +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion + +# Expression-bodied members +csharp_style_expression_bodied_methods = false:none +csharp_style_expression_bodied_constructors = false:none +csharp_style_expression_bodied_operators = false:none +csharp_style_expression_bodied_properties = true:none +csharp_style_expression_bodied_indexers = true:none +csharp_style_expression_bodied_accessors = true:none + +# Pattern matching +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +csharp_style_inlined_variable_declaration = true:suggestion + +# Null checking preferences +csharp_style_throw_expression = true:suggestion +csharp_style_conditional_delegate_call = true:suggestion + +# Space preferences +csharp_space_after_cast = false +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_after_comma = true +csharp_space_after_dot = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_after_semicolon_in_for_statement = true +csharp_space_around_binary_operators = before_and_after +csharp_space_around_declaration_statements = do_not_ignore +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_before_comma = false +csharp_space_before_dot = false +csharp_space_before_open_square_brackets = false +csharp_space_before_semicolon_in_for_statement = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_parentheses = false +csharp_space_between_square_brackets = false + +# C++ Files +[*.{cpp,h,in}] +curly_bracket_next_line = true +indent_brace_style = Allman + +# Xml project files +[*.{csproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}] +indent_size = 2 + +# Xml build files +[*.builds] +indent_size = 2 + +# Xml files +[*.{xml,stylecop,resx,ruleset}] +indent_size = 2 + +# Xml config files +[*.{props,targets,config,nuspec}] +indent_size = 2 + +# Shell scripts +[*.sh] +end_of_line = lf +[*.{cmd, bat}] +end_of_line = crlf diff --git a/.gitattributes b/.gitattributes index 50950c656..4422d1501 100644 --- a/.gitattributes +++ b/.gitattributes @@ -51,4 +51,5 @@ *.vbproj text=auto *.fsproj text=auto *.dbproj text=auto +*.xlf text=auto *.sln text=auto eol=crlf \ No newline at end of file diff --git a/.gitignore b/.gitignore index a9597138b..847693d1d 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,9 @@ Library/ # local nuget cache .nuget/ +# NuGet.Config at the root +/NuGet.Config + # NuGet v3 restore drops these even though we don't use MSBuild :( *.nuget.targets *.nuget.props diff --git a/Directory.Build.props b/Directory.Build.props index 044792b52..74d64c8aa 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -21,12 +21,17 @@ tools\TestAssetsDependencies\TestAssetsDependencies.csproj $(NUGET_PACKAGES) $(RepoRoot)/.nuget/packages - $(RepoRoot)/build_projects/dotnet-cli-build/bin/dotnet-cli-build.dll + build_projects/dotnet-cli-build/bin + dotnet-cli-build.dll + $(RepoRoot)/$(RelativeCLIBuildBinaries)/$(RelativeCLIBuildDllName) + $(RepoRoot)/build_projects/dotnet-cli-build/bin/Microsoft.DotNet.Build.Tasks.Feed.dll true true - netcoreapp2.0 + netcoreapp2.2 + + 2.2 @@ -36,11 +41,13 @@ tools\TestAssetsDependencies\TestAssetsDependencies.csproj + + + - @@ -50,11 +57,9 @@ tools\TestAssetsDependencies\TestAssetsDependencies.csproj - - + - diff --git a/Documentation/general/aspnetcore-tools.md b/Documentation/general/aspnetcore-tools.md new file mode 100644 index 000000000..371c1a443 --- /dev/null +++ b/Documentation/general/aspnetcore-tools.md @@ -0,0 +1,10 @@ +ASP.NET Core Command Line Tools +=============================== + +The .NET Core CLI includes some commands that are specific to ASP.NET Core projects. + + - dotnet dev-certs + - dotnet user-secrets + - dotnet sql-cache + +For more information on these tools, see . diff --git a/Microsoft.DotNet.Cli.sln b/Microsoft.DotNet.Cli.sln index 3be7078be..94e1c4fad 100644 --- a/Microsoft.DotNet.Cli.sln +++ b/Microsoft.DotNet.Cli.sln @@ -1,6 +1,7 @@ + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26730.0 +VisualStudioVersion = 15.0.27130.2020 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{ED2FE3E2-F7E7-4389-8231-B65123F2076F}" EndProject @@ -21,18 +22,20 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestPackages", "TestPackage EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{89905EC4-BC0F-443B-8ADF-691321F10108}" ProjectSection(SolutionItems) = preProject + build\AppHostTemplate.proj = build\AppHostTemplate.proj build\AzureInfo.props = build\AzureInfo.props build\BackwardsCompatibilityRuntimes.props = build\BackwardsCompatibilityRuntimes.props build\BranchInfo.props = build\BranchInfo.props build\Branding.props = build\Branding.props build\BuildDefaults.props = build\BuildDefaults.props build\BuildInfo.targets = build\BuildInfo.targets + build\BundledDotnetTools.proj = build\BundledDotnetTools.proj + build\BundledDotnetTools.props = build\BundledDotnetTools.props build\BundledRuntimes.props = build\BundledRuntimes.props build\BundledSdks.props = build\BundledSdks.props build\BundledTemplates.proj = build\BundledTemplates.proj build\BundledTemplates.props = build\BundledTemplates.props build\BundledTools.props = build\BundledTools.props - build\BundledVersions.targets = build\BundledVersions.targets build\Compile.targets = build\Compile.targets build\CrossGen.props = build\CrossGen.props build\DependencyVersions.props = build\DependencyVersions.props @@ -53,11 +56,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{89905EC4 build\Publish.targets = build\Publish.targets build\RestoreDependency.proj = build\RestoreDependency.proj build\sdks\sdks.csproj = build\sdks\sdks.csproj + build\SetupPreviousStage.props = build\SetupPreviousStage.props build\Signing.proj = build\Signing.proj build\SetupPreviousStage.props = build\SetupPreviousStage.props build\Test.targets = build\Test.targets build\Version.props = build\Version.props - build\VersionBadge.props = build\VersionBadge.props EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "package", "package", "{FD7D515A-D10F-4F49-B8AE-21CF7ED071AE}" @@ -139,12 +142,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Configurer EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.InternalAbstractions", "src\Microsoft.DotNet.InternalAbstractions\Microsoft.DotNet.InternalAbstractions.csproj", "{570950AD-A080-4F32-980C-F50E312910DF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.TestFramework", "src\Microsoft.DotNet.TestFramework\Microsoft.DotNet.TestFramework.csproj", "{6592A22C-2386-4E83-A4D3-FC08075C723A}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "redist", "src\redist\redist.csproj", "{098D9321-1201-4974-A75E-F58EBCD98ACF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "tool_roslyn", "src\tool_roslyn\tool_roslyn.csproj", "{A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "tool_msbuild", "src\tool_msbuild\tool_msbuild.csproj", "{D82A3246-9831-4024-A9B2-1932EEF3D56F}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "tool_nuget", "src\tool_nuget\tool_nuget.csproj", "{BE4C655A-DC54-4408-B739-743456D34111}" @@ -227,7 +226,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "tool_fsc", "src\tool_fsharp EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.MSBuildSdkResolver", "src\Microsoft.DotNet.MSBuildSdkResolver\Microsoft.DotNet.MSBuildSdkResolver.csproj", "{FCDFAF40-CC16-4D49-96C0-E49F195E7142}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-cli-build.Tests", "build_projects\dotnet-cli-build.Tests\dotnet-cli-build.Tests.csproj", "{84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -629,30 +627,6 @@ Global {570950AD-A080-4F32-980C-F50E312910DF}.RelWithDebInfo|x64.Build.0 = Release|Any CPU {570950AD-A080-4F32-980C-F50E312910DF}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU {570950AD-A080-4F32-980C-F50E312910DF}.RelWithDebInfo|x86.Build.0 = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.Debug|x64.ActiveCfg = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.Debug|x64.Build.0 = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.Debug|x86.ActiveCfg = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.Debug|x86.Build.0 = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.MinSizeRel|Any CPU.ActiveCfg = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.MinSizeRel|Any CPU.Build.0 = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.MinSizeRel|x64.ActiveCfg = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.MinSizeRel|x64.Build.0 = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.MinSizeRel|x86.ActiveCfg = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.MinSizeRel|x86.Build.0 = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.Release|Any CPU.Build.0 = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.Release|x64.ActiveCfg = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.Release|x64.Build.0 = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.Release|x86.ActiveCfg = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.Release|x86.Build.0 = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.RelWithDebInfo|x64.Build.0 = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU - {6592A22C-2386-4E83-A4D3-FC08075C723A}.RelWithDebInfo|x86.Build.0 = Release|Any CPU {098D9321-1201-4974-A75E-F58EBCD98ACF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {098D9321-1201-4974-A75E-F58EBCD98ACF}.Debug|Any CPU.Build.0 = Debug|Any CPU {098D9321-1201-4974-A75E-F58EBCD98ACF}.Debug|x64.ActiveCfg = Release|Any CPU @@ -677,30 +651,6 @@ Global {098D9321-1201-4974-A75E-F58EBCD98ACF}.RelWithDebInfo|x64.Build.0 = Release|Any CPU {098D9321-1201-4974-A75E-F58EBCD98ACF}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU {098D9321-1201-4974-A75E-F58EBCD98ACF}.RelWithDebInfo|x86.Build.0 = Release|Any CPU - {A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.Debug|x64.ActiveCfg = Release|Any CPU - {A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.Debug|x64.Build.0 = Release|Any CPU - {A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.Debug|x86.ActiveCfg = Release|Any CPU - {A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.Debug|x86.Build.0 = Release|Any CPU - {A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.MinSizeRel|Any CPU.ActiveCfg = Release|Any CPU - {A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.MinSizeRel|Any CPU.Build.0 = Release|Any CPU - {A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.MinSizeRel|x64.ActiveCfg = Release|Any CPU - {A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.MinSizeRel|x64.Build.0 = Release|Any CPU - {A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.MinSizeRel|x86.ActiveCfg = Release|Any CPU - {A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.MinSizeRel|x86.Build.0 = Release|Any CPU - {A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.Release|Any CPU.Build.0 = Release|Any CPU - {A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.Release|x64.ActiveCfg = Release|Any CPU - {A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.Release|x64.Build.0 = Release|Any CPU - {A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.Release|x86.ActiveCfg = Release|Any CPU - {A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.Release|x86.Build.0 = Release|Any CPU - {A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU - {A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU - {A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU - {A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.RelWithDebInfo|x64.Build.0 = Release|Any CPU - {A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU - {A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C}.RelWithDebInfo|x86.Build.0 = Release|Any CPU {D82A3246-9831-4024-A9B2-1932EEF3D56F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D82A3246-9831-4024-A9B2-1932EEF3D56F}.Debug|Any CPU.Build.0 = Debug|Any CPU {D82A3246-9831-4024-A9B2-1932EEF3D56F}.Debug|x64.ActiveCfg = Release|Any CPU @@ -1565,30 +1515,6 @@ Global {FCDFAF40-CC16-4D49-96C0-E49F195E7142}.RelWithDebInfo|x64.Build.0 = Release|Any CPU {FCDFAF40-CC16-4D49-96C0-E49F195E7142}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU {FCDFAF40-CC16-4D49-96C0-E49F195E7142}.RelWithDebInfo|x86.Build.0 = Release|Any CPU - {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.Debug|Any CPU.Build.0 = Debug|Any CPU - {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.Debug|x64.ActiveCfg = Debug|Any CPU - {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.Debug|x64.Build.0 = Debug|Any CPU - {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.Debug|x86.ActiveCfg = Debug|Any CPU - {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.Debug|x86.Build.0 = Debug|Any CPU - {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU - {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU - {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU - {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.MinSizeRel|x64.Build.0 = Debug|Any CPU - {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.MinSizeRel|x86.ActiveCfg = Debug|Any CPU - {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.MinSizeRel|x86.Build.0 = Debug|Any CPU - {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.Release|Any CPU.ActiveCfg = Release|Any CPU - {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.Release|Any CPU.Build.0 = Release|Any CPU - {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.Release|x64.ActiveCfg = Release|Any CPU - {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.Release|x64.Build.0 = Release|Any CPU - {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.Release|x86.ActiveCfg = Release|Any CPU - {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.Release|x86.Build.0 = Release|Any CPU - {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU - {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU - {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU - {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.RelWithDebInfo|x64.Build.0 = Release|Any CPU - {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU - {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94}.RelWithDebInfo|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1618,9 +1544,7 @@ Global {73ACEB34-D22C-43EA-87BE-EFC0E83D0126} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} {ABB81DAE-0D26-483C-BE3B-0F9ACD812A62} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} {570950AD-A080-4F32-980C-F50E312910DF} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} - {6592A22C-2386-4E83-A4D3-FC08075C723A} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} {098D9321-1201-4974-A75E-F58EBCD98ACF} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} - {A0670C63-BA7A-4C1B-B9A7-1CA26A7F235C} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} {D82A3246-9831-4024-A9B2-1932EEF3D56F} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} {BE4C655A-DC54-4408-B739-743456D34111} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} {3E28672F-F4E4-44D5-AEFB-1F425DECC57E} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} @@ -1659,7 +1583,6 @@ Global {08A40B6A-F695-4EA9-AC8D-CF88FADEA796} = {17735A9D-BFD9-4585-A7CB-3208CA6EA8A7} {602976C5-2477-4B4C-AD9A-1EAFB250529A} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} {FCDFAF40-CC16-4D49-96C0-E49F195E7142} = {ED2FE3E2-F7E7-4389-8231-B65123F2076F} - {84BB2DD5-B2D8-4C85-AAF9-29D2A74FBF94} = {88278B81-7649-45DC-8A6A-D3A645C5AFC3} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {B526D2CE-EE2D-4AD4-93EF-1867D90FF1F5} diff --git a/NuGet.Config b/NuGet.Config deleted file mode 100644 index 9c645c984..000000000 --- a/NuGet.Config +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/README.md b/README.md index 4208832ba..dc086e6f6 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ This repo contains the source code for cross-platform [.NET Core](http://github. Looking for V1 of the .NET Core tooling? ---------------------------------------- -If you are looking for the v1.0.1 release of the .NET Core tools (CLI, MSBuild and the new csproj), see https://dot.net/core. +If you are looking for the v2.0 release of the .NET Core tools (CLI, MSBuild and the new csproj), head over to https://dot.net/core and download! -> **Note:** the dev/release/2.0.0 branch of the .NET Core SDK repo is based on an upcoming update of the SDK and is considered pre-release. For production-level usage, please use the +> **Note:** the dev/repo-refactoring branch of the .NET Core SDK repo is based on an upcoming update of the SDK and is considered pre-release. For production-level usage, please use the > released version of the tools available at https://dot.net/core Found an issue? @@ -32,6 +32,7 @@ To download the .NET Core runtime **without** the SDK, visit https://github.com/ > **Note:** Be aware that the following installers are the **latest bits**. If you > want to install the latest released versions, check out the [preceding section](#looking-for-v1-of-the-net-core-tooling). +> In order to be able to restore these pre-release packages, you may need to add a NuGet feed pointing to https://dotnet.myget.org/F/dotnet-core/api/v3/index.json. Other feeds may also be necessary depending on what kind of project you are working with. Coming soon. diff --git a/TestAssets/DesktopTestProjects/NETFrameworkReferenceNETStandard20/MultiTFMTestApp/MultiTFMTestApp.csproj b/TestAssets/DesktopTestProjects/NETFrameworkReferenceNETStandard20/MultiTFMTestApp/MultiTFMTestApp.csproj index cc54ec8ae..42170c6bb 100644 --- a/TestAssets/DesktopTestProjects/NETFrameworkReferenceNETStandard20/MultiTFMTestApp/MultiTFMTestApp.csproj +++ b/TestAssets/DesktopTestProjects/NETFrameworkReferenceNETStandard20/MultiTFMTestApp/MultiTFMTestApp.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.0;net461 + netcoreapp2.2;net461 diff --git a/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Empty/README b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Empty/README new file mode 100644 index 000000000..439cfe9c7 --- /dev/null +++ b/TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Empty/README @@ -0,0 +1,2 @@ +This directory is intentionally empty. + diff --git a/TestAssets/TestPackages/dotnet-dependency-tool-invoker/dotnet-dependency-tool-invoker.csproj b/TestAssets/TestPackages/dotnet-dependency-tool-invoker/dotnet-dependency-tool-invoker.csproj index dc08ecdd0..9b3a4e233 100644 --- a/TestAssets/TestPackages/dotnet-dependency-tool-invoker/dotnet-dependency-tool-invoker.csproj +++ b/TestAssets/TestPackages/dotnet-dependency-tool-invoker/dotnet-dependency-tool-invoker.csproj @@ -1,21 +1,17 @@  - - - + 1.0.0-rc - netcoreapp2.0 + netcoreapp2.2 Exe - false - - - + + + diff --git a/TestAssets/TestPackages/dotnet-portable/dotnet-portable.csproj b/TestAssets/TestPackages/dotnet-portable/dotnet-portable.csproj index bc2925f73..1aef6a2d9 100644 --- a/TestAssets/TestPackages/dotnet-portable/dotnet-portable.csproj +++ b/TestAssets/TestPackages/dotnet-portable/dotnet-portable.csproj @@ -2,7 +2,7 @@ - netcoreapp2.0 + netcoreapp2.2 Exe diff --git a/TestAssets/TestPackages/dotnet-prefercliruntime/dotnet-prefercliruntime.csproj b/TestAssets/TestPackages/dotnet-prefercliruntime/dotnet-prefercliruntime.csproj index 21eb0a6d1..8706fd623 100644 --- a/TestAssets/TestPackages/dotnet-prefercliruntime/dotnet-prefercliruntime.csproj +++ b/TestAssets/TestPackages/dotnet-prefercliruntime/dotnet-prefercliruntime.csproj @@ -2,7 +2,7 @@ - netcoreapp2.0 + netcoreapp2.2 Exe @@ -10,7 +10,7 @@ true - \prefercliruntime + / diff --git a/TestAssets/TestProjects/AppWithApplicationUrlInLaunchSettings/AppWithApplicationUrlInLaunchSettings.csproj b/TestAssets/TestProjects/AppWithApplicationUrlInLaunchSettings/AppWithApplicationUrlInLaunchSettings.csproj new file mode 100644 index 000000000..576839f8e --- /dev/null +++ b/TestAssets/TestProjects/AppWithApplicationUrlInLaunchSettings/AppWithApplicationUrlInLaunchSettings.csproj @@ -0,0 +1,8 @@ + + + + + Exe + netcoreapp2.2 + + diff --git a/TestAssets/TestProjects/AppWithApplicationUrlInLaunchSettings/Program.cs b/TestAssets/TestProjects/AppWithApplicationUrlInLaunchSettings/Program.cs new file mode 100644 index 000000000..33322e771 --- /dev/null +++ b/TestAssets/TestProjects/AppWithApplicationUrlInLaunchSettings/Program.cs @@ -0,0 +1,16 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; + +namespace MSBuildTestApp +{ + public class Program + { + public static void Main(string[] args) + { + var message = Environment.GetEnvironmentVariable("ASPNETCORE_URLS"); + Console.WriteLine(message); + } + } +} diff --git a/TestAssets/TestProjects/AppWithApplicationUrlInLaunchSettings/Properties/launchSettings.json b/TestAssets/TestProjects/AppWithApplicationUrlInLaunchSettings/Properties/launchSettings.json new file mode 100644 index 000000000..b61eabd57 --- /dev/null +++ b/TestAssets/TestProjects/AppWithApplicationUrlInLaunchSettings/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:49850/", + "sslPort": 0 + } + }, + "profiles": { + "First": { + "commandName": "Project", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development", + "ASPNETCORE_URLS": "http://localhost:12345/" + }, + "applicationUrl": "http://localhost:67890/" + }, + "Second": { + "commandName": "Project", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "http://localhost:54321/" + } + } +} \ No newline at end of file diff --git a/TestAssets/TestProjects/MSBuildTestApp/MSBuildTestApp.csproj b/TestAssets/TestProjects/MSBuildTestApp/MSBuildTestApp.csproj index 7259a5723..89540778e 100644 --- a/TestAssets/TestProjects/MSBuildTestApp/MSBuildTestApp.csproj +++ b/TestAssets/TestProjects/MSBuildTestApp/MSBuildTestApp.csproj @@ -3,8 +3,8 @@ Exe - netcoreapp2.0 - win7-x64;win7-x86;osx.10.12-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64;opensuse.42.1-x64 + netcoreapp2.2 + win7-x64;win7-x86;osx.10.12-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;rhel.6-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64;opensuse.42.1-x64;linux-musl-x64 $(TEST_PACKAGES) diff --git a/TestAssets/TestProjects/ProjectPrintsNoWarn/ProjectPrintsNoWarn.csproj b/TestAssets/TestProjects/ProjectPrintsNoWarn/ProjectPrintsNoWarn.csproj new file mode 100644 index 000000000..4e83f2fad --- /dev/null +++ b/TestAssets/TestProjects/ProjectPrintsNoWarn/ProjectPrintsNoWarn.csproj @@ -0,0 +1,12 @@ + + + + library + netcoreapp2.0 + + + + + + + diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndUnknownProjectType/App.sln b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndUnknownProjectType/App.sln new file mode 100644 index 000000000..5b61df887 --- /dev/null +++ b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndUnknownProjectType/App.sln @@ -0,0 +1,18 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26006.2 +MinimumVisualStudioVersion = 10.0.40219.1 +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndUnknownProjectType/UnknownProject/UnknownProject.unknownproj b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndUnknownProjectType/UnknownProject/UnknownProject.unknownproj new file mode 100644 index 000000000..2ed799e9d --- /dev/null +++ b/TestAssets/TestProjects/SlnFileWithNoProjectReferencesAndUnknownProjectType/UnknownProject/UnknownProject.unknownproj @@ -0,0 +1,3 @@ + + + diff --git a/TestAssets/TestProjects/TestAppWithProjDepTool/TestAppWithProjDepTool.csproj b/TestAssets/TestProjects/TestAppWithProjDepTool/TestAppWithProjDepTool.csproj index c5748e258..71c0021d7 100644 --- a/TestAssets/TestProjects/TestAppWithProjDepTool/TestAppWithProjDepTool.csproj +++ b/TestAssets/TestProjects/TestAppWithProjDepTool/TestAppWithProjDepTool.csproj @@ -3,7 +3,7 @@ Exe - netcoreapp2.0 + netcoreapp2.2 $(TEST_PACKAGES) diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/Empty/README b/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/Empty/README new file mode 100644 index 000000000..439cfe9c7 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/Empty/README @@ -0,0 +1,2 @@ +This directory is intentionally empty. + diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/Multiple/First.csproj b/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/Multiple/First.csproj new file mode 100644 index 000000000..9f5c4f4ab --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/Multiple/First.csproj @@ -0,0 +1,7 @@ + + + + netstandard2.0 + + + diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/Multiple/Second.csproj b/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/Multiple/Second.csproj new file mode 100644 index 000000000..9f5c4f4ab --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnAndCsprojFiles/Multiple/Second.csproj @@ -0,0 +1,7 @@ + + + + netstandard2.0 + + + diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/Empty/README b/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/Empty/README new file mode 100644 index 000000000..439cfe9c7 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/Empty/README @@ -0,0 +1,2 @@ +This directory is intentionally empty. + diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/Multiple/First.csproj b/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/Multiple/First.csproj new file mode 100644 index 000000000..9f5c4f4ab --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/Multiple/First.csproj @@ -0,0 +1,7 @@ + + + + netstandard2.0 + + + diff --git a/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/Multiple/Second.csproj b/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/Multiple/Second.csproj new file mode 100644 index 000000000..9f5c4f4ab --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnAndCsprojToRemove/Multiple/Second.csproj @@ -0,0 +1,7 @@ + + + + netstandard2.0 + + + diff --git a/TestAssets/TestProjects/TestAppWithSlnAndProjectConfigs/App.sln b/TestAssets/TestProjects/TestAppWithSlnAndProjectConfigs/App.sln new file mode 100644 index 000000000..acf657a65 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnAndProjectConfigs/App.sln @@ -0,0 +1,21 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26006.2 +MinimumVisualStudioVersion = 10.0.40219.1 +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + Foo Bar|Any CPU = Foo Bar|Any CPU + Foo Bar|x64 = Foo Bar|x64 + Foo Bar|x86 = Foo Bar|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/TestAssets/TestProjects/TestAppWithSlnAndProjectConfigs/ProjectWithAdditionalConfigs/Library.cs b/TestAssets/TestProjects/TestAppWithSlnAndProjectConfigs/ProjectWithAdditionalConfigs/Library.cs new file mode 100644 index 000000000..786c0221c --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnAndProjectConfigs/ProjectWithAdditionalConfigs/Library.cs @@ -0,0 +1,15 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; + +namespace ProjectWithAdditionalConfigs +{ + public static class Library + { + public static string GetMessage() + { + return "Hello World!"; + } + } +} diff --git a/TestAssets/TestProjects/TestAppWithSlnAndProjectConfigs/ProjectWithAdditionalConfigs/ProjectWithAdditionalConfigs.csproj b/TestAssets/TestProjects/TestAppWithSlnAndProjectConfigs/ProjectWithAdditionalConfigs/ProjectWithAdditionalConfigs.csproj new file mode 100644 index 000000000..9b87758e9 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnAndProjectConfigs/ProjectWithAdditionalConfigs/ProjectWithAdditionalConfigs.csproj @@ -0,0 +1,10 @@ + + + + netstandard2.0 + {A302325B-D680-4C0E-8680-7AE283981624} + AnyCPU;x64;x86;AdditionalPlatform + Debug;Release;FooBar;AdditionalConfiguration + + + diff --git a/TestAssets/TestProjects/TestAppWithSlnAndProjectConfigs/ProjectWithMatchingConfigs/Library.cs b/TestAssets/TestProjects/TestAppWithSlnAndProjectConfigs/ProjectWithMatchingConfigs/Library.cs new file mode 100644 index 000000000..c0d7436b3 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnAndProjectConfigs/ProjectWithMatchingConfigs/Library.cs @@ -0,0 +1,15 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; + +namespace ProjectWithMatchingConfigs +{ + public static class Library + { + public static string GetMessage() + { + return "Hello World!"; + } + } +} diff --git a/TestAssets/TestProjects/TestAppWithSlnAndProjectConfigs/ProjectWithMatchingConfigs/ProjectWithMatchingConfigs.csproj b/TestAssets/TestProjects/TestAppWithSlnAndProjectConfigs/ProjectWithMatchingConfigs/ProjectWithMatchingConfigs.csproj new file mode 100644 index 000000000..7c789108f --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnAndProjectConfigs/ProjectWithMatchingConfigs/ProjectWithMatchingConfigs.csproj @@ -0,0 +1,10 @@ + + + + netstandard2.0 + {C9601CA2-DB64-4FB6-B463-368C7764BF0D} + AnyCPU;x64;x86 + Debug;Release;FooBar + + + diff --git a/TestAssets/TestProjects/TestAppWithSlnAndProjectConfigs/ProjectWithoutMatchingConfigs/Library.cs b/TestAssets/TestProjects/TestAppWithSlnAndProjectConfigs/ProjectWithoutMatchingConfigs/Library.cs new file mode 100644 index 000000000..fb9a17c27 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnAndProjectConfigs/ProjectWithoutMatchingConfigs/Library.cs @@ -0,0 +1,15 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; + +namespace ProjectWithoutMatchingConfigs +{ + public static class Library + { + public static string GetMessage() + { + return "Hello World!"; + } + } +} diff --git a/TestAssets/TestProjects/TestAppWithSlnAndProjectConfigs/ProjectWithoutMatchingConfigs/ProjectWithoutMatchingConfigs.csproj b/TestAssets/TestProjects/TestAppWithSlnAndProjectConfigs/ProjectWithoutMatchingConfigs/ProjectWithoutMatchingConfigs.csproj new file mode 100644 index 000000000..4bc811fa1 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnAndProjectConfigs/ProjectWithoutMatchingConfigs/ProjectWithoutMatchingConfigs.csproj @@ -0,0 +1,8 @@ + + + + netstandard2.0 + {C49B64DE-4401-4825-8A88-10DCB5950E57} + + + diff --git a/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/App.sln b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/App.sln new file mode 100644 index 000000000..97c495544 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/App.sln @@ -0,0 +1,44 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27110.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "App", "App\App.csproj", "{BB02B949-F6BD-4872-95CB-96A05B1FE026}" + ProjectSection(ProjectDependencies) = postProject + {4E952B56-841D-461D-89A9-7977DDCC0625} = {4E952B56-841D-461D-89A9-7977DDCC0625} + {D53E177A-8ECF-43D5-A01E-98B884D53CA6} = {D53E177A-8ECF-43D5-A01E-98B884D53CA6} + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "First", "First\First.csproj", "{D53E177A-8ECF-43D5-A01E-98B884D53CA6}" + ProjectSection(ProjectDependencies) = postProject + {4E952B56-841D-461D-89A9-7977DDCC0625} = {4E952B56-841D-461D-89A9-7977DDCC0625} + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Second", "Second\Second.csproj", "{4E952B56-841D-461D-89A9-7977DDCC0625}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BB02B949-F6BD-4872-95CB-96A05B1FE026}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BB02B949-F6BD-4872-95CB-96A05B1FE026}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BB02B949-F6BD-4872-95CB-96A05B1FE026}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BB02B949-F6BD-4872-95CB-96A05B1FE026}.Release|Any CPU.Build.0 = Release|Any CPU + {D53E177A-8ECF-43D5-A01E-98B884D53CA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D53E177A-8ECF-43D5-A01E-98B884D53CA6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D53E177A-8ECF-43D5-A01E-98B884D53CA6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D53E177A-8ECF-43D5-A01E-98B884D53CA6}.Release|Any CPU.Build.0 = Release|Any CPU + {4E952B56-841D-461D-89A9-7977DDCC0625}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4E952B56-841D-461D-89A9-7977DDCC0625}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4E952B56-841D-461D-89A9-7977DDCC0625}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4E952B56-841D-461D-89A9-7977DDCC0625}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F6D9A973-1CFD-41C9-84F2-1471C0FE67DF} + EndGlobalSection +EndGlobal diff --git a/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/App/App.csproj b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/App/App.csproj new file mode 100644 index 000000000..ce1697ae8 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/App/App.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp2.0 + + + diff --git a/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/App/Program.cs b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/App/Program.cs new file mode 100644 index 000000000..be4278310 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/App/Program.cs @@ -0,0 +1,12 @@ +using System; + +namespace App +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + } + } +} diff --git a/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/First/Class1.cs b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/First/Class1.cs new file mode 100644 index 000000000..3a358f6f2 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/First/Class1.cs @@ -0,0 +1,8 @@ +using System; + +namespace First +{ + public class Class1 + { + } +} diff --git a/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/First/First.csproj b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/First/First.csproj new file mode 100644 index 000000000..9f5c4f4ab --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/First/First.csproj @@ -0,0 +1,7 @@ + + + + netstandard2.0 + + + diff --git a/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/Second/Class1.cs b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/Second/Class1.cs new file mode 100644 index 000000000..a39ee63c8 --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/Second/Class1.cs @@ -0,0 +1,8 @@ +using System; + +namespace Second +{ + public class Class1 + { + } +} diff --git a/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/Second/Second.csproj b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/Second/Second.csproj new file mode 100644 index 000000000..9f5c4f4ab --- /dev/null +++ b/TestAssets/TestProjects/TestAppWithSlnProjectDependencyToRemove/Second/Second.csproj @@ -0,0 +1,7 @@ + + + + netstandard2.0 + + + diff --git a/TestAssets/TestProjects/TestRazorApp/Areas/MyFeature/Pages/Page1.cshtml b/TestAssets/TestProjects/TestRazorApp/Areas/MyFeature/Pages/Page1.cshtml new file mode 100644 index 000000000..79083e425 --- /dev/null +++ b/TestAssets/TestProjects/TestRazorApp/Areas/MyFeature/Pages/Page1.cshtml @@ -0,0 +1,16 @@ +@page +@model TestRazorApp.MyFeature.Pages.Page1Model +@{ + Layout = null; +} + + + + + + + Page1 + + + + diff --git a/TestAssets/TestProjects/TestRazorApp/Areas/MyFeature/Pages/Page1.cshtml.cs b/TestAssets/TestProjects/TestRazorApp/Areas/MyFeature/Pages/Page1.cshtml.cs new file mode 100644 index 000000000..583793ac3 --- /dev/null +++ b/TestAssets/TestProjects/TestRazorApp/Areas/MyFeature/Pages/Page1.cshtml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace TestRazorApp.MyFeature.Pages +{ + public class Page1Model : PageModel + { + public void OnGet() + { + + } + } +} \ No newline at end of file diff --git a/TestAssets/TestProjects/TestRazorApp/TestRazorApp.csproj b/TestAssets/TestProjects/TestRazorApp/TestRazorApp.csproj new file mode 100644 index 000000000..59cfc871f --- /dev/null +++ b/TestAssets/TestProjects/TestRazorApp/TestRazorApp.csproj @@ -0,0 +1,11 @@ + + + + + netstandard2.0 + + + + + + diff --git a/TestAssets/TestProjects/TestWebAppSimple/Program.cs b/TestAssets/TestProjects/TestWebAppSimple/Program.cs new file mode 100644 index 000000000..a15982830 --- /dev/null +++ b/TestAssets/TestProjects/TestWebAppSimple/Program.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; + +namespace TestWebAppSimple +{ + public class Program + { + public static void Main(string[] args) + { + CreateWebHostBuilder(args).Build().Run(); + } + + public static IWebHostBuilder CreateWebHostBuilder(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup(); + } +} diff --git a/TestAssets/TestProjects/TestWebAppSimple/Startup.cs b/TestAssets/TestProjects/TestWebAppSimple/Startup.cs new file mode 100644 index 000000000..f00c04c75 --- /dev/null +++ b/TestAssets/TestProjects/TestWebAppSimple/Startup.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.DependencyInjection; + +namespace TestWebAppSimple +{ + public class Startup + { + // This method gets called by the runtime. Use this method to add services to the container. + // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 + public void ConfigureServices(IServiceCollection services) + { + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.Run(async (context) => + { + await context.Response.WriteAsync("Hello World!"); + }); + } + } +} diff --git a/TestAssets/TestProjects/TestWebAppSimple/TestWebAppSimple.csproj b/TestAssets/TestProjects/TestWebAppSimple/TestWebAppSimple.csproj new file mode 100644 index 000000000..0d5ffc364 --- /dev/null +++ b/TestAssets/TestProjects/TestWebAppSimple/TestWebAppSimple.csproj @@ -0,0 +1,23 @@ + + + + + netcoreapp2.2 + + + + + + + + + + + + + + + diff --git a/TestAssets/TestProjects/docker-compose/docker-compose.dcproj b/TestAssets/TestProjects/docker-compose/docker-compose.dcproj new file mode 100644 index 000000000..17ed6f924 --- /dev/null +++ b/TestAssets/TestProjects/docker-compose/docker-compose.dcproj @@ -0,0 +1,13 @@ + + + + 2.0 + Linux + LaunchBrowser + http://localhost:{ServicePort} + testwebapplication + + + + + \ No newline at end of file diff --git a/TestAssets/TestProjects/docker-compose/docker-compose.yml b/TestAssets/TestProjects/docker-compose/docker-compose.yml new file mode 100644 index 000000000..9903b7748 --- /dev/null +++ b/TestAssets/TestProjects/docker-compose/docker-compose.yml @@ -0,0 +1,8 @@ +version: '3.0' + +services: + testwebapplication: + image: testwebapplication + build: + context: . + dockerfile: testwebapplication/Dockerfile diff --git a/build.proj b/build.proj index 982770597..ef413f9e9 100644 --- a/build.proj +++ b/build.proj @@ -29,10 +29,11 @@ - + + Outputs="@(RestoreDotnetCliBuildFrameworkOutputs)" + DependsOnTargets="WriteNugetConfigFile"> $(ExtraRestoreArgs) /p:GeneratePropsFile=$(GeneratePropsFile) @@ -45,11 +46,14 @@ + + + diff --git a/build.sh b/build.sh index 2177e91b7..99a136aa7 100755 --- a/build.sh +++ b/build.sh @@ -24,7 +24,7 @@ if [ -z "$HOME" ]; then mkdir -p $HOME fi -args=( "$@" ) +args= while [[ $# > 0 ]]; do lowerI="$(echo $1 | awk '{print tolower($0)}')" @@ -32,23 +32,15 @@ while [[ $# > 0 ]]; do --docker) export BUILD_IN_DOCKER=1 export DOCKER_IMAGENAME=$2 - # remove docker args - args=( "${args[@]/$1}" ) - args=( "${args[@]/$2}" ) shift ;; *) + args="$args $1" + ;; esac shift done -# $args array may have empty elements in it. -# The easiest way to remove them is to cast to string and back to array. -# This will actually break quoted arguments, arguments like -# -test "hello world" will be broken into three arguments instead of two, as it should. -temp="${args[@]}" -args=($temp) - dockerbuild() { BUILD_COMMAND=/opt/code/run-build.sh $DIR/scripts/dockerrun.sh --non-interactive "$@" @@ -56,7 +48,7 @@ dockerbuild() # Check if we need to build in docker if [ ! -z "$BUILD_IN_DOCKER" ]; then - dockerbuild "${args[@]}" + dockerbuild $args else - $DIR/run-build.sh "${args[@]}" + $DIR/run-build.sh $args fi diff --git a/build/AppHostTemplate.proj b/build/AppHostTemplate.proj new file mode 100644 index 000000000..598f250b6 --- /dev/null +++ b/build/AppHostTemplate.proj @@ -0,0 +1,49 @@ + + + + + + .exe + AppHost$(NativeExecutableExtension) + + + + + + + + + + + + + + + + + + + + + + --runtime $(Rid) + $(AppHostTemplateRestoreAdditionalParameters) /p:TargetFramework=$(CliTargetFramework) + $(AppHostTemplateRestoreAdditionalParameters) /p:TemplateFillInPackageName=$(TemplateFillInPackageName) + $(AppHostTemplateRestoreAdditionalParameters) /p:TemplateFillInPackageVersion=$(TemplateFillInPackageVersion) + $(AppHostTemplateRestoreAdditionalParameters) /p:RestorePackagesPath=$(AppHostIntermediateDirectory) + + + + + diff --git a/build/AzureInfo.props b/build/AzureInfo.props index f5ce4ab98..c0f74875d 100644 --- a/build/AzureInfo.props +++ b/build/AzureInfo.props @@ -1,14 +1,45 @@ Sdk - $(ARTIFACT_STORAGE_CONTAINER) - dotnet - $(ARTIFACT_STORAGE_KEY) + true + false + $(Product) + assets/$(Product) + + + https://dotnetcli.azureedge.net/dotnet/ + $(PB_AssetRootUrl) + $(DefaultCoreSetupBlobRootUrl) + $(DefaultCoreSetupBlobRootUrl) + $(PB_AssetRootAccessTokenSuffix) + ?$(CoreSetupBlobAccessToken) + + $(ARTIFACT_STORAGE_ACCOUNT) dotnetcli - https://$(ArtifactCloudDropAccountName).blob.core.windows.net/$(ArtifactContainerName) - $(CHECKSUM_STORAGE_CONTAINER) - $(CHECKSUM_STORAGE_KEY) + $(ARTIFACT_STORAGE_CONTAINER) + dotnet + $(PB_PublishBlobFeedKey) + $(ARTIFACT_STORAGE_KEY) + $(PB_PublishBlobFeedUrl) + https://$(ArtifactCloudDropAccountName).blob.core.windows.net/$(ArtifactContainerName)/index.json + + $(CHECKSUM_STORAGE_ACCOUNT) + dotnetclichecksums + $(CHECKSUM_STORAGE_CONTAINER) + dotnet + $(PB_PublishBlobFeedKey) + $(CHECKSUM_STORAGE_KEY) + $(PB_PublishBlobFeedUrl) + https://$(ChecksumCloudDropAccountName).blob.core.windows.net/$(ChecksumContainerName)/index.json + + + $(BLOBFEED_STORAGE_CONTAINER) + dotnet-core + $(PB_PublishBlobFeedUrl) + https://dotnetfeed.blob.core.windows.net/$(BlobFeedContainerName)/index.json + $(PB_PublishBlobFeedKey) + $(BLOBFEED_STORAGE_KEY) diff --git a/build/BackwardsCompatibilityRuntimes.props b/build/BackwardsCompatibilityRuntimes.props index d9b7ddc24..6f612ac1f 100644 --- a/build/BackwardsCompatibilityRuntimes.props +++ b/build/BackwardsCompatibilityRuntimes.props @@ -16,17 +16,16 @@ dotnet-$(HostMonikerRid).$(BackwardsCompatibility110SharedFrameworkVersion)$(ArchiveExtension) - $(CoreSetupBlobRootUrl)$(BackwardsCompatibility110CoreSetupChannel) + $(BackwardsCompatibilityCoreSetupBlobRootUrl)$(BackwardsCompatibility110CoreSetupChannel) $(BackwardsCompatibility110CoreSetupBlobRootUrlWithChannel)/Binaries/$(BackwardsCompatibility110SharedFrameworkVersion) $(BackwardsCompatibility110CoreSetupBlobRootUrlWithChannel)/Installers $(IntermediateDirectory)/coreSetupDownload/$(BackwardsCompatibility110SharedFrameworkVersion) $(BackwardsCompatibility110CoreSetupDownloadDirectory)/combinedSharedHostAndFrameworkArchive$(ArchiveExtension) - ?$(CoreSetupBlobAccessToken) <_DownloadAndExtractItem Include="BackwardsCompatibility110CombinedSharedHostAndFrameworkArchive" - Condition="!Exists('$(BackwardsCompatibility110CombinedSharedHostAndFrameworkArchive)')"> + Condition="!Exists('$(BackwardsCompatibility110CombinedSharedHostAndFrameworkArchive)') And !$(Architecture.StartsWith('arm'))"> $(BackwardsCompatibility110SharedFrameworkArchiveBlobRootUrl)/$(BackwardsCompatibility110CombinedFrameworkHostCompressedFileName)$(CoreSetupBlobAccessTokenParam) $(BackwardsCompatibility110CombinedSharedHostAndFrameworkArchive) $(BackwardsCompatibleSharedFrameworksPublishDirectory) @@ -35,21 +34,21 @@ <_DownloadAndExtractItem Include="BackwardsCompatibility110DownloadedSharedFrameworkInstallerFile" - Condition="!Exists('$(BackwardsCompatibility110DownloadedSharedFrameworkInstallerFile)') And '$(OSName)' != 'linux'"> + Condition="!Exists('$(BackwardsCompatibility110DownloadedSharedFrameworkInstallerFile)') And '$(OSName)' != 'linux' And !$(Architecture.StartsWith('arm'))"> $(BackwardsCompatibility110CoreSetupInstallerBlobRootUrl)/$(BackwardsCompatibility110SharedFrameworkVersion)/$(BackwardsCompatibility110DownloadedSharedFrameworkInstallerFileName)$(CoreSetupBlobAccessTokenParam) $(BackwardsCompatibility110DownloadedSharedFrameworkInstallerFile) <_DownloadAndExtractItem Include="BackwardsCompatibility110DownloadedSharedHostInstallerFile" - Condition="!Exists('$(BackwardsCompatibility110DownloadedSharedHostInstallerFile)') And '$(OSName)' != 'linux'"> + Condition="!Exists('$(BackwardsCompatibility110DownloadedSharedHostInstallerFile)') And '$(OSName)' != 'linux' And !$(Architecture.StartsWith('arm'))"> $(BackwardsCompatibility110CoreSetupInstallerBlobRootUrl)/$(BackwardsCompatibility110SharedHostVersion)/$(BackwardsCompatibility110DownloadedSharedHostInstallerFileName)$(CoreSetupBlobAccessTokenParam) $(BackwardsCompatibility110DownloadedSharedHostInstallerFile) <_DownloadAndExtractItem Include="BackwardsCompatibility110DownloadedHostFxrInstallerFile" - Condition="!Exists('$(BackwardsCompatibility110DownloadedHostFxrInstallerFile)') And '$(OSName)' != 'linux'"> + Condition="!Exists('$(BackwardsCompatibility110DownloadedHostFxrInstallerFile)') And '$(OSName)' != 'linux' And !$(Architecture.StartsWith('arm'))"> $(BackwardsCompatibility110CoreSetupInstallerBlobRootUrl)/$(BackwardsCompatibility110HostFxrVersion)/$(BackwardsCompatibility110DownloadedHostFxrInstallerFileName)$(CoreSetupBlobAccessTokenParam) $(BackwardsCompatibility110DownloadedHostFxrInstallerFile) diff --git a/build/Branding.props b/build/Branding.props index 9f61c1447..89c447e78 100644 --- a/build/Branding.props +++ b/build/Branding.props @@ -1,36 +1,38 @@ - Microsoft .NET Core SDK - 2.0.3 + cli + Microsoft .NET Core SDK $(CliBrandingVersion) .NET Standard Support for Visual Studio 2015 - Microsoft .NET Core Runtime - 2.0.1 - Microsoft .NET Core Host - 2.0.1 - Microsoft .NET Core Host FX Resolver - 2.0.0 + Microsoft .NET Core Runtime 2.1.0 - Preview + Microsoft .NET Core Host 2.1.0 - Preview + Microsoft .NET Core Host FX Resolver 2.1.0 - Preview Microsoft.NETCore.App $(SharedFrameworkName) $(Rid) $(OSName)-$(Architecture) - $(HostRid) - $(HostOSName)-$(Architecture) - dotnet-toolset-internal - dotnet-toolset-internal-debug - dotnet-toolset - $(ArtifactNameCombinedHostHostFxrFrameworkSdk)-langpack + $(HostRid) + $(HostOSName)-$(Architecture) + $(HostMonikerRid) + $(Architecture) + + dotnet-sdk-internal + dotnet-sdk $(ArtifactNameSdk)-$(SdkVersion)-$(ProductMonikerRid) dotnet-standard-support-vs2015-$(SdkVersion)-$(ProductMonikerRid) - - $(ArtifactNameSdkDebug)-$(SdkVersion)-$(ProductMonikerRid) $(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(SdkVersion)-$(ProductMonikerRid) - $(ArtifactNameSdkLanguagePack)-$(SdkVersion)-$(ProductMonikerRid) - $(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(SdkVersion)-$(HostMonikerRid) + $(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(SdkVersion)- + $(DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdkWithoutHostMonikerRid)$(HostMonikerRidForFileName) diff --git a/build/BuildAndPublishAllLinuxDistrosNativeInstallers.targets b/build/BuildAndPublishAllLinuxDistrosNativeInstallers.targets new file mode 100644 index 000000000..af2faa465 --- /dev/null +++ b/build/BuildAndPublishAllLinuxDistrosNativeInstallers.targets @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + true + + + \ No newline at end of file diff --git a/build/BuildDefaults.props b/build/BuildDefaults.props index b36e1fe7c..7fef50f28 100644 --- a/build/BuildDefaults.props +++ b/build/BuildDefaults.props @@ -2,12 +2,26 @@ Prepare;ComposeSdk;Test;Package;Publish Debug + + + false true + true false - true - true - true - true + + true + true true @@ -18,7 +32,5 @@ NU1701 true - - $(DefineConstants);SOURCE_BUILD diff --git a/build/BuildInfo.targets b/build/BuildInfo.targets index 6abd51fa9..039dc3bc1 100644 --- a/build/BuildInfo.targets +++ b/build/BuildInfo.targets @@ -10,16 +10,14 @@ True - $(HostRid) - x64 $(HostOSName) $(HostOSPlatform) - - linux-x64 - x64 linux linux + x64 + $(OSName)-$(Architecture) + <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> diff --git a/build/BundledDotnetTools.proj b/build/BundledDotnetTools.proj new file mode 100644 index 000000000..3c07a51f0 --- /dev/null +++ b/build/BundledDotnetTools.proj @@ -0,0 +1,28 @@ + + + + + + + + + + + + + --runtime any + $(DotnetToolsRestoreAdditionalParameters) /p:TargetFramework=$(CliTargetFramework) + $(DotnetToolsRestoreAdditionalParameters) /p:TemplateFillInPackageName=$(TemplateFillInPackageName) + $(DotnetToolsRestoreAdditionalParameters) /p:TemplateFillInPackageVersion=$(TemplateFillInPackageVersion) + $(DotnetToolsRestoreAdditionalParameters) /p:RestorePackagesPath=$(DotnetToolsLayoutDirectory) + $(DotnetToolsRestoreAdditionalParameters) /p:RestoreProjectStyle=$(DotnetToolsRestoreProjectStyle) + + + + + diff --git a/build/BundledDotnetTools.props b/build/BundledDotnetTools.props new file mode 100644 index 000000000..1df3521de --- /dev/null +++ b/build/BundledDotnetTools.props @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/build/BundledRuntimes.props b/build/BundledRuntimes.props index 8e0b2eca7..7276b8b70 100644 --- a/build/BundledRuntimes.props +++ b/build/BundledRuntimes.props @@ -5,98 +5,114 @@ -internal - + + + -upgrade + - dotnet-host$(InstallerStartSuffix)-$(SharedHostVersion)-$(CoreSetupRid)$(InstallerExtension) + dotnet-runtime-deps-$(SharedHostVersion)-$(CoreSetupRid)$(InstallerEndSuffix)$(InstallerExtension) + $(PackagesDirectory)/$(DownloadedRuntimeDepsInstallerFileName) + + + $(CoreSetupRid) + x64 + + dotnet-host$(InstallerStartSuffix)-$(SharedHostVersion)-$(SharedFrameworkInstallerFileRid)$(InstallerEndSuffix)$(InstallerExtension) $(PackagesDirectory)/$(DownloadedSharedHostInstallerFileName) - dotnet-hostfxr$(InstallerStartSuffix)-$(HostFxrVersion)-$(CoreSetupRid)$(InstallerExtension) + dotnet-hostfxr$(InstallerStartSuffix)-$(HostFxrVersion)-$(SharedFrameworkInstallerFileRid)$(InstallerEndSuffix)$(InstallerExtension) $(PackagesDirectory)/$(DownloadedHostFxrInstallerFileName) - dotnet-runtime$(InstallerStartSuffix)-$(SharedFrameworkVersion)-$(CoreSetupRid)$(InstallerExtension) + dotnet-runtime$(InstallerStartSuffix)-$(MicrosoftNETCoreAppPackageVersion)-$(SharedFrameworkInstallerFileRid)$(InstallerEndSuffix)$(InstallerExtension) $(PackagesDirectory)/$(DownloadedSharedFrameworkInstallerFileName) - + $(CoreSetupRid) - linux-x64 - dotnet-runtime-$(SharedFrameworkVersion)-$(SharedFrameworkRid)$(ArchiveExtension) + $(ProductMonikerRid) + linux-$(Architecture) + dotnet-runtime-$(MicrosoftNETCoreAppPackageVersion)-$(SharedFrameworkRid)$(ArchiveExtension) + + $(SharedFrameworkRid) + linux-x64 + $(AspNetCoreSharedFxInstallerRid) + x64 + + aspnetcore-runtime-$(AspNetCoreVersion)-$(AspNetCoreSharedFxInstallerRid)$(InstallerEndSuffix)$(InstallerExtension) + + aspnetcore-runtime-internal-$(AspNetCoreVersion)-$(AspNetCoreSharedFxInstallerRid).wixlib + $(PackagesDirectory)/$(DownloadedAspNetCoreSharedFxInstallerFileName) + + aspnetcore-runtime-internal-$(AspNetCoreVersion)-$(AspNetCoreSharedFxArchiveRid)$(ArchiveExtension) + $(PackagesDirectory)/$(AspNetCoreSharedFxArchiveFileName) + + + aspnetcore_base_runtime.version + $(PackagesDirectory)/$(AspNetCoreSharedFxBaseRuntimeVersionFileName) - https://dotnetcli.azureedge.net/dotnet/ - ?$(CoreSetupBlobAccessToken) $(CoreSetupBlobRootUrl)Runtime/ - $(IntermediateDirectory)/coreSetupDownload/$(SharedFrameworkVersion) + $(CoreSetupBlobRootUrl)aspnetcore/Runtime/ + $(IntermediateDirectory)/coreSetupDownload/$(MicrosoftNETCoreAppPackageVersion) $(CoreSetupDownloadDirectory)/combinedSharedHostAndFrameworkArchive$(ArchiveExtension) - - $(CoreSetupBlobRootUrl)aspnetcore/store/$(AspNetCoreRuntimeAzureblobStoresSubfolderName) - runtime.version - $(PackagesDirectory)/$(AspNetCoreSharedRuntimeVersionFileName) - - - $(HostOSName)$(Architecture) - $(HostOSName) - linux - - -$(AspNetCoreRuntimePackageTimestamp) - -$(AspNetCoreRelease)$(AspNetCoreRuntimeStoreSuffix) - Build.RS.$(AspNetCoreRuntimeInstallerArchiveFileNameOSToken)$(AspNetCoreRuntimeInstallerArchiveSuffix)$(ArchiveExtension) - $(PackagesDirectory)/$(AspNetCoreRuntimeInstallerArchiveFileName) - - AspNetCorePackageStoreLib$(Architecture)$(AspNetCoreRuntimeStoreSuffix).wixlib - $(PackagesDirectory)/$(AspNetCoreRuntimeInstallerWixLibFileName) - - <_DownloadAndExtractItem Include="CombinedSharedHostAndFrameworkArchive" Condition="!Exists('$(CombinedSharedHostAndFrameworkArchive)')"> - $(CoreSetupRootUrl)$(SharedFrameworkVersion)/$(CombinedFrameworkHostCompressedFileName)$(CoreSetupBlobAccessTokenParam) + $(CoreSetupRootUrl)$(MicrosoftNETCoreAppPackageVersion)/$(CombinedFrameworkHostCompressedFileName)$(CoreSetupBlobAccessTokenParam) $(CombinedSharedHostAndFrameworkArchive) $(SharedFrameworkPublishDirectory) + <_DownloadAndExtractItem Include="DownloadedRuntimeDepsInstallerFile" + Condition="('$(IsDebianBaseDistro)' == 'true' OR '$(IsRPMBasedDistro)' == 'true') And '$(SkipBuildingInstallers)' != 'true' And !Exists('$(DownloadedRuntimeDepsInstallerFile)') And '$(InstallerExtension)' != '' And !$(Architecture.StartsWith('arm'))"> + $(CoreSetupRootUrl)$(MicrosoftNETCoreAppPackageVersion)/$(DownloadedRuntimeDepsInstallerFileName)$(CoreSetupBlobAccessTokenParam) + $(DownloadedRuntimeDepsInstallerFile) + + + <_DownloadAndExtractItem Include="DownloadedSharedFrameworkInstallerFile" - Condition="'$(SkipBuildingInstallers)' != 'true' And !Exists('$(DownloadedSharedFrameworkInstallerFile)') And '$(InstallerExtension)' != ''"> - $(CoreSetupRootUrl)$(SharedFrameworkVersion)/$(DownloadedSharedFrameworkInstallerFileName)$(CoreSetupBlobAccessTokenParam) + Condition="'$(SkipBuildingInstallers)' != 'true' And !Exists('$(DownloadedSharedFrameworkInstallerFile)') And '$(InstallerExtension)' != '' And !$(Architecture.StartsWith('arm'))"> + $(CoreSetupRootUrl)$(MicrosoftNETCoreAppPackageVersion)/$(DownloadedSharedFrameworkInstallerFileName)$(CoreSetupBlobAccessTokenParam) $(DownloadedSharedFrameworkInstallerFile) <_DownloadAndExtractItem Include="DownloadedSharedHostInstallerFile" - Condition="'$(SkipBuildingInstallers)' != 'true' And !Exists('$(DownloadedSharedHostInstallerFile)') And '$(InstallerExtension)' != ''"> + Condition="'$(SkipBuildingInstallers)' != 'true' And !Exists('$(DownloadedSharedHostInstallerFile)') And '$(InstallerExtension)' != '' And !$(Architecture.StartsWith('arm'))"> $(CoreSetupRootUrl)$(SharedHostVersion)/$(DownloadedSharedHostInstallerFileName)$(CoreSetupBlobAccessTokenParam) $(DownloadedSharedHostInstallerFile) <_DownloadAndExtractItem Include="DownloadedHostFxrInstallerFile" - Condition="'$(SkipBuildingInstallers)' != 'true' And !Exists('$(DownloadedHostFxrInstallerFile)') And '$(InstallerExtension)' != ''"> + Condition="'$(SkipBuildingInstallers)' != 'true' And !Exists('$(DownloadedHostFxrInstallerFile)') And '$(InstallerExtension)' != '' And !$(Architecture.StartsWith('arm'))"> $(CoreSetupRootUrl)$(HostFxrVersion)/$(DownloadedHostFxrInstallerFileName)$(CoreSetupBlobAccessTokenParam) $(DownloadedHostFxrInstallerFile) + - <_DownloadAndExtractItem Include="AspNetCoreRuntimeInstallerWixLibFile" - Condition="'$(IncludeAspNetCoreRuntime)' == 'true' And '$(SkipBuildingInstallers)' != 'true' And '$(AspNetCoreRuntimeInstallerWixLibFile)' != '' And !Exists('$(AspNetCoreRuntimeInstallerWixLibFile)')"> - $(AspNetCoreRuntimeInstallerBlobRootUrl)/$(AspNetCoreRuntimeInstallerWixLibFileName)$(CoreSetupBlobAccessTokenParam) - $(AspNetCoreRuntimeInstallerWixLibFile) + + <_DownloadAndExtractItem Include="AspNetCoreSharedFxArchiveFile" + Condition="!Exists('$(AspNetCoreSharedFxArchiveFile)') And ( '$(AspNetCoreSharedFxArchiveRid)' == 'linux-arm' OR !$(Architecture.StartsWith('arm')) )"> + $(AspNetCoreSharedFxRootUrl)$(AspNetCoreVersion)/$(AspNetCoreSharedFxArchiveFileName)$(CoreSetupBlobAccessTokenParam) + $(AspNetCoreSharedFxArchiveFile) + $(AspNetCoreSharedFxPublishDirectory) + + + <_DownloadAndExtractItem Include="DownloadedAspNetCoreSharedFxInstallerFile" + Condition="'$(SkipBuildingInstallers)' != 'true' AND '$(DownloadedAspNetCoreSharedFxInstallerFile)' != '' AND !Exists($(DownloadedAspNetCoreSharedFxInstallerFile)) And '$(InstallerExtension)' != '' And !$(Architecture.StartsWith('arm'))"> + $(AspNetCoreSharedFxRootUrl)$(AspNetCoreVersion)/$(DownloadedAspNetCoreSharedFxInstallerFileName)$(CoreSetupBlobAccessTokenParam) + $(DownloadedAspNetCoreSharedFxInstallerFile) - + - <_DownloadAndExtractItem Include="AspNetCoreRuntimeInstallerArchiveFile" - Condition="'$(IncludeAspNetCoreRuntime)' == 'true' And !Exists('$(AspNetCoreRuntimeInstallerArchiveFile)')"> - $(AspNetCoreRuntimeInstallerBlobRootUrl)/$(AspNetCoreRuntimeInstallerArchiveFileName)$(CoreSetupBlobAccessTokenParam) - $(AspNetCoreRuntimeInstallerArchiveFile) - $(AspNetRuntimePackageStorePublishDirectory) - - - <_DownloadAndExtractItem Include="AspNetCoreSharedRuntimeVersionFile" - Condition="'$(IncludeAspNetCoreRuntime)' == 'true' And !Exists('$(AspNetCoreSharedRuntimeVersionFile)')"> - $(AspNetCoreRuntimeInstallerBlobRootUrl)/$(AspNetCoreSharedRuntimeVersionFileName)$(CoreSetupBlobAccessTokenParam) - $(AspNetCoreSharedRuntimeVersionFile) + <_DownloadAndExtractItem Include="AspNetCoreSharedFxBaseRuntimeVersionFile" + Condition="!Exists('$(AspNetCoreSharedFxBaseRuntimeVersionFile)') And !$(Architecture.StartsWith('arm'))"> + $(AspNetCoreSharedFxRootUrl)$(AspNetCoreVersion)/$(AspNetCoreSharedFxBaseRuntimeVersionFileName)$(CoreSetupBlobAccessTokenParam) + $(AspNetCoreSharedFxBaseRuntimeVersionFile) diff --git a/build/BundledTemplates.proj b/build/BundledTemplates.proj index dfc66e111..4d215f874 100644 --- a/build/BundledTemplates.proj +++ b/build/BundledTemplates.proj @@ -11,26 +11,26 @@ - - + + Condition="!Exists('$(TemplateNuPkgPath)/$(TemplateFillInPackageName.ToLower()).nuspec')"> + AdditionalParameters="/p:TargetFramework=netcoreapp1.0 /p:TemplateFillInPackageName=$(TemplateFillInPackageName) /p:TemplateFillInPackageVersion=$(TemplateFillInPackageVersion)" /> - $(NuGetPackagesDir)/$(TemplatePackageName.ToLower())/$(TemplatePackageVersion.ToLower()) + $(NuGetPackagesDir)/$(TemplateFillInPackageName.ToLower())/$(TemplateFillInPackageVersion.ToLower()) diff --git a/build/BundledTemplates.props b/build/BundledTemplates.props index d45b4a6ed..e1cb85a8f 100644 --- a/build/BundledTemplates.props +++ b/build/BundledTemplates.props @@ -1,10 +1,11 @@ - - - - - - + + + + + + + diff --git a/build/BundledToolset.props b/build/BundledToolset.props index 76a2182e2..14755e9a8 100644 --- a/build/BundledToolset.props +++ b/build/BundledToolset.props @@ -1,11 +1,11 @@ - $(ArtifactNameSdk)-$(ToolsetVersion)$(ArchiveExtension) + dotnet-toolset-internal-$(ToolsetVersion).zip - $(DotnetBlobRootUrl)/Sdk/$(ToolsetVersion)/ + $(CoreSetupBlobRootUrl)Sdk/$(ToolsetVersion)/ $(ToolsetRootUrl)$(ToolsetCompressedFileName)$(CoreSetupBlobAccessTokenParam) $(IntermediateDirectory)/toolsetDownload/$(ToolsetVersion)/ $(ToolsetDownloadDirectory)$(ToolsetCompressedFileName) diff --git a/build/CLI_Baseline.csv b/build/CLI_Baseline.csv new file mode 100644 index 000000000..6bafd8e04 --- /dev/null +++ b/build/CLI_Baseline.csv @@ -0,0 +1,30 @@ +sdk\*\microsoft.testplatform.vstestconsole.translationlayer.xml,unsigned,oss +sdk\*\sdks\nuget.build.tasks.pack\*\nuget.build.tasks.pack.xml,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_projecttemplates*nupkgdir\additional-methods.js,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_projecttemplates*nupkgdir\additional-methods.js,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_projecttemplates*nupkgdir\additional-methods.min.js,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_projecttemplates*nupkgdir\bootstrap.js,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_projecttemplates*nupkgdir\bootstrap.min.js,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_projecttemplates*nupkgdir\glyphicons-halflings-regular.ttf,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_projecttemplates*nupkgdir\jquery.js,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_projecttemplates*nupkgdir\jquery.min.js,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_projecttemplates*nupkgdir\jquery.validate.js,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_projecttemplates*nupkgdir\jquery.validate.min.js,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_projecttemplates*nupkgdir\jquery.validate.unobtrusive.js,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_projecttemplates*nupkgdir\jquery.validate.unobtrusive.min.js,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_projecttemplates*nupkgdir\npm.js,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_projecttemplates*nupkgdir\site.js,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_projecttemplates*nupkgdir\site.min.js,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_spa_projecttemplates*nupkgdir\app.js,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_spa_projecttemplates*nupkgdir\app.test.js,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_spa_projecttemplates*nupkgdir\configurestore.js,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_spa_projecttemplates*nupkgdir\counter.js,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_spa_projecttemplates*nupkgdir\fetchdata.js,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_spa_projecttemplates*nupkgdir\home.js,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_spa_projecttemplates*nupkgdir\index.js,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_spa_projecttemplates*nupkgdir\karma.conf.js,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_spa_projecttemplates*nupkgdir\layout.js,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_spa_projecttemplates*nupkgdir\navmenu.js,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_spa_projecttemplates*nupkgdir\protractor.conf.js,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_spa_projecttemplates*nupkgdir\registerserviceworker.js,unsigned,oss +sdk\*\templates\microsoft_dotnet_web_spa_projecttemplates*nupkgdir\weatherforecasts.js,unsigned,oss \ No newline at end of file diff --git a/build/ComposeSdk.targets b/build/ComposeSdk.targets index dec1b16ee..7bffce80f 100644 --- a/build/ComposeSdk.targets +++ b/build/ComposeSdk.targets @@ -1,116 +1,14 @@ + $(SdkOutputDirectory) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TemplateLayoutDirectory=$(SdkOutputDirectory)/Templates; - TemplatePackageName=%(BundledTemplate.Identity); - TemplatePackageVersion=%(BundledTemplate.Version); - PreviousStageDirectory=$(PreviousStageDirectory) - - - - - - - - - - - - - - - - - - + + diff --git a/build/CrossGen.props b/build/CrossGen.props index 511abcbfb..355405b36 100644 --- a/build/CrossGen.props +++ b/build/CrossGen.props @@ -1,8 +1,11 @@ runtime.$(SharedFrameworkRid).microsoft.netcore.app - $(NuGetPackagesDir)/$(RuntimeNETCoreAppPackageName)/$(CLI_SharedFrameworkVersion)/tools/crossgen$(ExeExtension) - $(NuGetPackagesDir)/$(RuntimeNETCoreAppPackageName)/$(CLI_SharedFrameworkVersion)/runtimes/$(SharedFrameworkRid)/native/$(DynamicLibPrefix)clrjit$(DynamicLibExtension) - $(OutputDirectory)/shared/$(SharedFrameworkName)/$(SharedFrameworkVersion) + <_crossDir Condition="'$(Architecture)' == 'arm64'">/x64_arm64 + $(NuGetPackagesDir)/$(RuntimeNETCoreAppPackageName)/$(MicrosoftNETCoreAppPackageVersion)/tools$(_crossDir)/crossgen$(ExeExtension) + $(SharedFrameworkRid) + x64_arm64 + $(NuGetPackagesDir)/$(RuntimeNETCoreAppPackageName)/$(MicrosoftNETCoreAppPackageVersion)/runtimes/$(LibCLRJitRid)/native/$(DynamicLibPrefix)clrjit$(DynamicLibExtension) + $(OutputDirectory)/shared/$(SharedFrameworkName)/$(MicrosoftNETCoreAppPackageVersion) diff --git a/build/DependencyVersions.props b/build/DependencyVersions.props index af35354a4..bd18061d5 100644 --- a/build/DependencyVersions.props +++ b/build/DependencyVersions.props @@ -1,39 +1,77 @@ - 2.0.3-servicing-007050 - 2.0.0 - 15.4.8 - 4.4.0-preview3-4475 + 2.2.100-preview1-008982 + 2.2.100-refac-009032 + 2.2.0-preview1-34355 + $(MicrosoftAspNetCoreAllPackageVersion) + 2.2.0-preview1-26529-01 + $(MicrosoftNETCoreAppPackageVersion) + 15.8.0-preview-000060 + $(MicrosoftBuildPackageVersion) + $(MicrosoftBuildPackageVersion) + $(MicrosoftBuildPackageVersion) + $(MicrosoftBuildPackageVersion) + 10.1.4-rtm-180515-0 + 2.8.1-beta6-62915-07 + $(MicrosoftCodeAnalysisCSharpPackageVersion) + $(MicrosoftCodeAnalysisCSharpPackageVersion) + $(MicrosoftCodeAnalysisCSharpPackageVersion) + $(MicrosoftCodeAnalysisCSharpPackageVersion) + 1.0.0-preview1-62924-06 + $(MicrosoftNETSdkPackageVersion) + $(MicrosoftAspNetCoreAppPackageVersion) + 2.1.300-rtm-20180515-1688249 + $(MicrosoftNETSdkWebPackageVersion) + $(MicrosoftNETSdkWebPackageVersion) + 1.0.2-beta3-20180515-1688254 + $(MicrosoftDotNetCommonItemTemplatesPackageVersion) + 1.0.2-beta3-20180515-1688254 + 1.0.2-beta3-20180515-1688254 + $(MicrosoftTemplateEngineCliPackageVersion) + $(MicrosoftTemplateEngineCliPackageVersion) + $(MicrosoftTemplateEngineCliPackageVersion) + $(MicrosoftTemplateEngineCliPackageVersion) + 2.2.0-preview1-26508-01 + 2.2.0-preview1-26508-01 + 0.1.1-rtm-62915-03 + 1.3.1-rtm-62915-03 + $(MicrosoftDotNetProjectJsonMigrationPackageVersion) + 0.2.0-beta-62628-01 + 4.8.0-preview3.5244 + $(NuGetBuildTasksPackageVersion) + $(NuGetBuildTasksPackageVersion) + $(NuGetBuildTasksPackageVersion) + $(NuGetBuildTasksPackageVersion) + $(NuGetBuildTasksPackageVersion) + $(NuGetBuildTasksPackageVersion) + $(NuGetBuildTasksPackageVersion) + $(NuGetBuildTasksPackageVersion) + $(NuGetBuildTasksPackageVersion) + 15.8.0-preview-20180510-03 + $(MicrosoftNETTestSdkPackageVersion) + $(MicrosoftNETTestSdkPackageVersion) + 2.2.100-refac-20180613-1 + 0.2.0-beta-000042 + 0.2.0 + - 2.0.3-refac-007111 - $(CLI_SharedFrameworkVersion) - $(CLI_SharedFrameworkVersion) - $(CLI_SharedFrameworkVersion) - 1.0.0-beta2-20170810-304 - 1.0.0-beta2-20170810-304 - 0.2.0 - 1.0.417 + + - - notimestamp - - 2.0.0 - rtm - 2.0.0 - 26452 + + 2.0.1-servicing-26011-01 - aspnetcore-store - $(AspNetCoreVersion)-$(AspNetCoreRelease) - $(AspNetCoreBranchName)-$(AspNetCoreRuntimePackageTimestamp) - - 0.1.1-alpha-167 - 2.1.0-preview1-25806-02 + $(MicrosoftNETCoreAppPackageVersion) + $(MicrosoftNETCoreAppPackageVersion) + $(MicrosoftAspNetCoreAppPackageVersion) - 1.0.27-prerelease-01723-01 + 2.1.0-prerelease-02430-04 + $(BuildTasksFeedToolVersion) 2.0.0-preview2-25331-01 + diff --git a/build/DerivedHostMachineInfo.props b/build/DerivedHostMachineInfo.props index 3e77dad8c..2bb794527 100644 --- a/build/DerivedHostMachineInfo.props +++ b/build/DerivedHostMachineInfo.props @@ -1,7 +1,8 @@ - - true - true - true - + + true + true + true + true + diff --git a/build/DotnetCoreSdkLKG.props b/build/DotnetCoreSdkLKG.props index bb5724155..eec8dc801 100644 --- a/build/DotnetCoreSdkLKG.props +++ b/build/DotnetCoreSdkLKG.props @@ -12,7 +12,7 @@ - $(DotnetBlobRootUrl)/Sdk/$(DotNetCoreSdkLKGVersion)/ + $(CoreSetupBlobRootUrl)Sdk/$(DotNetCoreSdkLKGVersion)/ $(DotNetCoreSdkLKGRootUrl)$(DotNetCoreSdkLKGCompressedFileName)$(CoreSetupBlobAccessTokenParam) $(IntermediateDirectory)/SDKDownloadForTests/$(DotNetCoreSdkLKGVersion)/ $(DotNetCoreSdkLKGDownloadDirectory)$(DotNetCoreSdkLKGCompressedFileName) diff --git a/build/DownloadPackageVersions.targets b/build/DownloadPackageVersions.targets new file mode 100644 index 000000000..ff47bd99e --- /dev/null +++ b/build/DownloadPackageVersions.targets @@ -0,0 +1,11 @@ + + + + + + + diff --git a/build/GitCommitInfo.targets b/build/GitCommitInfo.targets index a81e1a7f3..baf01a253 100644 --- a/build/GitCommitInfo.targets +++ b/build/GitCommitInfo.targets @@ -2,13 +2,13 @@ + Condition=" '$(GitInfoCommitCount)' == '' "> + Condition=" '$(GitInfoCommitHash)' == '' "> diff --git a/build/InitRepo.props b/build/InitRepo.props index f917b88c2..077c23937 100644 --- a/build/InitRepo.props +++ b/build/InitRepo.props @@ -1,8 +1,11 @@ - $(RepoRoot)/bin/obj + bin/obj + $(RepoRoot)/$(RelativeGeneratedPropsDir) $(GeneratedPropsDir)/GitCommitInfo.props $(GeneratedPropsDir)/HostInfo.props $(GeneratedPropsDir)/BuildInfo.props + $(GeneratedPropsDir)/OrchestratedPackageVersionsProps.props + $(RepoRoot)/NuGet.Config diff --git a/build/InitRepo.targets b/build/InitRepo.targets index be227551e..9db639072 100644 --- a/build/InitRepo.targets +++ b/build/InitRepo.targets @@ -1,10 +1,12 @@ + WriteBuildInfoProps; + DownloadPackageVersionsProps"/> + + + debian + deb + x64 + + + rhel + rpm + x64 + + + diff --git a/build/MSBuildExtensions.targets b/build/MSBuildExtensions.targets new file mode 100644 index 000000000..46251b602 --- /dev/null +++ b/build/MSBuildExtensions.targets @@ -0,0 +1,136 @@ + + + + + + + Microsoft.NETCoreSdk.BundledVersions.props + + + + + <_NETStandardLibraryPackageVersions Include="@(PackageDefinitions->'%(Version)')" + Condition="%(PackageDefinitions.Name) == 'NetStandard.Library'" /> + <_NETCorePlatformsPackageVersions Include="@(PackageDefinitions->'%(Version)')" + Condition="%(PackageDefinitions.Name) == 'Microsoft.NETCore.Platforms'" /> + + + + + + + <_NETCoreAppPackageVersion>$(MicrosoftNETCoreAppPackageVersion) + <_NETStandardLibraryPackageVersion>@(_NETStandardLibraryPackageVersions->Distinct()) + <_NETCorePlatformsPackageVersion>@(_NETCorePlatformsPackageVersions->Distinct()) + <_AspNetCoreAllPackageVersion>$(MicrosoftAspNetCoreAllPackageVersion) + <_AspNetCoreAppPackageVersion>$(MicrosoftAspNetCoreAppPackageVersion) + + + <_NETCoreAppTargetFrameworkVersion>$(_NETCoreAppPackageVersion.Split('.')[0]).$(_NETCoreAppPackageVersion.Split('.')[1]) + <_NETStandardTargetFrameworkVersion>$(_NETStandardLibraryPackageVersion.Split('.')[0]).$(_NETStandardLibraryPackageVersion.Split('.')[1]) + <_AspNetCoreAllTargetFrameworkVersion>$(_NETCoreAppTargetFrameworkVersion) + <_AspNetCoreAppTargetFrameworkVersion>$(_AspNetCoreAllTargetFrameworkVersion) + + <_NETCoreSdkIsPreview Condition=" '$(DropSuffix)' != 'true' ">true + + + + + + + + + + + + + + + + + + + + + $(_NETCoreAppTargetFrameworkVersion) + $(_NETCoreAppPackageVersion) + $(_NETStandardTargetFrameworkVersion) + $(_NETStandardLibraryPackageVersion) + $(_NETCorePlatformsPackageVersion) + @(BundledVersionsVariable->'<%(Identity)>%(Value)', '%0A ') + $(SdkVersion) + <_NETCoreSdkIsPreview>$(_NETCoreSdkIsPreview) + + + 1.0.11 + 1.1.8 + 2.0.7 + + +]]> + + + + + + + + + Microsoft.NETCoreSdk.BundledCliTools.props + + + + + + + +@(BundledDotnetTools->HasMetadata('ObsoletesCliTool')->' %3CBundledDotNetCliToolReference Include="%(ObsoletesCliTool)" /%3E','%0A') + + +]]> + + + + + + diff --git a/build/MicroBuild.props b/build/MicroBuild.props index f55a5eea1..b32b9f115 100644 --- a/build/MicroBuild.props +++ b/build/MicroBuild.props @@ -3,6 +3,6 @@ $(RepoRoot)/.nuget/packages - $(NuGetPackagesDir)/microbuild.core/$(MicroBuildVersion)/build/ + $(NuGetPackagesDir)/microbuild.core/$(MicroBuildCorePackageVersion)/build/ diff --git a/build/NugetConfigFile.targets b/build/NugetConfigFile.targets new file mode 100644 index 000000000..87b6a0123 --- /dev/null +++ b/build/NugetConfigFile.targets @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + ]]> + + + + + + ]]> + + + + + + + + + + + + + + diff --git a/build/OutputDirectories.props b/build/OutputDirectories.props index 2edc9734b..9eae98ec3 100644 --- a/build/OutputDirectories.props +++ b/build/OutputDirectories.props @@ -17,20 +17,18 @@ $(BaseOutputDirectory)/symbols $(SdkOutputDirectory)/Roslyn $(SdkOutputDirectory)/FSharp - $(BaseOutputDirectory)/stage2compilation - $(BaseOutputDirectory)/intermediate + $(BaseOutputDirectory)/compilation + $(BaseOutputDirectory)/int $(BaseOutputDirectory)/packages $(IntermediateDirectory)/sharedFrameworkPublish $(IntermediateDirectory)/toolsetPublish - - $(BaseOutputDirectory)/AspRT + $(IntermediateDirectory)/aspnetSharedFxPublish $(IntermediateDirectory)/backwardsCompatibleSharedFrameworksPublish - $(BaseOutputDirectory)/testpackages/ + $(BaseOutputDirectory)/test/ $(OutputDirectory)/dotnet$(ExeExtension) $(IntermediateDirectory)/GeneratedMSBuildExtensions $(IntermediateDirectory)/MSBuildExtensionsLayout $(MSBuildExtensionsLayoutDirectory)/MSBuildSdkResolver - $(BaseOutputDirectory)/PreviousStage.props diff --git a/build/Package.targets b/build/Package.targets index 6d324830d..9d4e65f60 100644 --- a/build/Package.targets +++ b/build/Package.targets @@ -1,20 +1,36 @@ + + + + Condition=" '$(SkipBuildingInstallers)' != 'true' And !$(Architecture.StartsWith('arm')) " + DependsOnTargets="Prepare; + Layout; + GeneratePkgs; + GenerateDebs; + GenerateMsis; + GenerateRpms" /> + GenerateInstallers" /> + + + diff --git a/build/Prepare.targets b/build/Prepare.targets index b55628415..94dc80893 100644 --- a/build/Prepare.targets +++ b/build/Prepare.targets @@ -13,6 +13,14 @@ CheckPrereqs;"> + + + @@ -31,7 +39,7 @@ %(_DownloadAndExtractItem.OverwriteDestination) True - + @@ -137,3 +145,4 @@ + diff --git a/build/Publish.targets b/build/Publish.targets index bc9a387b6..70819a6b1 100644 --- a/build/Publish.targets +++ b/build/Publish.targets @@ -1,21 +1,31 @@ + - + - + + + + Condition=" '$(PublishNativeInstallers)' == 'true' "/> - - - + Condition=" '$(PublishArchives)' == 'true' "/> + + + + + + - $(Product)/$(FullNugetVersion)/$([System.String]::Copy('%(Filename)%(Extension)').Replace('\' ,'/')) + $(BlobStoragePartialRelativePath)/$(FullNugetVersion)/$([System.String]::Copy('%(Filename)%(Extension)').Replace('\' ,'/')) + ShipInstaller=dotnetcli + + + + Condition=" '$(Coherent)' == 'true' And !$(Architecture.StartsWith('arm')) " /> - $(Product)/$(FullNugetVersion)/$([System.String]::Copy('%(Filename)%(Extension)').Replace('\' ,'/')) + $(BlobStoragePartialRelativePath)/$(FullNugetVersion)/$([System.String]::Copy('%(Filename)%(Extension)').Replace('\' ,'/')) + ShipInstaller=dotnetcli - - - + + - \ No newline at end of file + + diff --git a/build/SandBoxAndPackage.proj b/build/SandBoxAndPackage.proj new file mode 100644 index 000000000..1387402eb --- /dev/null +++ b/build/SandBoxAndPackage.proj @@ -0,0 +1,79 @@ + + + + + + bin/WorkingCopy + $(SandBoxFolderName)/RelativeSandBoxPackageOutputFolder + $(RepoRoot)/$(SandBoxFolderName)/$(LinuxDistrosNeedNativeInstaller) + .nuget + bin/2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(SandBoxRepoRoot)/build.sh + $(CommandToInvokeBuildScriptInDockerToPackageInSandBox) --configuration $(BuildConfiguration) + $(CommandToInvokeBuildScriptInDockerToPackageInSandBox) --docker $(DockerFolder) + $(CommandToInvokeBuildScriptInDockerToPackageInSandBox) --skip-prereqs + $(CommandToInvokeBuildScriptInDockerToPackageInSandBox) /t:GenerateInstallersAndCopyOutOfSandBox + $(CommandToInvokeBuildScriptInDockerToPackageInSandBox) /p:RelativeSandBoxPackageOutputFolder=$(RelativeSandBoxPackageOutputFolder) + 0 + 2>&1 + + + + + + + + true + + + + + + + + + + + + diff --git a/build/SandBoxAndPackageInParallel.proj b/build/SandBoxAndPackageInParallel.proj new file mode 100644 index 000000000..43a8300fc --- /dev/null +++ b/build/SandBoxAndPackageInParallel.proj @@ -0,0 +1,16 @@ + + + + + + + + + diff --git a/build/Signing.proj b/build/Signing.proj index da686886a..69b08f0c1 100644 --- a/build/Signing.proj +++ b/build/Signing.proj @@ -5,6 +5,9 @@ true + 135020001 + Microsoft402 + NuGet @@ -19,16 +22,16 @@ - $(BaseOutputDirectory)/intermediate/MSBuildExtensionsLayout/MSBuildSdkResolver + $(IntermediateDirectory)/MSBuildExtensionsLayout/MSBuildSdkResolver $(BaseOutputDirectory) - $(BaseOutputDirectory)/intermediate + $(IntermediateDirectory) - + @@ -40,6 +43,7 @@ + + - - - - - $(InternalCertificateId) - - - - - + + diff --git a/build/Test.targets b/build/Test.targets index 380c576d5..9829573cd 100644 --- a/build/Test.targets +++ b/build/Test.targets @@ -1,12 +1,11 @@ - : %3b - $(SdkOutputDirectory)$(PathListSeparator)$(PATH) + $(OutputDirectory)$(PathListSeparator)$(PATH) $(OutputDirectory) $(TestOutputDir)/packages/ $(TestOutputDir)/artifacts/ @@ -14,7 +13,7 @@ @@ -30,7 +29,7 @@ PreviousStageProps=$(NextStagePropsPath); TestProject=%(TestProjects.Identity); TestResultXmlDir=$(TestResultXmlDir); - ToolPath=$(SdkOutputDirectory); + ToolPath=$(OutputDirectory); WorkingDirectory=$([System.IO.Directory]::GetParent(%(TestProjects.Identity))) @@ -72,6 +71,8 @@ Projects="@(ProjectsToTest)"> + + @@ -83,22 +84,22 @@ + SetupTestProjectData"> - - @@ -108,7 +109,7 @@ DependsOnTargets="SetupTestPackageProjectData;" Outputs="%(TestPackageProject.Identity)"> - - - diff --git a/build/Version.props b/build/Version.props index 81d603820..435125452 100644 --- a/build/Version.props +++ b/build/Version.props @@ -1,22 +1,26 @@ 2 - 0 - 3 + 2 + 100 refac - $(VersionMajor).$(VersionMinor).$(VersionPatch)-$(ReleaseSuffix) - $(VersionMajor).$(VersionMinor).$(VersionPatch).$(CommitCount) - $(VersionMajor).$(VersionMinor).$(VersionPatch) + $(VersionMajor).$(VersionMinor) + $(VersionMajor).$(VersionMinor).$(VersionPatch) + $(CliVersionNoSuffix)-$(ReleaseSuffix) + $(CliVersionNoSuffix) - $(ReleaseSuffix) + $(CliVersionNoSuffix) + $(CliVersionNoSuffix).$(CommitCount) + $(CliVersionNoSuffix) - $(ReleaseSuffix)-$(CommitCount) + $(ReleaseSuffix)-$(CommitCount) - $(VersionMajor).$(VersionMinor).$(VersionPatch)-$(ReleaseSuffix)-$(CommitCount) + $(CliVersionNoSuffix)-$(ReleaseSuffix)-$(CommitCount) - $(FullNugetVersion) - $(VersionMajor).$(VersionMinor).$(VersionPatch) + $(FullNugetVersion) + $(CliVersionNoSuffix) $(NugetVersion) - $(NugetVersion) + $(NugetVersion) diff --git a/build/VersionBadge.props b/build/VersionBadge.props deleted file mode 100644 index d38b1b359..000000000 --- a/build/VersionBadge.props +++ /dev/null @@ -1,14 +0,0 @@ - - - $(OSName)_$(Architecture) - debian_8_x64 - rhel_7_x64 - ubuntu_14_04_x64 - ubuntu_16_04_x64 - ubuntu_16_10_x64 - linux_x64 - - $(BaseOutputDirectory)/$(VersionBadgeMoniker)_$(Configuration)_version_badge.svg - $(BaseOutputDirectory)/$(VersionBadgeMoniker)_$(Configuration)_coherent_badge.svg - - diff --git a/build/buildpipeline/security/DotNet-CLI-Security-Windows.json b/build/buildpipeline/security/DotNet-CLI-Security-Windows.json new file mode 100644 index 000000000..74362e939 --- /dev/null +++ b/build/buildpipeline/security/DotNet-CLI-Security-Windows.json @@ -0,0 +1,764 @@ +{ + "build": [ + { + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Workaround for BuildTools - Clone Core-Setup", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "filename": "$(PB_Git)", + "arguments": "clone $(CoreSetupUrl) core-setup", + "workingFolder": "$(Build.SourcesDirectory)", + "failOnStandardError": "false" + } + }, + { + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Workaround for BuildTools - Checkout Core-Setup master", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "filename": "$(PB_Git)", + "arguments": "checkout master", + "workingFolder": "$(build.SourcesDirectory)\\core-setup", + "failOnStandardError": "false" + } + }, + { + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Workaround for BuildTools - Run init-tools.cmd", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "filename": "init-tools.cmd", + "arguments": "", + "workingFolder": "$(Build.SourcesDirectory)\\core-setup", + "failOnStandardError": "false" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Workaround for BuildTools - Delete CLI dir.props", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "scriptType": "inlineScript", + "scriptName": "", + "arguments": "-path \"$(Build.SourcesDirectory)\"", + "workingFolder": "$(Build.SourcesDirectory)", + "inlineScript": "param ($path)\ngci \"$path\\dir.props\" | Remove-Item -Force", + "failOnStandardError": "true" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Download blobs from container $(PB_CloudDropAccountName)", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "c6c4c611-aa2e-4a33-b606-5eaba2196824", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "solution": "$(Build.SourcesDirectory)\\build\\buildpipeline\\security\\syncAzure.proj", + "msbuildLocationMethod": "version", + "msbuildVersion": "latest", + "msbuildArchitecture": "x64", + "msbuildLocation": "", + "platform": "x64", + "configuration": "$(BuildConfiguration)", + "msbuildArguments": "/p:AzureAccount=\"$(PB_CloudDropAccountName)\" /p:AzureToken=\"$(PB_CloudDropAccessToken)\" /p:BlobName=\"$(PB_BlobNameFilter)\" /verbosity:diag", + "clean": "false", + "maximumCpuCount": "false", + "restoreNugetPackages": "false", + "logProjectEvents": "false", + "createLogFile": "false" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Copy downloaded packages to security folder", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "refName": "PowerShell_23", + "task": { + "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "scriptType": "inlineScript", + "scriptName": "", + "arguments": "-SrcDir \"$(Build.SourcesDirectory)\"", + "workingFolder": "$(Build.SourcesDirectory)", + "inlineScript": "param($SrcDir)\n$secDir = Join-Path \"$SrcDir\" \"security\"\n$pkgDir = \"$SrcDir\\core-setup\\packages\\AzureTransfer\"\nCopy-Item \"$pkgDir \" \"$secDir\" -Force -Recurse\n", + "failOnStandardError": "true" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Extract downloaded packages", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "scriptType": "inlineScript", + "scriptName": "", + "arguments": "-SrcDir \"$(Build.SourcesDirectory)\"", + "workingFolder": "$(Build.SourcesDirectory)", + "inlineScript": "param($SrcDir)\n$secDir = Join-Path \"$SrcDir\" \"security\"\ngci \"$secDir\\*.zip\" | % {\n$dstDir = Join-Path \"$secDir\" $($_.BaseName)\nExpand-Archive -Path $($_.FullName) -DestinationPath \"$dstDir\" -Force\nWrite-Host \"Expanded: $($_.FullName)\"\nRemove-Item $_.FullName -Force\n}\n", + "failOnStandardError": "true" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "List all files", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "scriptType": "inlineScript", + "scriptName": "", + "arguments": "$(Build.SourcesDirectory)", + "workingFolder": "$(Build.SourcesDirectory)", + "inlineScript": "param($SrcDir)\n$fileCount = 0\ngci $SrcDir -recurse | % {\nWrite-Host $($_.FullName)\n$fileCount += 1\n}\nWrite-Host \"File Count: $fileCount\"\n", + "failOnStandardError": "true" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Remove non-CLI folders", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "refName": "PowerShell_22", + "task": { + "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "scriptType": "inlineScript", + "scriptName": "", + "arguments": "-SrcDir \"$(Build.SourcesDirectory)\"", + "workingFolder": "$(Build.SourcesDirectory)", + "inlineScript": "param($SrcDir)\n$secDir = Join-Path \"$SrcDir\" \"security\"\n\ngci \"$secDir\" | where {$_.PSIsContainer} | % {\n gci $_.FullName | where {$_.PSIsContainer} | % {\n if ($_.BaseName -ine \"sdk\" -and $_.BaseName -notmatch \"symbols\")\n {\n Remove-Item $_.FullName -Recurse -Force -ErrorAction Continue\n Write-Host \"Removed $($_.FullName)\"\n }\n }\n}", + "failOnStandardError": "false" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Workaround for long path - DELETE files with path length greater than or equal to 240 characters", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "refName": "Task_10", + "task": { + "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "scriptType": "inlineScript", + "scriptName": "", + "arguments": "-SrcDir \"$(Build.SourcesDirectory)\"", + "workingFolder": "$(Build.SourcesDirectory)", + "inlineScript": "param($SrcDir)\n$longPath = New-Object System.Collections.ArrayList\ngci \"$SrcDir\\*\" -recurse | where {!$_.PSIsContainer} | % {\nif ($($_.FullName.Length) -ge 240)\n{\n$longPath.Add($($_.Directory.FullName)) | Out-Null\n}\n}\n$longPath | % {\nStart-Process \"cmd\" -ArgumentList \"/c rd /S /Q $_\" -Wait\nWrite-Host \"DELETED $_\"\n}\n", + "failOnStandardError": "false" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "List all files - post delete", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "refName": "Task_11", + "task": { + "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "scriptType": "inlineScript", + "scriptName": "", + "arguments": "$(Build.SourcesDirectory)", + "workingFolder": "$(Build.SourcesDirectory)", + "inlineScript": "param($SrcDir)\n$fileCount = 0\ngci $SrcDir -recurse | % {\nWrite-Host $($_.FullName)\n$fileCount += 1\n}\nWrite-Host \"File Count: $fileCount\"\n", + "failOnStandardError": "true" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Get latest version info", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "refName": "PowerShell23", + "task": { + "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "scriptType": "filePath", + "scriptName": "$(Build.SourcesDirectory)\\build\\buildpipeline\\security\\Get-LatestVersion.ps1", + "arguments": "-Branch \"$(CodeBase)\"", + "workingFolder": "", + "failOnStandardError": "true" + } + }, + { + "environment": {}, + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Workaround for long package Id", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "refName": "PowerShell24", + "task": { + "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "scriptType": "inlineScript", + "scriptName": "", + "arguments": "-packageId $(CliLatestPackageId)", + "workingFolder": "", + "inlineScript": "param($packageId)\n\nif ($packageId.Length -ge 16)\n{\n Write-Host \"Build number for security build is the package Id. TSA has a limit of 16 characters for build number. Since package Id is greater than 16 characters, build number will be set to current date time in yyyymmddHHMMss format.\"\n $CliLatestPackageId = Get-Date -Format yyyymmddHHMMss\n Write-Host \"##vso[task.setvariable variable=CliLatestPackageId;]$CliLatestPackageId\"\n}", + "failOnStandardError": "true" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Run BinSkim ", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "3056813a-40e9-4b2f-8f6b-612d1bc4e045", + "versionSpec": "3.*", + "definitionType": "task" + }, + "inputs": { + "InputType": "CommandLine", + "arguments": "analyze $(Build.SourcesDirectory)\\security\\*.dll $(Build.SourcesDirectory)\\security\\*.exe --recurse --sympath $(Build.SourcesDirectory)\\security\\*.pdb --verbose --statistics", + "Function": "analyze", + "AnalyzeTarget": "$(Build.ArtifactStagingDirectory)", + "AnalyzeSymPath": "", + "AnalyzeConfigPath": "default", + "AnalyzePluginPath": "", + "AnalyzeRecurse": "true", + "AnalyzeVerbose": "true", + "AnalyzeHashes": "true", + "AnalyzeStatistics": "false", + "AnalyzeEnvironment": "false", + "ExportRulesOutputType": "SARIF", + "DumpTarget": "$(Build.ArtifactStagingDirectory)", + "DumpRecurse": "true", + "DumpVerbose": "true", + "toolVersion": "Latest" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Run APIScan", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "9adea2b1-3752-438c-80c6-a6f0a812abdd", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "targetMode": "binarysym", + "softwareFolder": "$(Build.SourcesDirectory)\\security", + "mpdFolder": "", + "softwareName": "CLI", + "softwareVersionNum": "$(CliLatestPackageId)", + "softwareBuildNum": "$(CliLatestPackageId)", + "modeType": "prerelease", + "noCopySymbols": "false", + "noCopyBinaries": "false", + "noDecompress": "true", + "exclusionList": "", + "email": "", + "symbolsFolder": "$(Build.SourcesDirectory)\\security", + "preBbtBinariesFolder": "", + "preBbtSymbolsFolder": "", + "isLargeApp": "false", + "analyzerTimeout": "00:00:00", + "preserveTempFiles": "false", + "toolVersion": "Latest" + } + }, + { + "enabled": true, + "continueOnError": false, + "alwaysRun": false, + "displayName": "Checkout CLI at SHA listed in latest.version", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "scriptType": "inlineScript", + "scriptName": "", + "arguments": "-sha \"$(CliLatestCommitSha)\" -git \"$(PB_Git)\"", + "workingFolder": "$(Build.SourcesDirectory)", + "inlineScript": "param($sha, $git)\n\nStart-Process \"$git\" -ArgumentList \"clean -df\" -Wait -Verbose -ErrorAction Stop\nStart-Process \"$git\" -ArgumentList \"checkout $sha\" -Wait -Verbose -ErrorAction Stop\nWrite-Host \"Checked out at $sha\"\n", + "failOnStandardError": "true" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Run Core-Setup clean.cmd", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "filename": "clean.cmd", + "arguments": "-all", + "workingFolder": "$(Build.SourcesDirectory)\\core-setup", + "failOnStandardError": "false" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Delete Core-Setup folder", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "scriptType": "inlineScript", + "scriptName": "", + "arguments": "-path \"$(Build.SourcesDirectory)\\core-setup\"", + "workingFolder": "", + "inlineScript": "param ($path)\nRemove-Item \"$path\" -Force -Recurse -ErrorAction Continue\n", + "failOnStandardError": "true" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "List all files - post checkout", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "scriptType": "inlineScript", + "scriptName": "", + "arguments": "$(Build.SourcesDirectory)", + "workingFolder": "$(Build.SourcesDirectory)", + "inlineScript": "param($SrcDir)\n$fileCount = 0\ngci $SrcDir -recurse | % {\nWrite-Host $($_.FullName)\n$fileCount += 1\n}\nWrite-Host \"File Count: $fileCount\"\n", + "failOnStandardError": "true" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Run CredScan", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "ea576cd4-c61f-48f8-97e7-a3cb07b90a6f", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "outputFormat": "pre", + "toolVersion": "Latest", + "scanFolder": "$(Build.SourcesDirectory)", + "searchersFileType": "Default", + "searchersFile": "", + "suppressionsFile": "", + "suppressAsError": "false", + "batchSize": "" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Run PoliCheck", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "d785890c-0d0d-46bd-8167-8fa9d49990c7", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "inputType": "Basic", + "cmdLineArgs": "/F:$(Build.SourcesDirectory) /T:9 /O:PoliCheck.xml", + "targetType": "F", + "targetArgument": "$(Build.SourcesDirectory)", + "importEx": "0", + "termTypeT": "0029a9", + "termTypeTCustom": "9", + "termTypeK": "", + "termTypeL": "", + "EXGT": "false", + "result": "PoliCheck.xml", + "optionsFC": "1", + "optionsXS": "1", + "optionsCTGLEN": "", + "optionsSEV": "", + "optionsPE": "", + "optionsHMENABLE": "", + "optionsHPATH": "", + "optionsHVER": "", + "optionsRulesDBPath": "", + "optionsRule": "", + "optionsXCLASS": "", + "optionsTASKNAME": "", + "optionsWORKINGDIRECTORY": "", + "optionsFTPATH": "", + "optionsD": "", + "optionsB1": "", + "optionsB2": "", + "optionsB3": "", + "optionsOCDB": "", + "toolVersion": "Latest" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Post Analysis", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "f5679091-e6da-4974-a8dc-0eec03a8ea63", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "APIScan": "true", + "BinScope": "false", + "BinSkim": "true", + "BinSkimBreakOn": "Error", + "CredScan": "true", + "FortifySCA": "false", + "FxCop": "false", + "FxCopBreakOn": "ErrorAbove", + "ModernCop": "false", + "ModernCopBreakOn": "Error", + "PoliCheck": "true", + "PoliCheckBreakOn": "Severity1", + "SDLNativeRules": "false", + "TSLint": "false", + "TSLintBreakOn": "Error" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "Publish Security Analysis Logs", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "4096c760-3a8a-435d-9689-88c0311bbc0e", + "versionSpec": "2.*", + "definitionType": "task" + }, + "inputs": { + "ArtifactName": "CodeAnalysisLogs", + "ArtifactType": "Container", + "TargetPath": "\\\\my\\share\\$(Build.DefinitionName)\\$(Build.BuildNumber)", + "RvName": "", + "ProductComponentName": "", + "ProductVersionNumber": "", + "PlatformName": "", + "SDLToolName": "", + "SDLToolResultFile": "" + } + }, + { + "enabled": true, + "continueOnError": true, + "alwaysRun": false, + "displayName": "TSA upload to Codebase: DotNet-CLI-Trusted_$(CodeBase) Stamp: Azure", + "timeoutInMinutes": 0, + "condition": "succeeded()", + "task": { + "id": "3da26988-bb64-4a23-8f06-45531d297dae", + "versionSpec": "1.*", + "definitionType": "task" + }, + "inputs": { + "codebase": "NewOrUpdate", + "tsaStamp": "Azure", + "tsaWebApiUrl": "$(TSAStamp)", + "codeBaseName": "DotNet-CLI-Trusted_$(CodeBase)", + "notificationAlias": "$(NotificationAlias)", + "codeBaseAdmins": "NORTHAMERICA\\raeda", + "instanceUrlAzure": "MSAZURE", + "instanceUrlBing": "", + "instanceUrlCarbon": "", + "instanceUrlDevDiv": "DEVDIV", + "instanceUrlSkype": "", + "instanceUrlTsa": "", + "instanceUrlPpe": "", + "projectNameDAIPVSTF": "", + "projectNameDYNAMICSCRM": "", + "projectNameMSAZURE": "One", + "projectNameMSDYENG": "", + "projectNameMSECG": "", + "projectNameIDENTITYDIVISION": "Code Scan - TSA", + "projectNameVSTFRD": "", + "projectNameMSASG": "", + "projectNameMICROSOFTVSTS": "", + "projectNameMSDATA": "", + "projectNameMSENG": "", + "projectNameDEVDIV": "DevDiv", + "projectNameSKYPETEST2": "", + "projectNameONEDRIVE": "", + "projectNameSQLBUVSTS": "", + "projectNamePOWERBI": "", + "projectNameAZUREVSTFPPE": "", + "projectNameSKYPE": "", + "projectNameDOMOREEXP": "", + "projectNameSQLBUVSTSTEST": "", + "areaPath": "One\\DevDiv\\DotNetCore", + "iterationPath": "One", + "uploadAPIScan": "true", + "uploadBinScope": "false", + "uploadBinSkim": "true", + "uploadCredScan": "true", + "uploadFortifySCA": "false", + "uploadFxCop": "false", + "uploadModernCop": "false", + "uploadPoliCheck": "true", + "uploadPREfast": "false", + "validateToolOutput": "Warning", + "validateCompatibility": "Error", + "uploadAsync": "true" + } + } + ], + "options": [ + { + "enabled": false, + "definition": { + "id": "5bc3cfb7-6b54-4a4b-b5d2-a3905949f8a6" + }, + "inputs": {} + }, + { + "enabled": false, + "definition": { + "id": "7c555368-ca64-4199-add6-9ebaf0b0137d" + }, + "inputs": { + "multipliers": "[]", + "parallel": "false", + "continueOnError": "true", + "additionalFields": "{}" + } + }, + { + "enabled": false, + "definition": { + "id": "a9db38f9-9fdc-478c-b0f9-464221e58316" + }, + "inputs": { + "workItemType": "234347", + "assignToRequestor": "true", + "additionalFields": "{}" + } + }, + { + "enabled": false, + "definition": { + "id": "57578776-4c22-4526-aeb0-86b6da17ee9c" + }, + "inputs": {} + }, + { + "enabled": false, + "definition": { + "id": "5d58cc01-7c75-450c-be18-a388ddb129ec" + }, + "inputs": { + "branchFilters": "[\"+refs/heads/*\"]", + "additionalFields": "{}" + } + } + ], + "variables": { + "system.debug": { + "value": "false" + } + }, + "demands": [ + "Agent.OS -equals windows_nt", + "msbuild" + ], + "retentionRules": [ + { + "branches": [ + "+refs/heads/*" + ], + "artifacts": [ + "build.SourceLabel" + ], + "artifactTypesToDelete": [], + "daysToKeep": 10, + "minimumToKeep": 1, + "deleteBuildRecord": true, + "deleteTestResults": true + } + ], + "_links": { + "self": { + "href": "https://devdiv.visualstudio.com/0bdbc590-a062-4c3f-b0f6-9383f67865ee/_apis/build/Definitions/6661" + }, + "web": { + "href": "https://devdiv.visualstudio.com/_permalink/_build/index?collectionId=011b8bdf-6d56-4f87-be0d-0092136884d9&projectId=0bdbc590-a062-4c3f-b0f6-9383f67865ee&definitionId=6661" + }, + "editor": { + "href": "https://devdiv.visualstudio.com/_permalink/_build/definitionEditor?collectionId=011b8bdf-6d56-4f87-be0d-0092136884d9&projectId=0bdbc590-a062-4c3f-b0f6-9383f67865ee&definitionId=6661" + }, + "badge": { + "href": "https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/6661/badge" + } + }, + "buildNumberFormat": "$(date:yyyyMMdd)$(rev:-rr)", + "jobAuthorizationScope": 1, + "jobTimeoutInMinutes": 600, + "jobCancelTimeoutInMinutes": 5, + "badgeEnabled": true, + "repository": { + "properties": { + "cleanOptions": "3", + "labelSources": "0", + "labelSourcesFormat": "$(build.buildNumber)", + "reportBuildStatus": "true", + "gitLfsSupport": "false", + "skipSyncSource": "false", + "checkoutNestedSubmodules": "false", + "fetchDepth": "0" + }, + "id": "ceac4423-53f8-4c97-bc62-173630412581", + "type": "TfsGit", + "name": "DotNet-Cli-Trusted", + "url": "https://devdiv.visualstudio.com/DevDiv/_git/DotNet-Cli-Trusted", + "defaultBranch": "refs/heads/master", + "clean": "true", + "checkoutSubmodules": false + }, + "processParameters": {}, + "quality": "definition", + "authoredBy": { + "id": "9d5fdf9f-36b6-4d0c-a12e-2737a673af94", + "displayName": "Ravi Eda", + "uniqueName": "raeda@microsoft.com", + "url": "https://app.vssps.visualstudio.com/Aa44b2c06-f247-425c-8464-4a0676af910a/_apis/Identities/9d5fdf9f-36b6-4d0c-a12e-2737a673af94", + "imageUrl": "https://devdiv.visualstudio.com/_api/_common/identityImage?id=9d5fdf9f-36b6-4d0c-a12e-2737a673af94" + }, + "queue": { + "id": 36, + "name": "DotNet-Build", + "pool": { + "id": 39, + "name": "DotNet-Build" + } + }, + "id": 6733, + "name": "DotNet-CLI-Security-Windows", + "url": "https://devdiv.visualstudio.com/0bdbc590-a062-4c3f-b0f6-9383f67865ee/_apis/build/Definitions/6661", + "uri": "vstfs:///Build/Definition/6733", + "path": "\\", + "type": 2, + "revision": 6, + "createdDate": "2017-06-21T21:58:12.397Z", + "project": { + "id": "0bdbc590-a062-4c3f-b0f6-9383f67865ee", + "name": "DevDiv", + "description": "Visual Studio and DevDiv team project for git source code repositories. Work items will be added for Adams, Dev14 work items are tracked in vstfdevdiv. ", + "url": "https://devdiv.visualstudio.com/_apis/projects/0bdbc590-a062-4c3f-b0f6-9383f67865ee", + "state": "wellFormed", + "revision": 418097676, + "visibility": 0 + } +} diff --git a/build/buildpipeline/security/Get-LatestVersion.ps1 b/build/buildpipeline/security/Get-LatestVersion.ps1 new file mode 100644 index 000000000..2f921ef3a --- /dev/null +++ b/build/buildpipeline/security/Get-LatestVersion.ps1 @@ -0,0 +1,71 @@ +<# +.SYNOPSIS + Retrieves the latest commit SHA and the corresponding package Id for the specified branch of CLI. + This retrieval is achieved by downloading the latest.version file, which contains the commit SHA and package Id info. + If retrieval succeeds, then the commit is set as a VSTS Task Variable named CliLatestCommitSha, and similarly package Id is set as CliLatestPackageId. +.PARAMETER $Branch + Name of the CLI branch. +.PARAMETER $Filename + Name of the file that contains latest version info i.e. commit SHA and package Id. + If not specified, then the default value is latest.version +.PARAMETER $UrlPrefix + URL prefix for $Filename. + If not specified, then the default value is https://dotnetcli.blob.core.windows.net/dotnet/Sdk +#> + +param( + [Parameter(Mandatory=$true)] + [string]$Branch, + [string]$Filename="latest.version", + [string]$UrlPrefix="https://dotnetcli.blob.core.windows.net/dotnet/Sdk" +) + +function Get-VersionInfo +{ + Write-Host "Attempting to retrieve latest version info from $latestVersionUrl" + $retries = 3 + $retryCount = 1 + $oldEap = $ErrorActionPreference + + while ($retryCount -le $retries) + { + $ErrorActionPreference = "Stop" + + try + { + $content = (Invoke-WebRequest -Uri "$latestVersionUrl" -UseBasicParsing).Content + return $content.Split([Environment]::NewLine, [System.StringSplitOptions]::RemoveEmptyEntries) + } + catch + { + Sleep -Seconds (Get-Random -minimum 3 -maximum 10) + Write-Host "Exception occurred while attempting to get latest version info from $latestVersionUrl. $_" + Write-Host "Retry $retryCount of $retries" + } + finally + { + $ErrorActionPreference = $oldEap + } + + $retryCount++ + } +} + +$latestVersionUrl = "$UrlPrefix/$Branch/$Filename" +$latestVersionContent = Get-VersionInfo + +if ($latestVersionContent -ne $null -and $latestVersionContent.Length -eq 2) +{ + $CliLatestCommitSha = $latestVersionContent[0] + $CliLatestPackageId = $latestVersionContent[1] + + Write-Host "##vso[task.setvariable variable=CliLatestCommitSha;]$CliLatestCommitSha" + Write-Host "##vso[task.setvariable variable=CliLatestPackageId;]$CliLatestPackageId" + + Write-Host "The latest commit SHA in CLI $Branch is $CliLatestCommitSha" + Write-Host "The latest package Id in CLI $Branch is $CliLatestPackageId" +} +else +{ + Write-Error "Unable to get latest version info from $latestVersionUrl" +} diff --git a/build/buildpipeline/security/dir.props b/build/buildpipeline/security/dir.props new file mode 100644 index 000000000..3e28b4a52 --- /dev/null +++ b/build/buildpipeline/security/dir.props @@ -0,0 +1,4 @@ + + + + diff --git a/build/buildpipeline/security/pipeline.json b/build/buildpipeline/security/pipeline.json new file mode 100644 index 000000000..dbac3626b --- /dev/null +++ b/build/buildpipeline/security/pipeline.json @@ -0,0 +1,22 @@ +{ + "Repository": "cli", + "Definitions": { + "Path": ".", + "Type": "VSTS", + "BaseUrl": "https://devdiv.visualstudio.com/DefaultCollection", + "SkipBranchAndVersionOverrides": "false" + }, + "Pipelines": [ + { + "Name": "Security Build for Windows", + "Parameters": { + "TreatWarningsAsErrors": "false" + }, + "Definitions": [ + { + "Name": "DotNet-CLI-Security-Windows" + } + ] + } + ] +} diff --git a/build/buildpipeline/security/syncAzure.proj b/build/buildpipeline/security/syncAzure.proj new file mode 100644 index 000000000..45d7657eb --- /dev/null +++ b/build/buildpipeline/security/syncAzure.proj @@ -0,0 +1,21 @@ + + + + + + $(BuildToolsTaskDesktopDir)Microsoft.DotNet.Build.CloudTestTasks.dll + dotnet + $(PackagesDir)AzureTransfer + + + + + + + + + + + + + diff --git a/build/buildpipeline/security/syncAzure.targets b/build/buildpipeline/security/syncAzure.targets new file mode 100644 index 000000000..4cc360a11 --- /dev/null +++ b/build/buildpipeline/security/syncAzure.targets @@ -0,0 +1,31 @@ + + + + + + + $(PackagesDir)/AzureTransfer + + + + + + + + + <_OSFilteredBlobNames Include="@(_BlobList)" + Condition="'$(OSGroup)' == 'Windows_NT' AND + ('%(_BlobList.Extension)' == '.zip' OR '%(_BlobList.Extension)' == '.exe' OR '%(_BlobList.Extension)' == '.version')" /> + + + + + diff --git a/build/compile/LzmaArchive.targets b/build/compile/LzmaArchive.targets index 98a23337b..a1fa07e91 100644 --- a/build/compile/LzmaArchive.targets +++ b/build/compile/LzmaArchive.targets @@ -3,16 +3,16 @@ $(SdkOutputDirectory)/nuGetPackagesArchive.lzma - nuGetPackagesArchive.$(AspNetCoreRuntimePackageFlavor).lzma + nuGetPackagesArchive-$(AspNetCoreVersion).lzma $(IntermediateDirectory)/$(NugetPackagesArchiveName) - $(AspNetCoreRuntimeInstallerBlobRootUrl)/$(NugetPackagesArchiveName) + $(AspNetCoreSharedFxRootUrl)$(AspNetCoreVersion)/$(NugetPackagesArchiveName) - diff --git a/build/package/CopySandBoxPackageOut.targets b/build/package/CopySandBoxPackageOut.targets new file mode 100644 index 000000000..a7bf6b524 --- /dev/null +++ b/build/package/CopySandBoxPackageOut.targets @@ -0,0 +1,9 @@ + + + + + + + diff --git a/build/package/Installer.DEB.proj b/build/package/Installer.DEB.proj index 4b684d161..0e516f440 100644 --- a/build/package/Installer.DEB.proj +++ b/build/package/Installer.DEB.proj @@ -13,19 +13,27 @@ Condition=" '$(IsDebianBaseDistro)' == 'True' " Outputs="@(GeneratedInstallers)"/> + + + + --ignore-depends=dotnet-runtime-$(AspNetCoreSharedFxBaseRuntimeVersion) + + + - + + - + - + - + + - + @@ -121,11 +130,11 @@ - + - + diff --git a/build/package/Installer.DEB.targets b/build/package/Installer.DEB.targets index 62421c895..349089d86 100644 --- a/build/package/Installer.DEB.targets +++ b/build/package/Installer.DEB.targets @@ -1,11 +1,8 @@ - - dotnet-sdk-$(SdkVersion) - - + DependsOnTargets="Init; + CalculateLinuxNativeInstallerDependencyVersions"> $(MSBuildThisFileDirectory)/dotnet-deb-tool-consumer @@ -25,20 +22,24 @@ - $(SdkVersion) + $(MicrosoftNETCoreAppMajorMinorVersion) + dotnet-runtime-deps-$(RuntimeDepsPackageVersion) + $(MajorMinorVersion) dotnet-sdk-$(SdkDebianPackageVersion) - $(SharedFrameworkVersion) + $(MicrosoftNETCoreAppPackageVersion) + $(MicrosoftNETCoreAppMajorMinorVersion) + dotnet-runtime-$(SharedFxDebianPackageFileVersion) + $(SharedFxDebianPackageFileName.ToLower()) dotnet-runtime-$(SharedFxDebianPackageVersion) $(SharedFxDebianPackageName.ToLower()) - $(HostFxrVersion) + $(HostFxrMajorMinorVersion) dotnet-hostfxr-$(HostFxrDebianPackageVersion) $(HostFxrDebianPackageName.ToLower()) dotnet-host - $(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreVersionAndRelease)-$(AspNetCoreRuntimePackageTimestamp) - $(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreVersion) - $(HostRid) - $(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreVersionAndRelease)-$(AspNetCoreRuntimePackageTimestamp)-$(HostRidInAspNetCoreRuntimeDebInstallerFileName).deb - $(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreVersion)-$(HostRidInAspNetCoreRuntimeDebInstallerFileName).deb + aspnetcore-runtime-$(AspNetCoreVersion) + $(AspNetCoreSharedFxDebianPackageFileName.ToLower()) + aspnetcore-runtime-$(AspNetCoreMajorMinorVersion) + $(AspNetCoreSharedFxDebianPackageName.ToLower()) @@ -87,8 +88,8 @@ $(SharedFxDebianPackageName) - - $(AspNetCoreRuntimePackageName) + + $(AspNetCoreSharedFxDebianPackageName) @@ -100,11 +101,17 @@ - $(SdkVersion) + $(MajorMinorVersion) $(SdkBrandName) + + $(MicrosoftNETCoreAppPackageVersionWithTilda) + + + $(AspNetCoreVersionWithTilda) + $(SdkVersion) @@ -121,14 +128,4 @@ - - - - $(PackagesDirectory)/$(AspNetCoreRuntimeDebInstallerFileName) - - - diff --git a/build/package/Installer.MSI.targets b/build/package/Installer.MSI.targets index dde5440d1..2935d40cb 100644 --- a/build/package/Installer.MSI.targets +++ b/build/package/Installer.MSI.targets @@ -2,7 +2,7 @@ - 3.10.2 + 3.10.4 https://dotnetcli.azureedge.net/build/wix/wix.$(WixVersion).zip $(IntermediateDirectory)/WixTools/$(WixVersion) $(WixRoot)/WixTools.$(WixVersion).zip @@ -145,7 +145,7 @@ + '$(Architecture)' + '$(MicrosoftNETCoreAppPackageVersion)' + '$(AspNetCoreVersion)'" /> --> - + $(SdkVersion) + + + $(SdkVersion) + + + $(MicrosoftNETCoreAppPackageVersion) + + + $(AspNetCoreVersion) + @@ -69,6 +79,8 @@ + + @@ -77,7 +89,7 @@ - + @@ -91,11 +103,17 @@ DestinationFiles="@(AspNetRuntimeFilesInput->'$(SdkLayoutOutputDirectory)/%(RecursiveDir)%(FileName)%(Extension)')" /> + + @@ -130,8 +148,8 @@ diff --git a/build/package/Installer.RPM.targets b/build/package/Installer.RPM.targets index bd5d468f4..e6e4fa917 100644 --- a/build/package/Installer.RPM.targets +++ b/build/package/Installer.RPM.targets @@ -18,52 +18,8 @@ DependsOnTargets="GenerateSdkRpm" Condition=" '$(BuildRpmPackage)' == 'True' and '$(FPMPresent)' == 'True' "/> - - - $(SdkVersion) - $(OutputDirectory)/sdk - $(InstallerOutputDirectory)/$(DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(InstallerExtension) - $(SdkInstallerFile) - $(RepoRoot)/Documentation/manpages - $(RepoRoot)/packaging/rpm/dotnet-config.json - $(IntermediateDirectory)/$(RpmPackageName)/$(RpmPackageVersion) - $(RpmIntermediatesDir)/debian-testResults.xml - /usr/share/dotnet - - - - $(RpmIntermediatesDir)/RpmLayoutDirectory/ - $(RpmLayoutDirectory)package_root - $(RpmLayoutPackageRoot)/sdk - $(RpmLayoutDirectory)docs - $(RpmLayoutDirectory)templates - $(RpmLayoutDirectory)scripts - - - - $(SdkVersion) - $(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(SdkRpmPackageVersion) - $(SharedFrameworkVersion) - dotnet-runtime-$(SharedFxRpmPackageVersion) - $(SharedFxRpmPackageName.ToLower()) - $(HostFxrVersion) - dotnet-hostfxr-$(HostFxrRpmPackageVersion) - $(HostFxrRpmPackageName.ToLower()) - dotnet-host - $(HostRid) - $(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreVersionAndRelease)-$(AspNetCoreRuntimePackageTimestamp) - $(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreVersion) - $(AspNetCoreVersion)-$(AspNetCoreRelease)-$(AspNetCoreRuntimePackageTimestamp) - $(AspNetCoreVersion) - $(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreVersionAndRelease)-$(AspNetCoreRuntimePackageTimestamp)-$(HostRidInAspNetCoreRuntimeRpmInstallerFileName).rpm - $(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreVersion)-$(HostRidInAspNetCoreRuntimeRpmInstallerFileName).rpm - $(ScriptsDir)/$(AfterInstallHostScriptName) - $(RpmLayoutScripts)/$(AfterInstallHostScriptName) - - - - $(RepoRoot)/test/EndToEnd/EndToEnd.csproj - + @@ -112,13 +68,13 @@ - $(SharedFrameworkVersion) + $(MicrosoftNETCoreAppMajorMinorPatchVersion) - - $(AspNetCoreRuntimePackageName) + + $(AspNetCoreSharedFxRpmPackageName) - - $(AspNetCoreRuntimePackageVersion) + + $(AspNetCoreMajorMinorPatchVersion) $(SharedFxRpmPackageName) @@ -148,16 +104,16 @@ - - @@ -187,14 +143,54 @@ - + - $(PackagesDirectory)/$(AspNetCoreRuntimeRpmInstallerFileName) + $(MicrosoftNETCoreAppPackageVersion) + dotnet-runtime-deps-$(RuntimeDepsPackageVersion) + $(SdkVersion) + $(OutputDirectory)/sdk + $(InstallerOutputDirectory)/$(DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(InstallerExtension) + $(SdkInstallerFile) + $(RepoRoot)/Documentation/manpages + $(RepoRoot)/packaging/rpm/dotnet-config.json + $(IntermediateDirectory)/$(RpmPackageName)/$(RpmPackageVersion) + $(RpmIntermediatesDir)/debian-testResults.xml + /usr/share/dotnet + + + + $(RpmIntermediatesDir)/RpmLayoutDirectory/ + $(RpmLayoutDirectory)package_root + $(RpmLayoutPackageRoot)/sdk + $(RpmLayoutDirectory)docs + $(RpmLayoutDirectory)templates + $(RpmLayoutDirectory)scripts + + + + $(MajorMinorVersion) + $(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(SdkRpmPackageVersion) + $(MicrosoftNETCoreAppMajorMinorVersion) + $(MicrosoftNETCoreAppPackageVersion) + dotnet-runtime-$(SharedFxRpmPackageVersion) + $(SharedFxRpmPackageName.ToLower()) + dotnet-runtime-$(SharedFxRpmPackageFileVersion) + $(SharedFxRpmPackageFileName.ToLower()) + $(HostFxrVersion) + dotnet-hostfxr-$(HostFxrRpmPackageVersion) + $(HostFxrRpmPackageName.ToLower()) + dotnet-host + aspnetcore-runtime-$(AspNetCoreMajorMinorVersion) + $(AspNetCoreSharedFxRpmPackageName.ToLower()) + aspnetcore-runtime-$(AspNetCoreVersion) + $(AspNetCoreSharedFxRpmPackageFileName.ToLower()) + $(ScriptsDir)/$(AfterInstallHostScriptName) + $(RpmLayoutScripts)/$(AfterInstallHostScriptName) + + + + $(RepoRoot)/test/EndToEnd/EndToEnd.csproj - @@ -217,20 +213,22 @@ + - + + @@ -239,15 +237,16 @@ ToolPath="$(RpmInstalledDirectory)" /> - - + + + diff --git a/build/package/Layout.targets b/build/package/Layout.targets index fe3c61448..4c248608b 100644 --- a/build/package/Layout.targets +++ b/build/package/Layout.targets @@ -10,7 +10,12 @@ - + + + + + + + + + + $([MSBuild]::Add($(MicrosoftNETCoreAppPackageVersion.IndexOf('.')), 1)) + $(MicrosoftNETCoreAppPackageVersion.IndexOf('.', $(MicrosoftNETCoreAppPatchSeparatorIndex))) + $(MicrosoftNETCoreAppPackageVersion.Substring(0, $(MicrosoftNETCoreAppPatchSeparatorIndex))) + + $(MicrosoftNETCoreAppPackageVersion.IndexOf('-')) + $(MicrosoftNETCoreAppPackageVersion) + $(MicrosoftNETCoreAppPackageVersion.Substring(0, $(MicrosoftNETCoreAppVersionPreReleaseSeparator))) + $([MSBuild]::Add($(MicrosoftNETCoreAppVersionPreReleaseSeparator), 1)) + $(MicrosoftNETCoreAppPackageVersion.Substring($(MicrosoftNETCoreAppVersionPreReleaseSeparatorStartIndex))) + $(MicrosoftNETCoreAppMajorMinorPatchVersion) + $(MicrosoftNETCoreAppMajorMinorPatchVersion)~$(MicrosoftNETCoreVersionSuffix) + + $([MSBuild]::Add($(AspNetCoreVersion.IndexOf('.')), 1)) + $(AspNetCoreVersion.IndexOf('.', $(AspNetCoreVersionPatchSeparatorIndex))) + $(AspNetCoreVersion.Substring(0, $(AspNetCoreVersionPatchSeparatorIndex))) + + $(AspNetCoreVersion.IndexOf('-')) + $(AspNetCoreVersion) + $(AspNetCoreVersion.Substring(0, $(AspNetCoreVersionPreReleaseSeparator))) + $([MSBuild]::Add($(AspNetCoreVersionPreReleaseSeparator), 1)) + $(AspNetCoreVersion.Substring($(AspNetCoreVersionPreReleaseSeparatorStartIndex))) + $(AspNetCoreMajorMinorPatchVersion) + $(AspNetCoreMajorMinorPatchVersion)~$(AspNetCoreVersionSuffix) + + $([MSBuild]::Add($(HostFxrVersion.IndexOf('.')), 1)) + $(HostFxrVersion.IndexOf('.', $(HostFxrVersionPatchSeparatorIndex))) + $(HostFxrVersion.Substring(0, $(HostFxrVersionPatchSeparatorIndex))) + + + + diff --git a/build/package/Symbols.csproj b/build/package/Symbols.csproj new file mode 100644 index 000000000..7a4bbfd6e --- /dev/null +++ b/build/package/Symbols.csproj @@ -0,0 +1,17 @@ + + + + + netcoreapp1.0 + false + true + false + + $(SymbolsNupkgPackageId) + $(SdkVersion) + + + + + + diff --git a/build/package/Symbols.targets b/build/package/Symbols.targets new file mode 100644 index 000000000..d85180233 --- /dev/null +++ b/build/package/Symbols.targets @@ -0,0 +1,29 @@ + + + + $(MSBuildThisFileDirectory)/Symbols.csproj + runtime.$(ProductMonikerRid).Microsoft.DotNet.SDK + + + + + + + + + + + + + + + + diff --git a/build/package/dotnet-deb-tool-consumer/dotnet-deb-tool-consumer.csproj b/build/package/dotnet-deb-tool-consumer/dotnet-deb-tool-consumer.csproj index 03e67c852..6446ffad1 100644 --- a/build/package/dotnet-deb-tool-consumer/dotnet-deb-tool-consumer.csproj +++ b/build/package/dotnet-deb-tool-consumer/dotnet-deb-tool-consumer.csproj @@ -1,7 +1,7 @@ netcoreapp2.0 - $(CLI_SharedFrameworkVersion) + $(MicrosoftNETCoreAppPackageVersion) diff --git a/build/publish/Badge.targets b/build/publish/Badge.targets index d80313c19..3493b5880 100644 --- a/build/publish/Badge.targets +++ b/build/publish/Badge.targets @@ -9,21 +9,34 @@ + Condition=" '$(Coherent)' == 'true' And !$(Architecture.StartsWith('arm')) "> - \ No newline at end of file + + + + $(OSName)_$(Architecture) + rhel.6_x64 + linux_musl_x64 + linux_$(Architecture) + all_linux_distros_native_installer + + $(BaseOutputDirectory)/$(VersionBadgeMoniker)_$(Configuration)_version_badge.svg + $(BaseOutputDirectory)/$(VersionBadgeMoniker)_$(Configuration)_coherent_badge.svg + + + diff --git a/build/publish/Checksum.targets b/build/publish/Checksum.targets index 57e27b2a0..527edf31d 100644 --- a/build/publish/Checksum.targets +++ b/build/publish/Checksum.targets @@ -15,6 +15,7 @@ %(ForPublishing.FullPath).sha %(ForPublishing.RelativeBlobPath).sha + ShipInstaller=dotnetclichecksums diff --git a/build/publish/FinishBuild.targets b/build/publish/FinishBuild.targets index dfb224431..fd439bab0 100644 --- a/build/publish/FinishBuild.targets +++ b/build/publish/FinishBuild.targets @@ -1,10 +1,12 @@ - + - - + + $([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/')) + ShipInstaller=dotnetcli @@ -21,40 +22,40 @@ - - - - - - + + + + - - - - - - + + + + - \ No newline at end of file + diff --git a/build/publish/PublishDebian.targets b/build/publish/PublishDebian.targets deleted file mode 100644 index 6dd777180..000000000 --- a/build/publish/PublishDebian.targets +++ /dev/null @@ -1,28 +0,0 @@ - - - - dotnet-sdk-$(SdkVersion) - - - - $(DotnetBlobRootUrl)/$(Product)/$(FullNugetVersion)/$(DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)-$(Architecture)$(InstallerExtension) - - - - - - - - - - - diff --git a/build/publish/PublishNupkgToBlobFeed.targets b/build/publish/PublishNupkgToBlobFeed.targets new file mode 100644 index 000000000..272e08cc2 --- /dev/null +++ b/build/publish/PublishNupkgToBlobFeed.targets @@ -0,0 +1,46 @@ + + + + + + + NonShipping=true + + + NonShipping=true + + + + + + + + + + + + + + + + + + + + + diff --git a/build/publish/RuntimeCoherence.targets b/build/publish/RuntimeCoherence.targets index 5ba7482bf..4fb8f4d4e 100644 --- a/build/publish/RuntimeCoherence.targets +++ b/build/publish/RuntimeCoherence.targets @@ -1,25 +1,26 @@ - + + PropertyName="AspNetCoreSharedFxBaseRuntimeVersion"/> - + false - true + true diff --git a/build/templates/templates.csproj b/build/templates/templates.csproj index 099a67e3f..2b8443fc6 100644 --- a/build/templates/templates.csproj +++ b/build/templates/templates.csproj @@ -3,12 +3,11 @@ Library - netcoreapp1.0 false - + diff --git a/build/test/OverlaySdkOnLKG.targets b/build/test/OverlaySdkOnLKG.targets deleted file mode 100644 index c940d757f..000000000 --- a/build/test/OverlaySdkOnLKG.targets +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/build/test/TestProjects.targets b/build/test/TestProjects.targets index 7af148240..bd75ef4c0 100644 --- a/build/test/TestProjects.targets +++ b/build/test/TestProjects.targets @@ -7,8 +7,8 @@ + Include="test/Microsoft.DotNet.Tools.Tests.Utilities/Microsoft.DotNet.Tools.Tests.Utilities.csproj; + test/Microsoft.DotNet.TestFramework/Microsoft.DotNet.TestFramework.csproj" /> diff --git a/build_projects/Microsoft.DotNet.Cli.Build.SelfTest/InvokeWithStage2.proj b/build_projects/Microsoft.DotNet.Cli.Build.SelfTest/InvokeWithStage2.proj index 1493128e7..cb833d480 100644 --- a/build_projects/Microsoft.DotNet.Cli.Build.SelfTest/InvokeWithStage2.proj +++ b/build_projects/Microsoft.DotNet.Cli.Build.SelfTest/InvokeWithStage2.proj @@ -7,8 +7,6 @@ false true - false - true false true diff --git a/build_projects/dotnet-cli-build.Tests/GivenActionAndRetryTimes.cs b/build_projects/dotnet-cli-build.Tests/GivenActionAndRetryTimes.cs deleted file mode 100644 index 47c83e0a7..000000000 --- a/build_projects/dotnet-cli-build.Tests/GivenActionAndRetryTimes.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using FluentAssertions; -using Microsoft.DotNet.Cli.Build.UploadToLinuxPackageRepository; -using Xunit; - -namespace dotnet_cli_build.Tests -{ - public class GivenActionAndRetryTimes - { - public static IEnumerable NoWaitTimer() - { - while (true) - { - yield return Task.CompletedTask; - } - } - - [Fact] - public void ExponentialRetryShouldProvideIntervalSequence() - { - ExponentialRetry.Intervals.First().Should().Be(TimeSpan.FromSeconds(5)); - ExponentialRetry.Intervals.Skip(1).First().Should().Be(TimeSpan.FromSeconds(10)); - ExponentialRetry.Intervals.Skip(2).First().Should().Be(TimeSpan.FromSeconds(20)); - ExponentialRetry.Intervals.Skip(3).First().Should().Be(TimeSpan.FromSeconds(40)); - ExponentialRetry.Intervals.Skip(4).First().Should().Be(TimeSpan.FromSeconds(80)); - } - - [Fact] - public void ExponentialShouldNotRetryAfterFirstSucceess() - { - var fakeAction = new FakeAction(0); - ExponentialRetry.ExecuteWithRetry( - fakeAction.Run, - s => s == "success", - 10, - NoWaitTimer).Wait(); - fakeAction.Count.Should().Be(0); - } - - [Fact] - public void ExponentialShouldRetryUntilSuccess() - { - var fakeAction = new FakeAction(5); - ExponentialRetry.ExecuteWithRetry( - fakeAction.Run, - s => s == "success", - 10, - NoWaitTimer).Wait(); - fakeAction.Count.Should().Be(5); - } - - [Fact] - public void ExponentialShouldThrowAfterMaximumAmountReached() - { - var fakeAction = new FakeAction(10); - Action a = () => ExponentialRetry.ExecuteWithRetry( - fakeAction.Run, - s => s == "success", - 5, - NoWaitTimer, - "testing retry").Wait(); - a.ShouldThrow() - .WithMessage("Retry failed for testing retry after 5 times with result: fail"); - } - } - - public class FakeAction - { - private readonly int _successAfter; - - public FakeAction(int successAfter) - { - _successAfter = successAfter; - } - - public int Count { get; private set; } - - public Task Run() - { - if (_successAfter == Count) - { - return Task.FromResult("success"); - } - - Count++; - return Task.FromResult("fail"); - } - } -} \ No newline at end of file diff --git a/build_projects/dotnet-cli-build.Tests/dotnet-cli-build.Tests.csproj b/build_projects/dotnet-cli-build.Tests/dotnet-cli-build.Tests.csproj deleted file mode 100644 index e28340dda..000000000 --- a/build_projects/dotnet-cli-build.Tests/dotnet-cli-build.Tests.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - - - $(CliTargetFramework) - 1.0.0 - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81 - false - - - - - - - - - - - - - - diff --git a/build_projects/dotnet-cli-build/CheckIfAllBuildsHavePublished.cs b/build_projects/dotnet-cli-build/CheckIfAllBuildsHavePublished.cs index 090a128be..a3d6b199c 100644 --- a/build_projects/dotnet-cli-build/CheckIfAllBuildsHavePublished.cs +++ b/build_projects/dotnet-cli-build/CheckIfAllBuildsHavePublished.cs @@ -54,11 +54,12 @@ namespace Microsoft.DotNet.Cli.Build { "win_x86", false }, { "win_x64", false }, { "osx_x64", false }, - { "debian_8_x64", false }, - { "rhel_7_x64", false }, - { "ubuntu_14_04_x64", false }, - { "ubuntu_16_04_x64", false }, - { "linux_x64", false } + { "linux_x64", false }, + { "rhel.6_x64", false }, + { "linux_musl_x64", false }, + { "all_linux_distros_native_installer", false }, + { "linux_arm", false }, + { "linux_arm64", false } }; if (!badges.ContainsKey(VersionBadgeMoniker)) @@ -72,7 +73,7 @@ namespace Microsoft.DotNet.Cli.Build string name = Path.GetFileName(file); foreach (string img in badges.Keys) { - if ((name.StartsWith($"{img}")) && (name.EndsWith(".svg"))) + if ((name.StartsWith($"{img}_")) && (name.EndsWith(".svg"))) { badges[img] = true; break; diff --git a/build_projects/dotnet-cli-build/Crossgen.cs b/build_projects/dotnet-cli-build/Crossgen.cs index 68129a065..48ebdebfa 100644 --- a/build_projects/dotnet-cli-build/Crossgen.cs +++ b/build_projects/dotnet-cli-build/Crossgen.cs @@ -3,7 +3,9 @@ // See the LICENSE file in the project root for more information. using System; +using System.Diagnostics; using System.IO; +using System.Runtime.InteropServices; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; @@ -22,12 +24,18 @@ namespace Microsoft.DotNet.Build.Tasks public string CrossgenPath { get; set; } + public bool CreateSymbols { get; set; } + + public string DiasymReaderPath { get; set; } + public bool ReadyToRun { get; set; } public ITaskItem[] PlatformAssemblyPaths { get; set; } private string TempOutputPath { get; set; } + private bool _secondInvocationToCreateSymbols; + protected override bool ValidateParameters() { base.ValidateParameters(); @@ -58,6 +66,12 @@ namespace Microsoft.DotNet.Build.Tasks File.Delete(TempOutputPath); } + if (toolResult && CreateSymbols) + { + _secondInvocationToCreateSymbols = true; + toolResult = base.Execute(); + } + return toolResult; } @@ -83,9 +97,30 @@ namespace Microsoft.DotNet.Build.Tasks protected override string GenerateCommandLineCommands() { + if (_secondInvocationToCreateSymbols) + { + return $"{GetReadyToRun()} {GetPlatformAssemblyPaths()} {GetDiasymReaderPath()} {GetCreateSymbols()}"; + } + return $"{GetReadyToRun()} {GetInPath()} {GetOutPath()} {GetPlatformAssemblyPaths()} {GetJitPath()}"; } + private string GetCreateSymbols() + { + var option = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "-createpdb" : "-createperfmap"; + return $"{option} \"{Path.GetDirectoryName(DestinationPath)}\" \"{DestinationPath}\""; + } + + private string GetDiasymReaderPath() + { + if (string.IsNullOrEmpty(DiasymReaderPath)) + { + return null; + } + + return $"-diasymreaderpath \"{DiasymReaderPath}\""; + } + private string GetReadyToRun() { if (ReadyToRun) diff --git a/build_projects/dotnet-cli-build/DotNetPack.cs b/build_projects/dotnet-cli-build/DotNetPack.cs index bf4bef93d..1d0c99674 100644 --- a/build_projects/dotnet-cli-build/DotNetPack.cs +++ b/build_projects/dotnet-cli-build/DotNetPack.cs @@ -12,7 +12,7 @@ namespace Microsoft.DotNet.Cli.Build protected override string Args { - get { return $"{base.Args} {GetProjectPath()} {GetConfiguration()} {GetNoBuild()} {GetOutput()} {GetVersionSuffix()} {GetRuntime()} {MsbuildArgs}"; } + get { return $"{base.Args} {GetProjectPath()} {GetConfiguration()} {GetNoBuild()} {GetOutput()} {GetVersionSuffix()} {GetRuntime()} {GetIncludeSymbols()} {MsbuildArgs}"; } } public string Configuration { get; set; } @@ -26,9 +26,11 @@ namespace Microsoft.DotNet.Cli.Build public string ProjectPath { get; set; } public string VersionSuffix { get; set; } - + public string Runtime { get; set; } + public bool IncludeSymbols { get; set; } + private string GetConfiguration() { if (!string.IsNullOrEmpty(Configuration)) @@ -48,7 +50,7 @@ namespace Microsoft.DotNet.Cli.Build return null; } - + private string GetOutput() { if (!string.IsNullOrEmpty(Output)) @@ -78,15 +80,26 @@ namespace Microsoft.DotNet.Cli.Build return null; } - + private string GetRuntime() { if (!string.IsNullOrEmpty(Runtime)) { - return $"/p:RuntimeIdentifier={Runtime}"; + return $"-property:RuntimeIdentifier={Runtime}"; } return null; } + + private string GetIncludeSymbols() + { + if (IncludeSymbols) + { + return $"--include-symbols"; + } + + return null; + } + } } diff --git a/build_projects/dotnet-cli-build/DotNetRestore.cs b/build_projects/dotnet-cli-build/DotNetRestore.cs index d7d984be3..8f6f20b03 100644 --- a/build_projects/dotnet-cli-build/DotNetRestore.cs +++ b/build_projects/dotnet-cli-build/DotNetRestore.cs @@ -71,7 +71,7 @@ namespace Microsoft.DotNet.Cli.Build { if (SkipInvalidConfigurations) { - return "/p:SkipInvalidConfigurations=true"; + return "-property:SkipInvalidConfigurations=true"; } return null; @@ -81,7 +81,7 @@ namespace Microsoft.DotNet.Cli.Build { if (!string.IsNullOrEmpty(Runtime)) { - return $"/p:RuntimeIdentifier={Runtime}"; + return $"-property:RuntimeIdentifier={Runtime}"; } return null; diff --git a/build_projects/dotnet-cli-build/EnsureFileExistsOnAzureBlobStorage.cs b/build_projects/dotnet-cli-build/EnsureFileExistsOnAzureBlobStorage.cs new file mode 100644 index 000000000..e795349ff --- /dev/null +++ b/build_projects/dotnet-cli-build/EnsureFileExistsOnAzureBlobStorage.cs @@ -0,0 +1,40 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using Microsoft.Build.Framework; +using Microsoft.WindowsAzure.Storage.Blob; +using System.Threading.Tasks; + +namespace Microsoft.DotNet.Build.CloudTestTasks +{ + public class EnsureFileExistsOnAzureBlobStorage : Microsoft.Build.Utilities.Task + { + [Required] + public string FileUrl{ get; set; } + + public override bool Execute() + { + if (!ExecuteAsync().GetAwaiter().GetResult()) + { + throw new FileDoesNotExistOnAzureBlobStorageException(FileUrl); + + } + return true; + } + + private Task ExecuteAsync() + { + var blobClient = new CloudBlockBlob(new Uri(FileUrl)); + return blobClient.ExistsAsync(); + } + + public class FileDoesNotExistOnAzureBlobStorageException : Exception + { + public FileDoesNotExistOnAzureBlobStorageException(string message) : base(message + " cannot be found on Azure Blob Storage") + { + } + } + } +} diff --git a/build_projects/dotnet-cli-build/MakeRelative.cs b/build_projects/dotnet-cli-build/MakeRelative.cs index e8f04b159..6361f341c 100644 --- a/build_projects/dotnet-cli-build/MakeRelative.cs +++ b/build_projects/dotnet-cli-build/MakeRelative.cs @@ -17,21 +17,12 @@ namespace Microsoft.DotNet.Cli.Build [Required] public string Path2 { get; set; } - public char SeparatorChar { get; set; } - [Output] public ITaskItem RelativePath { get; set; } public override bool Execute() { - if (SeparatorChar == default(char)) - { - SeparatorChar = Path.DirectorySeparatorChar; - } - - var relativePath = GetRelativePath(Path1, Path2, SeparatorChar); - - RelativePath = ToTaskItem(Path1, Path2, relativePath); + RelativePath = ToTaskItem(Path1, Path2, Path.GetRelativePath(Path1, Path2)); return true; } @@ -47,75 +38,5 @@ namespace Microsoft.DotNet.Cli.Build return framework; } - - private static string GetRelativePath(string path1, string path2, char separator = default(char)) - { - - StringComparison compare; - if (CurrentPlatform.IsWindows) - { - compare = StringComparison.OrdinalIgnoreCase; - // check if paths are on the same volume - if (!string.Equals(Path.GetPathRoot(path1), Path.GetPathRoot(path2))) - { - // on different volumes, "relative" path is just Path2 - return path2; - } - } - else - { - compare = StringComparison.Ordinal; - } - - var index = 0; - var path1Segments = path1.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); - var path2Segments = path2.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); - // if path1 does not end with / it is assumed the end is not a directory - // we will assume that is isn't a directory by ignoring the last split - var len1 = path1Segments.Length - 1; - var len2 = path2Segments.Length; - - // find largest common absolute path between both paths - var min = Math.Min(len1, len2); - while (min > index) - { - if (!string.Equals(path1Segments[index], path2Segments[index], compare)) - { - break; - } - // Handle scenarios where folder and file have same name (only if os supports same name for file and directory) - // e.g. /file/name /file/name/app - else if ((len1 == index && len2 > index + 1) || (len1 > index && len2 == index + 1)) - { - break; - } - ++index; - } - - var path = ""; - - // check if path2 ends with a non-directory separator and if path1 has the same non-directory at the end - if (len1 + 1 == len2 && !string.IsNullOrEmpty(path1Segments[index]) && - string.Equals(path1Segments[index], path2Segments[index], compare)) - { - return path; - } - - for (var i = index; len1 > i; ++i) - { - path += ".." + separator; - } - for (var i = index; len2 - 1 > i; ++i) - { - path += path2Segments[i] + separator; - } - // if path2 doesn't end with an empty string it means it ended with a non-directory name, so we add it back - if (!string.IsNullOrEmpty(path2Segments[len2 - 1])) - { - path += path2Segments[len2 - 1]; - } - - return path; - } } } diff --git a/build_projects/dotnet-cli-build/ReplaceFileContents.cs b/build_projects/dotnet-cli-build/ReplaceFileContents.cs index b0baf4179..130550aba 100644 --- a/build_projects/dotnet-cli-build/ReplaceFileContents.cs +++ b/build_projects/dotnet-cli-build/ReplaceFileContents.cs @@ -3,6 +3,7 @@ using System; using System.IO; +using System.Linq; using System.Text.RegularExpressions; using Microsoft.Build.Utilities; using Microsoft.Build.Framework; @@ -28,10 +29,10 @@ namespace Microsoft.DotNet.Cli.Build public class ReplaceFileContents : Task { [Required] - public string InputFile { get; set; } + public ITaskItem[] InputFiles { get; set; } [Required] - public string DestinationFile { get; set; } + public ITaskItem[] DestinationFiles { get; set; } public ITaskItem[] ReplacementItems { get; set; } @@ -55,19 +56,36 @@ namespace Microsoft.DotNet.Cli.Build throw new Exception($"Expected {nameof(ReplacementPatterns)} (length {ReplacementPatterns.Length}) and {nameof(ReplacementStrings)} (length {ReplacementStrings.Length}) to have the same length."); } - if (!File.Exists(InputFile)) + if (InputFiles.Length != DestinationFiles.Length) { - throw new FileNotFoundException($"Expected file {InputFile} was not found."); + throw new Exception($"Expected {nameof(InputFiles)} (length {InputFiles.Length}) and {nameof(DestinationFiles)} (length {DestinationFiles.Length}) to have the same length."); } - string inputFileText = File.ReadAllText(InputFile); - string outputFileText = ReplacePatterns(inputFileText); + var filesNotFound = InputFiles.Where(i => !File.Exists(i.ItemSpec)).Select(i => i.ItemSpec); + if (filesNotFound.Any()) + { + var filesNotFoundString = string.Join(",", filesNotFound); + throw new FileNotFoundException($"Expected files where not found: {filesNotFoundString}"); + } - WriteOutputFile(outputFileText); + Log.LogMessage(MessageImportance.High, $"ReplacingContents for `{InputFiles.Length}` files."); + + for (var i = 0; i < InputFiles.Length; i++) + { + ReplaceContents(InputFiles[i].ItemSpec, DestinationFiles[i].ItemSpec); + } return true; } + public void ReplaceContents(string inputFile, string destinationFile) + { + string inputFileText = File.ReadAllText(inputFile); + string outputFileText = ReplacePatterns(inputFileText); + + WriteOutputFile(destinationFile, outputFileText); + } + public string ReplacePatterns(string inputFileText) { var outText = inputFileText; @@ -92,15 +110,18 @@ namespace Microsoft.DotNet.Cli.Build return outText; } - public void WriteOutputFile(string outputFileText) + public void WriteOutputFile(string destinationFile, string outputFileText) { - var destinationDirectory = Path.GetDirectoryName(DestinationFile); + var destinationDirectory = Path.GetDirectoryName(destinationFile); + Log.LogMessage(MessageImportance.High, $"Destination Directory: {destinationDirectory}"); if (!Directory.Exists(destinationDirectory)) { + Log.LogMessage(MessageImportance.High, $"Destination Directory `{destinationDirectory}` does not exist. Creating..."); Directory.CreateDirectory(destinationDirectory); } - File.WriteAllText(DestinationFile, outputFileText); + Log.LogMessage(MessageImportance.High, $"Writing file: {destinationFile}"); + File.WriteAllText(destinationFile, outputFileText); } } } diff --git a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/AddPackageStrategy.cs b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/AddPackageStrategy.cs deleted file mode 100644 index cb2ec8101..000000000 --- a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/AddPackageStrategy.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Http; -using System.Text; -using System.Threading.Tasks; -using NuGet.Protocol; - -namespace Microsoft.DotNet.Cli.Build.UploadToLinuxPackageRepository -{ - internal class AddPackageStrategy : IAzurelinuxRepositoryServiceHttpStrategy - { - private readonly IdInRepositoryService _idInRepositoryService; - private readonly string _packageName; - private readonly string _packageVersion; - private readonly string _repositoryId; - - public AddPackageStrategy( - IdInRepositoryService idInRepositoryService, - string packageName, - string packageVersion, - string repositoryId) - { - _idInRepositoryService = idInRepositoryService - ?? throw new ArgumentNullException(nameof(idInRepositoryService)); - _packageName = packageName; - _packageVersion = packageVersion; - _repositoryId = repositoryId; - } - - public async Task Execute(HttpClient client, Uri baseAddress) - { - var debianUploadJsonContent = new Dictionary - { - ["name"] = _packageName, - ["version"] = AppendDebianRevisionNumber(_packageVersion), - ["fileId"] = _idInRepositoryService.Id, - ["repositoryId"] = _repositoryId - }.ToJson(); - var content = new StringContent(debianUploadJsonContent, - Encoding.UTF8, - "application/json"); - - using (var response = await client.PostAsync(new Uri(baseAddress, "/v1/packages"), content)) - { - if (!response.IsSuccessStatusCode) - throw new FailedToAddPackageToPackageRepositoryException( - $"request:{debianUploadJsonContent} response:{response.ToJson()}"); - return response.Headers.GetValues("Location").Single(); - } - } - - private static string AppendDebianRevisionNumber(string packageVersion) - { - return packageVersion + "-1"; - } - } -} diff --git a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/ExponentialRetry.cs b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/ExponentialRetry.cs deleted file mode 100644 index df3590940..000000000 --- a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/ExponentialRetry.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Microsoft.DotNet.Cli.Build.UploadToLinuxPackageRepository -{ - public static class ExponentialRetry - { - public static IEnumerable Intervals - { - get - { - var seconds = 5; - while (true) - { - yield return TimeSpan.FromSeconds(seconds); - seconds *= 2; - } - } - } - - public static async Task ExecuteWithRetry(Func> action, - Func isSuccess, - int maxRetryCount, - Func> timer, - string taskDescription = "") - { - var count = 0; - foreach (var t in timer()) - { - await t; - var result = await action(); - if (isSuccess(result)) - return; - count++; - if (count == maxRetryCount) - throw new RetryFailedException( - $"Retry failed for {taskDescription} after {count} times with result: {result}"); - } - throw new Exception("Timer should not be exhausted"); - } - - public static IEnumerable Timer(IEnumerable interval) - { - return interval.Select(Task.Delay); - } - } -} diff --git a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/FailedToAddPackageToPackageRepositoryException.cs b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/FailedToAddPackageToPackageRepositoryException.cs deleted file mode 100644 index 68c314c08..000000000 --- a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/FailedToAddPackageToPackageRepositoryException.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; - -namespace Microsoft.DotNet.Cli.Build.UploadToLinuxPackageRepository -{ - public class FailedToAddPackageToPackageRepositoryException : Exception - { - public FailedToAddPackageToPackageRepositoryException(string message) : base(message) - { - } - - public FailedToAddPackageToPackageRepositoryException() - { - } - - public FailedToAddPackageToPackageRepositoryException(string message, Exception innerException) : base(message, - innerException) - { - } - } -} diff --git a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/FileUploadStrategy.cs b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/FileUploadStrategy.cs deleted file mode 100644 index 59be2c16c..000000000 --- a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/FileUploadStrategy.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.IO; -using System.Net.Http; -using System.Threading.Tasks; -using NuGet.Protocol; - -namespace Microsoft.DotNet.Cli.Build.UploadToLinuxPackageRepository -{ - internal class FileUploadStrategy : IAzurelinuxRepositoryServiceHttpStrategy - { - private readonly string _pathToPackageToUpload; - - public FileUploadStrategy(string pathToPackageToUpload) - { - _pathToPackageToUpload = pathToPackageToUpload - ?? throw new ArgumentNullException(nameof(pathToPackageToUpload)); - } - - public async Task Execute(HttpClient client, Uri baseAddress) - { - var fileName = Path.GetFileName(_pathToPackageToUpload); - - using (var content = - new MultipartFormDataContent()) - { - var url = new Uri(baseAddress, "/v1/files"); - content.Add( - new StreamContent( - new MemoryStream( - File.ReadAllBytes(_pathToPackageToUpload))), - "file", - fileName); - using (var message = await client.PostAsync(url, content)) - { - if (!message.IsSuccessStatusCode) - { - throw new FailedToAddPackageToPackageRepositoryException( - $"{message.ToJson()} failed to post file to {url} file name:{fileName} pathToPackageToUpload:{_pathToPackageToUpload}"); - } - return await message.Content.ReadAsStringAsync(); - } - } - } - } -} diff --git a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/IAzurelinuxRepositoryServiceHttpStrategy.cs b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/IAzurelinuxRepositoryServiceHttpStrategy.cs deleted file mode 100644 index a829f398a..000000000 --- a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/IAzurelinuxRepositoryServiceHttpStrategy.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Net.Http; -using System.Threading.Tasks; - -namespace Microsoft.DotNet.Cli.Build.UploadToLinuxPackageRepository -{ - internal interface IAzurelinuxRepositoryServiceHttpStrategy - { - Task Execute(HttpClient client, Uri baseAddress); - } -} diff --git a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/IdInRepositoryService.cs b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/IdInRepositoryService.cs deleted file mode 100644 index b51ebb3be..000000000 --- a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/IdInRepositoryService.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; - -namespace Microsoft.DotNet.Cli.Build.UploadToLinuxPackageRepository -{ - internal class IdInRepositoryService - { - public IdInRepositoryService(string id) - { - Id = id ?? throw new ArgumentNullException(nameof(id)); - } - - public string Id { get; } - } -} diff --git a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/LinuxPackageRepositoryDestiny.cs b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/LinuxPackageRepositoryDestiny.cs deleted file mode 100644 index aa2e6d9bc..000000000 --- a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/LinuxPackageRepositoryDestiny.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; - -namespace Microsoft.DotNet.Cli.Build.UploadToLinuxPackageRepository -{ - internal class LinuxPackageRepositoryDestiny - { - private readonly string _password; - private readonly string _server; - private readonly string _username; - - public LinuxPackageRepositoryDestiny(string username, - string password, - string server, - string repositoryId) - { - _username = username ?? throw new ArgumentNullException(nameof(username)); - _password = password ?? throw new ArgumentNullException(nameof(password)); - _server = server ?? throw new ArgumentNullException(nameof(server)); - RepositoryId = repositoryId ?? throw new ArgumentNullException(nameof(repositoryId)); - } - - public string RepositoryId { get; } - - public Uri GetBaseAddress() - { - return new Uri($"https://{_server}"); - } - - public string GetSimpleAuth() - { - return $"{_username}:{_password}"; - } - } -} diff --git a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/LinuxPackageRepositoryHttpPrepare.cs b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/LinuxPackageRepositoryHttpPrepare.cs deleted file mode 100644 index 7e1f9ade7..000000000 --- a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/LinuxPackageRepositoryHttpPrepare.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Net.Http; -using System.Net.Http.Headers; -using System.Text; -using System.Threading.Tasks; - -namespace Microsoft.DotNet.Cli.Build.UploadToLinuxPackageRepository -{ - internal class LinuxPackageRepositoryHttpPrepare - { - private readonly IAzurelinuxRepositoryServiceHttpStrategy _httpStrategy; - private readonly LinuxPackageRepositoryDestiny _linuxPackageRepositoryDestiny; - - public LinuxPackageRepositoryHttpPrepare( - LinuxPackageRepositoryDestiny linuxPackageRepositoryDestiny, - IAzurelinuxRepositoryServiceHttpStrategy httpStrategy - ) - { - _linuxPackageRepositoryDestiny = linuxPackageRepositoryDestiny - ?? throw new ArgumentNullException(nameof(linuxPackageRepositoryDestiny)); - _httpStrategy = httpStrategy ?? throw new ArgumentNullException(nameof(httpStrategy)); - } - - public async Task RemoteCall() - { - using (var handler = new HttpClientHandler()) - { - using (var client = new HttpClient(handler)) - { - var authHeader = - Convert.ToBase64String(Encoding.UTF8.GetBytes((string) _linuxPackageRepositoryDestiny.GetSimpleAuth())); - client.DefaultRequestHeaders.Authorization = - new AuthenticationHeaderValue("Basic", authHeader); - client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); - client.Timeout = TimeSpan.FromMinutes(10); - - return await _httpStrategy.Execute(client, _linuxPackageRepositoryDestiny.GetBaseAddress()); - } - } - } - } -} diff --git a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/PullQueuedPackageStatus.cs b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/PullQueuedPackageStatus.cs deleted file mode 100644 index 393a160ae..000000000 --- a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/PullQueuedPackageStatus.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Net.Http; -using System.Threading.Tasks; -using Newtonsoft.Json.Linq; - -namespace Microsoft.DotNet.Cli.Build.UploadToLinuxPackageRepository -{ - internal class PullQueuedPackageStatus : IAzurelinuxRepositoryServiceHttpStrategy - { - private readonly QueueResourceLocation _queueResourceLocation; - - public PullQueuedPackageStatus(QueueResourceLocation queueResourceLocation) - { - _queueResourceLocation = queueResourceLocation - ?? throw new ArgumentNullException(nameof(queueResourceLocation)); - } - - public async Task Execute(HttpClient client, Uri baseAddress) - { - using (var response = await client.GetAsync(new Uri(baseAddress, _queueResourceLocation.Location))) - { - if (!response.IsSuccessStatusCode) - throw new FailedToAddPackageToPackageRepositoryException( - "Failed to make request to " + _queueResourceLocation.Location); - var body = await response.Content.ReadAsStringAsync(); - return !body.Contains("status") ? "" : JObject.Parse(body)["status"].ToString(); - } - } - } -} diff --git a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/QueueResourceLocation.cs b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/QueueResourceLocation.cs deleted file mode 100644 index cbf11e48d..000000000 --- a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/QueueResourceLocation.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; - -namespace Microsoft.DotNet.Cli.Build.UploadToLinuxPackageRepository -{ - internal class QueueResourceLocation - { - public QueueResourceLocation(string location) - { - Location = location ?? throw new ArgumentNullException(nameof(location)); - } - - public string Location { get; } - } -} diff --git a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/RetryFailedException.cs b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/RetryFailedException.cs deleted file mode 100644 index b251ec4b8..000000000 --- a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/RetryFailedException.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; - -namespace Microsoft.DotNet.Cli.Build.UploadToLinuxPackageRepository -{ - public class RetryFailedException : Exception - { - public RetryFailedException(string message) : base(message) - { - } - - public RetryFailedException() - { - } - - public RetryFailedException(string message, Exception innerException) : base(message, innerException) - { - } - } -} diff --git a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/UploadToLinuxPackageRepository.cs b/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/UploadToLinuxPackageRepository.cs deleted file mode 100644 index 00099bd14..000000000 --- a/build_projects/dotnet-cli-build/UploadToLinuxPackageRepository/UploadToLinuxPackageRepository.cs +++ /dev/null @@ -1,121 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Net.Http; -using System.Threading.Tasks; -using Microsoft.Build.Framework; -using Newtonsoft.Json.Linq; -using Task = Microsoft.Build.Utilities.Task; - -namespace Microsoft.DotNet.Cli.Build.UploadToLinuxPackageRepository -{ - public class UploadToLinuxPackageRepository : Task - { - /// - /// The Azure repository service user name. - /// - [Required] - public string Username { get; set; } - - /// - /// The Azure repository service Password. - /// - [Required] - public string Password { get; set; } - - /// - /// The Azure repository service URL ex: "tux-devrepo.corp.microsoft.com". - /// - [Required] - public string Server { get; set; } - - [Required] - public string RepositoryId { get; set; } - - [Required] - public string PathOfPackageToUpload { get; set; } - - [Required] - public string PackageNameInLinuxPackageRepository { get; set; } - - - [Required] - public string PackageVersionInLinuxPackageRepository { get; set; } - - - public override bool Execute() - { - ExecuteAsyncWithRetry().GetAwaiter().GetResult(); - return true; - } - - private async System.Threading.Tasks.Task ExecuteAsyncWithRetry() - { - await ExponentialRetry.ExecuteWithRetry( - UploadAndAddpackageAndEnsureItIsReady, - s => s == "", - maxRetryCount: 3, - timer: () => ExponentialRetry.Timer(ExponentialRetry.Intervals), - taskDescription: $"running {nameof(UploadAndAddpackageAndEnsureItIsReady)}"); - } - - private async Task UploadAndAddpackageAndEnsureItIsReady() - { - try - { - Log.LogMessage( - MessageImportance.High, - "Begin uploading Linux Package to feed service, RepositoryId {0}, Server {1}, Package to upload {2}.", - RepositoryId, - Server, - PathOfPackageToUpload); - - var linuxPackageRepositoryDestiny = - new LinuxPackageRepositoryDestiny(Username, Password, Server, RepositoryId); - var uploadResponse = await new LinuxPackageRepositoryHttpPrepare( - linuxPackageRepositoryDestiny, - new FileUploadStrategy(PathOfPackageToUpload)).RemoteCall(); - - var idInRepositoryService = new IdInRepositoryService(JObject.Parse(uploadResponse)["id"].ToString()); - - var addPackageResponse = await new LinuxPackageRepositoryHttpPrepare( - linuxPackageRepositoryDestiny, - new AddPackageStrategy( - idInRepositoryService, - PackageNameInLinuxPackageRepository, - PackageVersionInLinuxPackageRepository, - linuxPackageRepositoryDestiny.RepositoryId)).RemoteCall(); - - var queueResourceLocation = new QueueResourceLocation(addPackageResponse); - - Func> pullQueuedPackageStatus = new LinuxPackageRepositoryHttpPrepare( - linuxPackageRepositoryDestiny, - new PullQueuedPackageStatus(queueResourceLocation)).RemoteCall; - - await ExponentialRetry.ExecuteWithRetry( - pullQueuedPackageStatus, - s => s == "fileReady", - 5, - () => ExponentialRetry.Timer(ExponentialRetry.Intervals), - $"PullQueuedPackageStatus location: {queueResourceLocation.Location}"); - - Log.LogMessage( - MessageImportance.High, - "Upload to feed service is completed, queue resource location {0}", - queueResourceLocation.Location); - - return ""; - } - catch (FailedToAddPackageToPackageRepositoryException e) - { - return e.ToString(); - } - catch (HttpRequestException e) - { - return e.ToString(); - } - } - } -} diff --git a/build_projects/dotnet-cli-build/dotnet-cli-build.csproj b/build_projects/dotnet-cli-build/dotnet-cli-build.csproj index f76765aff..bd7badca8 100644 --- a/build_projects/dotnet-cli-build/dotnet-cli-build.csproj +++ b/build_projects/dotnet-cli-build/dotnet-cli-build.csproj @@ -14,13 +14,19 @@ - - + + + + + + - - + - + + + + diff --git a/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj b/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj index 252e89bb6..a08f44725 100644 --- a/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj +++ b/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj @@ -14,11 +14,11 @@ - + - + diff --git a/build_projects/update-dependencies/Config.cs b/build_projects/update-dependencies/Config.cs index 0bd5a0c6a..474d7a32a 100644 --- a/build_projects/update-dependencies/Config.cs +++ b/build_projects/update-dependencies/Config.cs @@ -5,6 +5,8 @@ using System; using System.IO; using System.Linq; using System.Xml.Linq; +using System.Collections; +using System.Collections.Generic; namespace Microsoft.DotNet.Scripts { @@ -20,7 +22,7 @@ namespace Microsoft.DotNet.Scripts /// /// The following Environment Variables can optionally be specified: /// - /// DOTNET_VERSION_URL - The Url to the root of the version information (this is combined with the fragments bellow) (ex. "https://raw.githubusercontent.com/dotnet/versions/master/build-info") + /// DOTNET_VERSION_URL - The Url to the root of the version information (this is combined with the fragments below) (ex. "https://raw.githubusercontent.com/dotnet/versions/master/build-info") /// ROSLYN_VERSION_FRAGMENT - The fragment to combine with DOTNET_VERSION_URL to get the current dotnet/roslyn package versions. (ex. "dotnet/roslyn/netcore1.0") /// CORESETUP_VERSION_FRAGMENT - The fragment to combine with DOTNET_VERSION_URL to get the current dotnet/core-setup package versions. (ex. "dotnet/core-setup/master") /// GITHUB_ORIGIN_OWNER - The owner of the GitHub fork to push the commit and create the PR from. (ex. "dotnet-bot") @@ -38,13 +40,17 @@ namespace Microsoft.DotNet.Scripts private Lazy _password = new Lazy(() => GetEnvironmentVariable("GITHUB_PASSWORD")); private Lazy _dotNetVersionUrl = new Lazy(() => GetEnvironmentVariable("DOTNET_VERSION_URL", "https://raw.githubusercontent.com/dotnet/versions/master/build-info")); - private Lazy _coreSetupVersionFragment = new Lazy(() => GetEnvironmentVariable("CORESETUP_VERSION_FRAGMENT", GetDefaultCoreSetupVersionFragment())); + private Lazy _gitHubUpstreamOwner = new Lazy(() => GetEnvironmentVariable("GITHUB_UPSTREAM_OWNER", "dotnet")); private Lazy _gitHubProject = new Lazy(() => GetEnvironmentVariable("GITHUB_PROJECT", "cli")); private Lazy _gitHubUpstreamBranch = new Lazy(() => GetEnvironmentVariable("GITHUB_UPSTREAM_BRANCH", GetDefaultUpstreamBranch())); private Lazy _gitHubPullRequestNotifications = new Lazy(() => GetEnvironmentVariable("GITHUB_PULL_REQUEST_NOTIFICATIONS", "") .Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries)); + + Lazy> _versionFragments = new Lazy>(() => + System.Environment.GetEnvironmentVariables().Cast().Where(entry => ((string)entry.Key).EndsWith("_VERSION_FRAGMENT")).ToDictionary(entry => + ((string)entry.Key).Replace("_VERSION_FRAGMENT","").ToLowerInvariant(), entry => (string)entry.Value, StringComparer.OrdinalIgnoreCase)); private Config() { } @@ -53,7 +59,8 @@ namespace Microsoft.DotNet.Scripts public string Email => _email.Value; public string Password => _password.Value; public string DotNetVersionUrl => _dotNetVersionUrl.Value; - public string CoreSetupVersionFragment => _coreSetupVersionFragment.Value; + public Dictionary VersionFragments => _versionFragments.Value; + public bool HasVersionFragment(string repoName) => _versionFragments.Value.ContainsKey(repoName); public string GitHubUpstreamOwner => _gitHubUpstreamOwner.Value; public string GitHubProject => _gitHubProject.Value; public string GitHubUpstreamBranch => _gitHubUpstreamBranch.Value; diff --git a/build_projects/update-dependencies/Program.cs b/build_projects/update-dependencies/Program.cs index e256564d6..47c787fc6 100644 --- a/build_projects/update-dependencies/Program.cs +++ b/build_projects/update-dependencies/Program.cs @@ -4,6 +4,7 @@ using Microsoft.DotNet.VersionTools; using Microsoft.DotNet.VersionTools.Automation; using Microsoft.DotNet.VersionTools.Dependencies; +using Microsoft.DotNet.VersionTools.Dependencies.BuildOutput; using System; using System.Collections.Generic; using System.Diagnostics; @@ -23,13 +24,11 @@ namespace Microsoft.DotNet.Scripts bool onlyUpdate = args.Length > 0 && string.Equals("--Update", args[0], StringComparison.OrdinalIgnoreCase); - List buildInfos = new List(); - - buildInfos.Add(GetBuildInfo("CoreSetup", s_config.CoreSetupVersionFragment, fetchLatestReleaseFile: false)); - + List buildInfos = new List(s_config.VersionFragments.Select, BuildInfo>(fragment => + GetBuildInfo(fragment.Key, fragment.Value, fetchLatestReleaseFile: false))); IEnumerable updaters = GetUpdaters(); var dependencyBuildInfos = buildInfos.Select(buildInfo => - new DependencyBuildInfo( + new BuildDependencyInfo( buildInfo, upgradeStableVersions: true, disabledPackages: Enumerable.Empty())); @@ -50,11 +49,14 @@ namespace Microsoft.DotNet.Scripts body += PullRequestCreator.NotificationString(s_config.GitHubPullRequestNotifications); } - new PullRequestCreator(gitHubAuth, origin, upstreamBranch) + new PullRequestCreator(gitHubAuth) .CreateOrUpdateAsync( suggestedMessage, suggestedMessage + $" ({upstreamBranch.Name})", - body) + body, + upstreamBranch, + origin, + new PullRequestOptions()) .Wait(); } } @@ -81,9 +83,55 @@ namespace Microsoft.DotNet.Scripts private static IEnumerable GetUpdaters() { string dependencyVersionsPath = Path.Combine("build", "DependencyVersions.props"); - yield return CreateRegexUpdater(dependencyVersionsPath, "CLI_SharedFrameworkVersion", "Microsoft.NETCore.App"); - yield return CreateRegexUpdater(dependencyVersionsPath, "PlatformAbstractionsVersion", "Microsoft.DotNet.PlatformAbstractions"); - yield return CreateRegexUpdater(dependencyVersionsPath, "DependencyModelVersion", "Microsoft.Extensions.DependencyModel"); + + if (s_config.HasVersionFragment("aspnet")) + { + yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftAspNetCoreAppPackageVersion", "Microsoft.AspNetCore.App"); + } + if (s_config.HasVersionFragment("clicommandlineparser")) + { + yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftDotNetCliCommandLinePackageVersion", "Microsoft.DotNet.Cli.CommandLine"); + } + if (s_config.HasVersionFragment("climigrate")) + { + yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftDotNetProjectJsonMigrationPackageVersion", "Microsoft.DotNet.ProjectJsonMigration"); + } + if (s_config.HasVersionFragment("coresetup")) + { + yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftNETCoreAppPackageVersion", "Microsoft.NETCore.App"); + yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftDotNetPlatformAbstractionsPackageVersion", "Microsoft.DotNet.PlatformAbstractions"); + yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftExtensionsDependencyModelPackageVersion", "Microsoft.Extensions.DependencyModel"); + } + if (s_config.HasVersionFragment("fsharp")) + { + yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftFSharpCompilerPackageVersion", "Microsoft.FSharp.Compiler"); + } + if (s_config.HasVersionFragment("msbuild")) + { + yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftBuildPackageVersion", "Microsoft.Build"); + } + if (s_config.HasVersionFragment("nugetclient")) + { + yield return CreateRegexUpdater(dependencyVersionsPath, "NuGetBuildTasksPackageVersion", "NuGet.Build.Tasks"); + } + if (s_config.HasVersionFragment("roslyn")) + { + yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftCodeAnalysisCSharpPackageVersion", "Microsoft.CodeAnalysis.CSharp"); + } + if (s_config.HasVersionFragment("sdk")) + { + yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftNETSdkPackageVersion", "Microsoft.NET.Sdk"); + } + if (s_config.HasVersionFragment("templating")) + { + yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftDotNetCommonItemTemplatesPackageVersion", "Microsoft.DotNet.Common.ItemTemplates"); + yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftDotNetTestProjectTemplates20PackageVersion", "Microsoft.DotNet.Test.ProjectTemplates.2.0"); + yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftTemplateEngineCliPackageVersion", "Microsoft.TemplateEngine.Cli"); + } + if (s_config.HasVersionFragment("websdk")) + { + yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftNETSdkWebPackageVersion", "Microsoft.NET.Sdk.Web"); + } } private static IDependencyUpdater CreateRegexUpdater(string repoRelativePath, string propertyName, string packageId) diff --git a/build_projects/update-dependencies/update-dependencies.csproj b/build_projects/update-dependencies/update-dependencies.csproj index 2f82553fe..0ccc4f51f 100644 --- a/build_projects/update-dependencies/update-dependencies.csproj +++ b/build_projects/update-dependencies/update-dependencies.csproj @@ -4,7 +4,11 @@ Updates the repos dependencies Exe - netcoreapp2.0 + netcoreapp2.1 + + https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json; + https://api.nuget.org/v3/index.json; + diff --git a/build_projects/update-dependencies/update-dependencies.sh b/build_projects/update-dependencies/update-dependencies.sh index ff95d79a6..70a9105cb 100755 --- a/build_projects/update-dependencies/update-dependencies.sh +++ b/build_projects/update-dependencies/update-dependencies.sh @@ -32,9 +32,6 @@ fi export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 -if [ ! -d "$DOTNET_INSTALL_DIR" ]; then - mkdir -p $DOTNET_INSTALL_DIR -fi # Install a stage 0 echo "Installing .NET Core CLI Stage 0" diff --git a/netci.groovy b/netci.groovy index ca09235d7..c2283cd23 100644 --- a/netci.groovy +++ b/netci.groovy @@ -3,23 +3,42 @@ // Import the utility functionality. +import jobs.generation.ArchivalSettings; import jobs.generation.Utilities; def project = GithubProject def branch = GithubBranchName def isPR = true -def platformList = ['Linux:x64:Release', 'Debian8.2:x64:Debug', 'Ubuntu:x64:Release', 'Ubuntu16.04:x64:Debug', 'OSX10.12:x64:Release', 'Windows_NT:x64:Release', 'Windows_NT:x86:Debug', 'RHEL7.2:x64:Release', 'CentOS7.1:x64:Debug'] +def platformList = [ + 'CentOS7.1:x64:Debug', + 'Debian8.2:x64:Debug', + 'fedora.27:x64:Debug', + 'Linux:arm:Debug', + 'Linux:arm64:Debug', + 'Linux-musl:x64:Debug', + 'Linux:x64:Release', + 'opensuse.43.2:x64:Debug', + 'OSX10.12:x64:Release', + 'RHEL6:x64:Debug', + 'RHEL7.2:x64:Release', + 'Ubuntu:x64:Release', + 'Ubuntu16.04:x64:Debug', + 'ubuntu.18.04:x64:Debug', + 'Windows_NT:x64:Release', + 'Windows_NT:x86:Debug', + 'Windows_NT_ES:x64:Debug' +] def static getBuildJobName(def configuration, def os, def architecture) { return configuration.toLowerCase() + '_' + os.toLowerCase() + '_' + architecture.toLowerCase() } - platformList.each { platform -> // Calculate names def (os, architecture, configuration) = platform.tokenize(':') def osUsedForMachineAffinity = os; + def osVersionUsedForMachineAffinity = 'latest-or-auto'; // Calculate job name def jobName = getBuildJobName(configuration, os, architecture) @@ -32,12 +51,37 @@ platformList.each { platform -> else if (os == 'Windows_2016') { buildCommand = ".\\build.cmd -Configuration ${configuration} -Architecture ${architecture} -RunInstallerTestsInDocker -Targets Default" } + else if (os == 'Windows_NT_ES') { + osUsedForMachineAffinity = 'Windows_NT' + buildCommand = """ +set DOTNET_CLI_UI_LANGUAGE=es +.\\build.cmd -Configuration ${configuration} -Architecture ${architecture} -Targets Default +""" + } else if (os == 'Ubuntu') { buildCommand = "./build.sh --skip-prereqs --configuration ${configuration} --docker ubuntu.14.04 --targets Default" } else if (os == 'Linux') { osUsedForMachineAffinity = 'Ubuntu16.04'; - buildCommand = "./build.sh --linux-portable --skip-prereqs --configuration ${configuration} --targets Default" + if ((architecture == 'arm') || (architecture == 'arm64')) { + buildCommand = "./build.sh --linux-portable --skip-prereqs --architecture ${architecture} --configuration ${configuration} --targets Default /p:CLIBUILD_SKIP_TESTS=true" + } + else { + buildCommand = "./build.sh --linux-portable --skip-prereqs --configuration ${configuration} --targets Default" + } + } + else if (os == 'RHEL6') { + osUsedForMachineAffinity = 'Ubuntu16.04'; + buildCommand = "./build.sh --skip-prereqs --configuration ${configuration} --runtime-id rhel.6-x64 --docker rhel.6 --targets Default" + } + else if (os == 'Linux-musl') { + osUsedForMachineAffinity = 'Ubuntu16.04'; + buildCommand = "./build.sh --skip-prereqs --configuration ${configuration} --runtime-id linux-musl-x64 --docker alpine.3.6 --targets Default" + } + else if (os == 'ubuntu.18.04' || os == 'fedora.27' || os == 'opensuse.43.2') { + osUsedForMachineAffinity = 'Ubuntu16.04' + osVersionUsedForMachineAffinity = 'latest-docker' + buildCommand = "./build.sh --linux-portable --skip-prereqs --configuration ${configuration} --docker ${os} --targets Default" } else { // Jenkins non-Ubuntu CI machines don't have docker @@ -47,7 +91,7 @@ platformList.each { platform -> def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) { // Set the label. steps { - if (os == 'Windows_NT' || os == 'Windows_2016') { + if (osUsedForMachineAffinity == 'Windows_NT' || osUsedForMachineAffinity == 'Windows_2016') { // Batch batchFile(buildCommand) } @@ -58,10 +102,19 @@ platformList.each { platform -> } } - Utilities.setMachineAffinity(newJob, osUsedForMachineAffinity, 'latest-or-auto') + Utilities.setMachineAffinity(newJob, osUsedForMachineAffinity, osVersionUsedForMachineAffinity) Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}") - Utilities.addMSTestResults(newJob, '**/*.trx') + // ARM CI runs are build only. + if ((architecture != 'arm') && (architecture != 'arm64')) { + Utilities.addMSTestResults(newJob, '**/*.trx') + } Utilities.addGithubPRTriggerForBranch(newJob, branch, "${os} ${architecture} ${configuration} Build") + + def archiveSettings = new ArchivalSettings() + archiveSettings.addFiles("test/**/*.trx") + archiveSettings.setFailIfNothingArchived() + archiveSettings.setArchiveOnFailure() + Utilities.addArchival(newJob, archiveSettings) } // Make the call to generate the help job diff --git a/packaging/deb/dotnet-debian_config.json b/packaging/deb/dotnet-debian_config.json index 4d813f3fd..e6f046507 100644 --- a/packaging/deb/dotnet-debian_config.json +++ b/packaging/deb/dotnet-debian_config.json @@ -29,7 +29,7 @@ }, "debian_dependencies":{ - "%SHARED_FRAMEWORK_DEBIAN_PACKAGE_NAME%" : {}%SHARED_FRAMEWORK_DEBIAN_PACKAGE_ADDITIONAL_DEPENDENCY%, - "%ASPNETCOREPACKAGESTORE_DEBIAN_PACKAGE_NAME%": {} + "%SHARED_FRAMEWORK_DEBIAN_PACKAGE_NAME%" : { "package_version": "%SHARED_FRAMEWORK_DEBIAN_PACKAGE_VERSIONS%" }%SHARED_FRAMEWORK_DEBIAN_PACKAGE_ADDITIONAL_DEPENDENCY%, + "%ASPNETCORE_SHAREDFX_DEBIAN_PACKAGE_NAME%": { "package_version": "%ASPNETCORE_SHAREDFX_DEBIAN_PACKAGE_VERSION%" } } } diff --git a/packaging/deb/postinst b/packaging/deb/postinst index 9eb33f532..4ac4d35e4 100755 --- a/packaging/deb/postinst +++ b/packaging/deb/postinst @@ -5,19 +5,18 @@ echo "Please visit http://aka.ms/dotnet-cli-eula for more information." # Run 'dotnet new' to trigger the first time experience to initialize the cache echo "Welcome to .NET Core! --------------------- -Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs. +Learn more about .NET Core: https://aka.ms/dotnet-docs +Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli-docs -.NET Core Tools Telemetry +Telemetry +--------- +The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous and doesn't include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell. + +Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry + +Configuring... -------------- -The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them. - -The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License. - -The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at https://aka.ms/dotnet-cli-telemetry. - -Installation Note --------------- -A command will be run during the install process that will improve project restore speed and enable offline access. It will take up to a minute to complete." +A command is running to populate your local package cache to improve restore speed and enable offline access. This command takes up to one minute to complete and only runs once." first_run() { /usr/share/dotnet/dotnet exec /usr/share/dotnet/sdk/%SDK_VERSION%/dotnet.dll internal-reportinstallsuccess "debianpackage" > /dev/null 2>&1 || true diff --git a/packaging/osx/clisdk/resources/cs.lproj/conclusion.html b/packaging/osx/clisdk/resources/cs.lproj/conclusion.html index a4b936329..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/cs.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/cs.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.0.0
  • -
  • .NET Core Runtime 2.0.0
  • -
  • Runtime Package Store
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/packaging/osx/clisdk/resources/de.lproj/conclusion.html b/packaging/osx/clisdk/resources/de.lproj/conclusion.html index a4b936329..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/de.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/de.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.0.0
  • -
  • .NET Core Runtime 2.0.0
  • -
  • Runtime Package Store
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/packaging/osx/clisdk/resources/en.lproj/conclusion.html b/packaging/osx/clisdk/resources/en.lproj/conclusion.html index a4b936329..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/en.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/en.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.0.0
  • -
  • .NET Core Runtime 2.0.0
  • -
  • Runtime Package Store
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/packaging/osx/clisdk/resources/es.lproj/conclusion.html b/packaging/osx/clisdk/resources/es.lproj/conclusion.html index a4b936329..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/es.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/es.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.0.0
  • -
  • .NET Core Runtime 2.0.0
  • -
  • Runtime Package Store
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/packaging/osx/clisdk/resources/fr.lproj/conclusion.html b/packaging/osx/clisdk/resources/fr.lproj/conclusion.html index a4b936329..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/fr.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/fr.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.0.0
  • -
  • .NET Core Runtime 2.0.0
  • -
  • Runtime Package Store
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/packaging/osx/clisdk/resources/it.lproj/conclusion.html b/packaging/osx/clisdk/resources/it.lproj/conclusion.html index a4b936329..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/it.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/it.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.0.0
  • -
  • .NET Core Runtime 2.0.0
  • -
  • Runtime Package Store
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/packaging/osx/clisdk/resources/ja.lproj/conclusion.html b/packaging/osx/clisdk/resources/ja.lproj/conclusion.html index a4b936329..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/ja.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/ja.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.0.0
  • -
  • .NET Core Runtime 2.0.0
  • -
  • Runtime Package Store
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/packaging/osx/clisdk/resources/ko.lproj/conclusion.html b/packaging/osx/clisdk/resources/ko.lproj/conclusion.html index a4b936329..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/ko.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/ko.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.0.0
  • -
  • .NET Core Runtime 2.0.0
  • -
  • Runtime Package Store
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/packaging/osx/clisdk/resources/pl.lproj/conclusion.html b/packaging/osx/clisdk/resources/pl.lproj/conclusion.html index a4b936329..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/pl.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/pl.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.0.0
  • -
  • .NET Core Runtime 2.0.0
  • -
  • Runtime Package Store
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/packaging/osx/clisdk/resources/pt-br.lproj/conclusion.html b/packaging/osx/clisdk/resources/pt-br.lproj/conclusion.html index a4b936329..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/pt-br.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/pt-br.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.0.0
  • -
  • .NET Core Runtime 2.0.0
  • -
  • Runtime Package Store
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/packaging/osx/clisdk/resources/ru.lproj/conclusion.html b/packaging/osx/clisdk/resources/ru.lproj/conclusion.html index a4b936329..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/ru.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/ru.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.0.0
  • -
  • .NET Core Runtime 2.0.0
  • -
  • Runtime Package Store
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/packaging/osx/clisdk/resources/tr.lproj/conclusion.html b/packaging/osx/clisdk/resources/tr.lproj/conclusion.html index a4b936329..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/tr.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/tr.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.0.0
  • -
  • .NET Core Runtime 2.0.0
  • -
  • Runtime Package Store
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/packaging/osx/clisdk/resources/zh-hans.lproj/conclusion.html b/packaging/osx/clisdk/resources/zh-hans.lproj/conclusion.html index a4b936329..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/zh-hans.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/zh-hans.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.0.0
  • -
  • .NET Core Runtime 2.0.0
  • -
  • Runtime Package Store
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/packaging/osx/clisdk/resources/zh-hant.lproj/conclusion.html b/packaging/osx/clisdk/resources/zh-hant.lproj/conclusion.html index a4b936329..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/zh-hant.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/zh-hant.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.0.0
  • -
  • .NET Core Runtime 2.0.0
  • -
  • Runtime Package Store
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/packaging/osx/clisdk/scripts/postinstall b/packaging/osx/clisdk/scripts/postinstall index 8211444d2..28339be99 100755 --- a/packaging/osx/clisdk/scripts/postinstall +++ b/packaging/osx/clisdk/scripts/postinstall @@ -8,9 +8,6 @@ PACKAGE=$1 INSTALL_DESTINATION=$2 INSTALL_TEMP_HOME=/tmp/dotnet-installer -# A temporary fix for the permissions issue(s) -chmod -R 755 $INSTALL_DESTINATION - first_run() { $INSTALL_DESTINATION/dotnet exec $INSTALL_DESTINATION/sdk/%SDK_VERSION%/dotnet.dll internal-reportinstallsuccess "$1" > /dev/null 2>&1 || true } diff --git a/packaging/rpm/dotnet-config.json b/packaging/rpm/dotnet-config.json index 38f533bcb..d4d7a48c0 100644 --- a/packaging/rpm/dotnet-config.json +++ b/packaging/rpm/dotnet-config.json @@ -27,8 +27,8 @@ "package_version": "%SHARED_HOST_RPM_VERSION%" }, { - "package_name": "%ASPNETCOREPACKAGESTORE_RPM_PACKAGE_NAME%", - "package_version": "%ASPNETCOREPACKAGESTORE_RPM_PACKAGE_VERSION%" + "package_name": "%ASPNETCORE_SHAREDFX_RPM_PACKAGE_NAME%", + "package_version": "%ASPNETCORE_SHAREDFX_RPM_PACKAGE_VERSION%" } ], "directories": [ diff --git a/packaging/rpm/scripts/after_install_host.sh b/packaging/rpm/scripts/after_install_host.sh index 7bc9596c7..21999daaf 100644 --- a/packaging/rpm/scripts/after_install_host.sh +++ b/packaging/rpm/scripts/after_install_host.sh @@ -9,19 +9,18 @@ echo "Please visit http://aka.ms/dotnet-cli-eula for more information." # Run 'dotnet new' as the user to trigger the first time experience to initialize the cache echo "Welcome to .NET Core! --------------------- -Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs. +Learn more about .NET Core: https://aka.ms/dotnet-docs +Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli-docs -.NET Core Tools Telemetry +Telemetry +--------- +The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous and doesn't include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell. + +Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry + +Configuring... -------------- -The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them. - -The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License. - -The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at https://aka.ms/dotnet-cli-telemetry. - -Installation Note --------------- -A command will be run during the install process that will improve project restore speed and enable offline access. It will take up to a minute to complete." +A command is running to populate your local package cache to improve restore speed and enable offline access. This command takes up to one minute to complete and only runs once." first_run() { /usr/share/dotnet/dotnet exec /usr/share/dotnet/sdk/%SDK_VERSION%/dotnet.dll internal-reportinstallsuccess "rpmpackage" > /dev/null 2>&1 || true diff --git a/packaging/windows/clisdk/bundle.thm b/packaging/windows/clisdk/bundle.thm index a9c3d64d3..797d2cab1 100644 --- a/packaging/windows/clisdk/bundle.thm +++ b/packaging/windows/clisdk/bundle.thm @@ -24,14 +24,15 @@ #(loc.WelcomeHeaderMessage) - #(loc.WelcomeDescription) - #(loc.LearnMoreTitle) - #(loc.CoreDocumentationLink) - #(loc.SDKDocumentation) - #(loc.PrivacyStatementLink) - #(loc.MITLicenseLink) - #(loc.InstallationNoteTitle) - #(loc.InstallationNote) + #(loc.WelcomeDescription) + #(loc.LearnMoreTitle) + #(loc.CoreDocumentationLink) + #(loc.SDKDocumentation) + #(loc.PrivacyStatementLink) + #(loc.MITLicenseLink) + #(loc.InstallationNoteTitle) + #(loc.InstallationNote) + #(loc.VisualStudioWarning) diff --git a/packaging/windows/clisdk/bundle.wxl b/packaging/windows/clisdk/bundle.wxl index a5b12953c..18fc7750c 100644 --- a/packaging/windows/clisdk/bundle.wxl +++ b/packaging/windows/clisdk/bundle.wxl @@ -50,9 +50,9 @@ The installation was successful The following were installed at [DOTNETHOME] - • .NET Core SDK 2.0.0 - • .NET Core Runtime 2.0.0 - • Runtime Package Store + • .NET Core SDK [DOTNETSDKVERSION] + • .NET Core Runtime [DOTNETRUNTIMEVERSION] + • ASP.NET Core Runtime [ASPNETCOREVERSION] This product collects usage data • More information and opt-out https://aka.ms/dotnet-cli-telemetry @@ -74,4 +74,6 @@ Resources Installation note A command will be run during the install process that will improve project restore speed and enable offline access. It will take up to a minute to complete. + If you plan to use .NET Core 2.1 with Visual Studio, Visual Studio 2017 15.7 or newer is recommended. <A HREF="https://go.microsoft.com/fwlink/?linkid=866799">Learn More</A>. + diff --git a/packaging/windows/clisdk/bundle.wxs b/packaging/windows/clisdk/bundle.wxs index 4f379ca3e..aeae3aad9 100644 --- a/packaging/windows/clisdk/bundle.wxs +++ b/packaging/windows/clisdk/bundle.wxs @@ -24,6 +24,9 @@ + + + @@ -40,9 +43,9 @@ - + - + diff --git a/packaging/windows/clisdk/generatebundle.ps1 b/packaging/windows/clisdk/generatebundle.ps1 index 8b53d9591..a2b166baf 100644 --- a/packaging/windows/clisdk/generatebundle.ps1 +++ b/packaging/windows/clisdk/generatebundle.ps1 @@ -14,7 +14,9 @@ param( [Parameter(Mandatory=$true)][string]$DotnetCLIDisplayVersion, [Parameter(Mandatory=$true)][string]$DotnetCLINugetVersion, [Parameter(Mandatory=$true)][string]$UpgradeCode, - [Parameter(Mandatory=$true)][string]$Architecture + [Parameter(Mandatory=$true)][string]$Architecture, + [Parameter(Mandatory=$true)][string]$DotNetRuntimeVersion, + [Parameter(Mandatory=$true)][string]$AspNetCoreVersion ) . "$PSScriptRoot\..\..\..\scripts\common\_common.ps1" @@ -43,6 +45,8 @@ function RunCandleForBundle -dAdditionalSharedFXMsiSourcePath="$AdditionalSharedFxMSIFile" ` -dAdditionalHostFXRMsiSourcePath="$AdditionalHostFxrMSIFile" ` -dAdditionalSharedHostMsiSourcePath="$AdditionalSharedHostMSIFile" ` + -dDotNetRuntimeVersion="$DotNetRuntimeVersion" ` + -dAspNetCoreVersion="$AspNetCoreVersion" ` -arch "$Architecture" ` -ext WixBalExtension.dll ` -ext WixUtilExtension.dll ` diff --git a/packaging/windows/clisdk/generatenupkg.ps1 b/packaging/windows/clisdk/generatenupkg.ps1 index ca91f2e3a..f2df9810d 100644 --- a/packaging/windows/clisdk/generatenupkg.ps1 +++ b/packaging/windows/clisdk/generatenupkg.ps1 @@ -26,7 +26,7 @@ function DownloadNugetExe if (-not (Test-Path $NuGetExe)) { Write-Output 'Downloading nuget.exe to ' + $NuGetExe - wget https://dist.nuget.org/win-x86-commandline/v3.5.0-rc1/NuGet.exe -OutFile $NuGetExe + wget https://dist.nuget.org/win-x86-commandline/v4.7.0/nuget.exe -OutFile $NuGetExe } } diff --git a/packaging/windows/eula.rtf b/packaging/windows/eula.rtf new file mode 100644 index 000000000..7f40e11a8 --- /dev/null +++ b/packaging/windows/eula.rtf @@ -0,0 +1,97 @@ +{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1033\deflangfe1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 Tahoma;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\froman\fprq2\fcharset0 Times New Roman;}{\f3\fswiss\fprq2\fcharset0 Calibri;}} +{\colortbl ;\red0\green0\blue0;\red0\green0\blue255;} +{\*\generator Riched20 10.0.10586}{\*\mmathPr\mnaryLim0\mdispDef1\mwrapIndent1440 }\viewkind4\uc1 +\pard\widctlpar\sb120\sa120\cf1\b\f0\fs24 MICROSOFT SOFTWARE LICENSE TERMS\fs28\par +\fs24 MICROSOFT .NET LIBRARY\fs28\par +\fs19 These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. The terms also apply to any Microsoft\par + +\pard\widctlpar\fi-363\li720\sb120\sa120\b0\f1\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 updates,\par +\f1\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 supplements,\par +\f1\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 Internet-based services, and\par +\f1\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 support services\par + +\pard\widctlpar\sb120\sa120\b for this software, unless other terms accompany those items. If so, those terms apply.\par +BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE.\par +IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE PERPETUAL RIGHTS BELOW.\par + +\pard\widctlpar\fi-357\li357\sb120\sa120\kerning36\fs20 1.\b0\f2\fs14\~\~\~\~\b\f0\fs19 INSTALLATION AND USE RIGHTS.\par + +\pard\widctlpar\fi-363\li720\sb120\sa120\kerning0\fs20 a.\b0\f2\fs14\~\~\~\~\b\f0\fs19 Installation and Use.\b0\fs20\~You may install and use any number of copies of the software to design, develop and test your programs.\b\fs19\par +\fs20 b.\b0\f2\fs14\~\~\~\~\b\f0\fs19 Third Party Programs.\b0\fs20\~The software may include third party programs that Microsoft, not the third party, licenses to you under this agreement. Notices, if any, for the third party program are included for your information only.\b\fs19\par + +\pard\widctlpar\fi-357\li357\sb120\sa120\kerning36\fs20 2.\b0\f2\fs14\~\~\~\~\b\f0\fs19 DATA.\~\kerning0\b0\fs20 The software may collect information about you and your use of the software, and send that to Microsoft. Microsoft may use this information to improve our products and services.\~You can learn more about data collection and use in the help documentation and the privacy statement at\~{\cf0\f3\fs24{\field{\*\fldinst{HYPERLINK "http://go.microsoft.com/fwlink/?LinkId=528096&clcid=0x409"}}{\fldrslt{\ul\cf2\cf2\ul\f0\fs20 http://go.microsoft.com/fwlink/?LinkId=528096}}}}\f0\fs20 . Your use of the software operates as your consent to these practices.\kerning36\b\fs19\par +\fs20 3.\b0\f2\fs14\~\~\~\~\b\f0\fs20 ADDITIONAL LICENSING REQUIREMENTS AND/OR USE RIGHTS.\fs19\par + +\pard\widctlpar\fi-363\li720\sb120\sa120\kerning0\fs20 a.\b0\f2\fs14\~\~\~\~\b\f0\fs20 DISTRIBUTABLE CODE.\~\~\b0 The software is comprised of Distributable Code. \ldblquote Distributable Code\rdblquote is code that you are permitted to distribute in programs you develop if you comply with the terms below.\b\fs19\par + +\pard\widctlpar\fi-357\li1077\sb120\sa120\fs20 i.\b0\f2\fs14\~\~\~\~\~\~\b\f0\fs20 Right to Use and Distribute.\b0\fs19\par + +\pard\widctlpar\fi-357\li1434\sb120\sa120\f1\fs20\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs20 You may copy and distribute the object code form of the software.\fs19\par +\f1\fs20\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs20 Third Party Distribution. You may permit distributors of your programs to copy and distribute the Distributable Code as part of those programs.\fs19\par + +\pard\widctlpar\fi-357\li1077\sb120\sa120\b\fs20 ii.\b0\f2\fs14\~\~\~\~\b\f0\fs20 Distribution Requirements.\b0\~\b For any Distributable Code you distribute, you must\b0\fs19\par + +\pard\widctlpar\fi-357\li1434\sb120\sa120\f1\fs20\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs20 add significant primary functionality to it in your programs;\fs19\par +\f1\fs20\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs20 require distributors and external end users to agree to terms that protect it at least as much as this agreement;\fs19\par +\f1\fs20\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs20 display your valid copyright notice on your programs; and\fs19\par +\f1\fs20\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs20 indemnify, defend, and hold harmless Microsoft from any claims, including attorneys\rquote fees, related to the distribution or use of your programs.\fs19\par + +\pard\widctlpar\fi-357\li1077\sb120\sa120\b\fs20 iii.\b0\f2\fs14\~\~\~\b\f0\fs20 Distribution Restrictions.\b0\~\b You may not\b0\fs19\par + +\pard\widctlpar\fi-357\li1434\sb120\sa120\f1\fs20\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs20 alter any copyright, trademark or patent notice in the Distributable Code;\fs19\par +\f1\fs20\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs20 use Microsoft\rquote s trademarks in your programs\rquote names or in a way that suggests your programs come from or are endorsed by Microsoft;\fs19\par +\f1\fs20\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs20 include Distributable Code in malicious, deceptive or unlawful programs; or\fs19\par +\f1\fs20\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs20 modify or distribute the source code of any Distributable Code so that any part of it becomes subject to an Excluded License. An Excluded License is one that requires, as a condition of use, modification or distribution, that\fs19\par + +\pard\widctlpar\fi-358\li1792\sb120\sa120\f1\fs20\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs20 the code be disclosed or distributed in source code form; or\fs19\par +\f1\fs20\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs20 others have the right to modify it.\fs19\par + +\pard\widctlpar\fi-357\li357\sb120\sa120\kerning36\b\fs20 4.\b0\f2\fs14\~\~\~\~\b\f0\fs19 SCOPE OF LICENSE.\~\b0 The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights despite this limitation, you may use the software only as expressly permitted in this agreement. In doing so, you must comply with any technical limitations in the software that only allow you to use it in certain ways. You may not\b\par + +\pard\widctlpar\fi-363\li720\sb120\sa120\kerning0\b0\f1\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 work around any technical limitations in the software;\par +\f1\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 reverse engineer, decompile or disassemble the software, except and only to the extent that applicable law expressly permits, despite this limitation;\par +\f1\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 publish the software for others to copy;\par +\f1\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 rent, lease or lend the software;\par +\f1\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 transfer the software or this agreement to any third party; or\par +\f1\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 use the software for commercial software hosting services.\par + +\pard\widctlpar\fi-357\li357\sb120\sa120\kerning36\b\fs20 5.\b0\f2\fs14\~\~\~\~\b\f0\fs19 BACKUP COPY.\~\b0 You may make one backup copy of the software. You may use it only to reinstall the software.\b\par +\fs20 6.\b0\f2\fs14\~\~\~\~\b\f0\fs19 DOCUMENTATION.\~\b0 Any person that has valid access to your computer or internal network may copy and use the documentation for your internal, reference purposes.\b\par +\fs20 7.\b0\f2\fs14\~\~\~\~\b\f0\fs19 EXPORT RESTRICTIONS.\~\b0 The software is subject to United States export laws and regulations. You must comply with all domestic and international export laws and regulations that apply to the software. These laws include restrictions on destinations, end users and end use. For additional information, see\~{\cf0\fs20{\field{\*\fldinst{HYPERLINK www.microsoft.com/exporting }}{\fldrslt{www.microsoft.com/exporting\ul0\cf0}}}}\f0\fs19 .\b\par +\fs20 8.\b0\f2\fs14\~\~\~\~\b\f0\fs19 SUPPORT SERVICES.\~\b0 Because this software is \ldblquote as is,\rdblquote we may not provide support services for it.\b\par +\fs20 9.\b0\f2\fs14\~\~\~\~\b\f0\fs19 ENTIRE AGREEMENT.\~\b0 This agreement, and the terms for supplements, updates, Internet-based services and support services that you use, are the entire agreement for the software and support services.\b\par +\fs20 10.\b0\f2\fs14\~\~\~\b\f0\fs19 APPLICABLE LAW.\par + +\pard\widctlpar\fi-363\li720\sb120\sa120\kerning0\fs20 a.\b0\f2\fs14\~\~\~\~\b\f0\fs19 United States.\~\b0 If you acquired the software in the United States, Washington state law governs the interpretation of this agreement and applies to claims for breach of it, regardless of conflict of laws principles. The laws of the state where you live govern all other claims, including claims under state consumer protection laws, unfair competition laws, and in tort.\b\par +\fs20 b.\b0\f2\fs14\~\~\~\~\b\f0\fs19 Outside the United States. If you acquired the software in any other country, the laws of that country apply.\par + +\pard\widctlpar\fi-357\li357\sb120\sa120\kerning36\fs20 11.\b0\f2\fs14\~\~\b\f0\fs19 LEGAL EFFECT.\~\b0 This agreement describes certain legal rights. You may have other rights under the laws of your country. You may also have rights with respect to the party from whom you acquired the software. This agreement does not change your rights under the laws of your country if the laws of your country do not permit it to do so.\b\par +\fs20 12.\b0\f2\fs14\~\~\b\f0\fs19 DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED \ldblquote AS-IS.\rdblquote YOU BEAR THE RISK OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES OR CONDITIONS. YOU MAY HAVE ADDITIONAL CONSUMER RIGHTS OR STATUTORY GUARANTEES UNDER YOUR LOCAL LAWS WHICH THIS AGREEMENT CANNOT CHANGE. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT EXCLUDES THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.\par + +\pard\widctlpar\li357\sb120\sa120\kerning0 FOR AUSTRALIA \endash YOU HAVE STATUTORY GUARANTEES UNDER THE AUSTRALIAN CONSUMER LAW AND NOTHING IN THESE TERMS IS INTENDED TO AFFECT THOSE RIGHTS.\b0\par + +\pard\widctlpar\fi-357\li357\sb120\sa120\kerning36\b\fs20 13.\b0\f2\fs14\~\~\b\f0\fs19 LIMITATION ON AND EXCLUSION OF REMEDIES AND DAMAGES. YOU CAN RECOVER FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS, SPECIAL, INDIRECT OR INCIDENTAL DAMAGES.\par + +\pard\widctlpar\li357\sb120\sa120\kerning0\b0 This limitation applies to\par + +\pard\widctlpar\fi-363\li720\sb120\sa120\f1\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 anything related to the software, services, content (including code) on third party Internet sites, or third party programs; and\par +\f1\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by applicable law.\par + +\pard\widctlpar\sb120\sa120 It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages.\par +\lang9 Please note: As this software is distributed in Quebec, Canada, some of the clauses in this agreement are provided below in French.\lang1033\par +\lang9 Remarque : Ce logiciel \'e9tant distribu\'e9 au Qu\'e9bec, Canada, certaines des clauses dans ce contrat sont fournies ci-dessous en fran\'e7ais.\lang1033\par +\kerning36\b EXON\'c9RATION DE GARANTIE.\~\b0 Le logiciel vis\'e9 par une licence est offert \'ab tel quel \'bb. Toute utilisation de ce logiciel est \'e0 votre seule risque et p\'e9ril. Microsoft n\rquote accorde aucune autre garantie expresse. Vous pouvez b\'e9n\'e9ficier de droits additionnels en vertu du droit local sur la protection des consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties implicites de qualit\'e9 marchande, d\rquote ad\'e9quation \'e0 un usage particulier et d\rquote absence de contrefa\'e7on sont exclues.\b\par +LIMITATION DES DOMMAGES-INT\'c9R\'caTS ET EXCLUSION DE RESPONSABILIT\'c9 POUR LES DOMMAGES.\~\b0 Vous pouvez obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de dommages directs uniquement \'e0 hauteur de 5,00 $ US. Vous ne pouvez pr\'e9tendre \'e0 aucune indemnisation pour les autres dommages, y compris les dommages sp\'e9ciaux, indirects ou accessoires et pertes de b\'e9n\'e9fices.\b\par +\kerning0\b0\lang9 Cette limitation concerne :\lang1033\par + +\pard\widctlpar\li720\sb120\f1\lang9\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 tout ce qui est reli\'e9 au logiciel, aux services ou au contenu (y compris le code) figurant sur des sites Internet tiers ou dans des programmes tiers ; et\lang1033\par + +\pard\widctlpar\li720\sa120\f1\lang9\'b7\f2\fs14\~\~\~\~\~\~\~\~\~\f0\fs19 les r\'e9clamations au titre de violation de contrat ou de garantie, ou au titre de responsabilit\'e9 stricte, de n\'e9gligence ou d\rquote une autre faute dans la limite autoris\'e9e par la loi en vigueur.\lang1033\par + +\pard\widctlpar\sb120\sa120\lang9 Elle s\rquote applique \'e9galement, m\'eame si Microsoft connaissait ou devrait conna\'eetre l\rquote\'e9ventualit\'e9 d\rquote un tel dommage. Si votre pays n\rquote autorise pas l\rquote exclusion ou la limitation de responsabilit\'e9 pour les dommages indirects, accessoires ou de quelque nature que ce soit, il se peut que la limitation ou l\rquote exclusion ci-dessus ne s\rquote appliquera pas \'e0 votre \'e9gard.\lang1033\par +\kerning36\b EFFET JURIDIQUE.\~\b0 Le pr\'e9sent contrat d\'e9crit certains droits juridiques. Vous pourriez avoir d\rquote autres droits pr\'e9vus par les lois de votre pays. Le pr\'e9sent contrat ne modifie pas les droits que vous conf\'e8rent les lois de votre pays si celles-ci ne le permettent pas.\b\par +\kerning0\fs20\lang1036\~\fs19\lang1033\par + +\pard\widctlpar\cf0\b0\f3\fs24\par +} + \ No newline at end of file diff --git a/run-build.ps1 b/run-build.ps1 index 4700306e9..ac0f08909 100644 --- a/run-build.ps1 +++ b/run-build.ps1 @@ -16,17 +16,31 @@ param( if($Help) { - Write-Output "Usage: .\build.ps1 [-Configuration ] [-Architecture ] [-NoPackage] [-Help]" + Write-Output "Usage: .\run-build.ps1 [-Configuration ] [-Architecture ] [-NoPackage] [-NoBuild] [-Help]" Write-Output "" Write-Output "Options:" Write-Output " -Configuration Build the specified Configuration (Debug or Release, default: Debug)" - Write-Output " -Architecture Build the specified architecture (x64 or x86 (supported only on Windows), default: x64)" + Write-Output " -Architecture Build the specified architecture (x64, x86, arm, or arm64 , default: x64)" Write-Output " -NoPackage Skip packaging targets" Write-Output " -NoBuild Skip building the product" Write-Output " -Help Display this help message" exit 0 } +# The first 'pass' call to "dotnet msbuild build.proj" has a hard-coded "WriteDynamicPropsToStaticPropsFiles" target +# therefore, this call should not have other targets defined. Remove all targets passed in as 'extra parameters'. +if ($ExtraParameters) +{ + $ExtraParametersNoTargets = $ExtraParameters.GetRange(0,$ExtraParameters.Count) + foreach ($param in $ExtraParameters) + { + if(($param.StartsWith("/t:", [StringComparison]::OrdinalIgnoreCase)) -or ($param.StartsWith("/target:", [StringComparison]::OrdinalIgnoreCase))) + { + $ExtraParametersNoTargets.Remove("$param") | Out-Null + } + } +} + $env:CONFIGURATION = $Configuration; $RepoRoot = "$PSScriptRoot" if(!$env:NUGET_PACKAGES){ @@ -53,33 +67,33 @@ if (!(Test-Path $env:DOTNET_INSTALL_DIR)) mkdir $env:DOTNET_INSTALL_DIR | Out-Null } - - # Disable first run since we want to control all package sources $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 # Don't resolve shared frameworks from user or global locations $env:DOTNET_MULTILEVEL_LOOKUP=0 +# Turn off MSBuild Node re-use +$env:MSBUILDDISABLENODEREUSE=1 + # Enable vs test console logging $env:VSTEST_BUILD_TRACE=1 $env:VSTEST_TRACE_BUILD=1 # install a stage0 -if (!$env:DOTNET_TOOL_DIR) -{ - $dotnetInstallPath = Join-Path $env:DOTNET_INSTALL_DIR "dotnet-install.ps1" - Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile "$dotnetInstallPath" +$dotnetInstallPath = Join-Path $env:DOTNET_INSTALL_DIR "dotnet-install.ps1" +Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile "$dotnetInstallPath" - Write-Output "$dotnetInstallPath -Channel ""release/2.0.0"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture""" - Invoke-Expression "$dotnetInstallPath -Channel ""release/2.0.0"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture""" - if ($LastExitCode -ne 0) - { - Write-Output "The .NET CLI installation failed with exit code $LastExitCode" - exit $LastExitCode - } +$InstallArchitecture = $Architecture +if($Architecture.StartsWith("arm", [StringComparison]::OrdinalIgnoreCase)) +{ + $InstallArchitecture = "x64" } -else + +Write-Output "$dotnetInstallPath -version ""2.2.0-preview1-007799"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$InstallArchitecture""" +Invoke-Expression "$dotnetInstallPath -version ""2.2.0-preview1-007799"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$InstallArchitecture""" + +if ($LastExitCode -ne 0) { Copy-Item -Recurse -Force $env:DOTNET_TOOL_DIR $env:DOTNET_INSTALL_DIR } @@ -94,7 +108,7 @@ if ($NoBuild) } else { - dotnet msbuild build.proj /p:Architecture=$Architecture /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles + dotnet msbuild build.proj /p:Architecture=$Architecture /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles $ExtraParametersNoTargets dotnet msbuild build.proj /m /v:normal /fl /flp:v=diag /p:Architecture=$Architecture $ExtraParameters if($LASTEXITCODE -ne 0) { throw "Failed to build" } } diff --git a/run-build.sh b/run-build.sh index 29f99967b..3c08dc14e 100755 --- a/run-build.sh +++ b/run-build.sh @@ -51,6 +51,8 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" REPOROOT="$DIR" ARCHITECTURE="x64" +STAGE0_SOURCE_DIR= + source "$REPOROOT/scripts/common/_prettyprint.sh" BUILD=1 @@ -61,66 +63,61 @@ CUSTOM_BUILD_ARGS= # Set nuget package cache under the repo [ -z $NUGET_PACKAGES ] && export NUGET_PACKAGES="$REPOROOT/.nuget/packages" -args=( "$@" ) +args=( ) while [[ $# > 0 ]]; do lowerI="$(echo $1 | awk '{print tolower($0)}')" case $lowerI in -c|--configuration) export CONFIGURATION=$2 - args=( "${args[@]/$1}" ) - args=( "${args[@]/$2}" ) shift ;; --nopackage) export DOTNET_BUILD_SKIP_PACKAGING=1 - args=( "${args[@]/$1}" ) ;; --skip-prereqs) # Allow CI to disable prereqs check since the CI has the pre-reqs but not ldconfig it seems export DOTNET_INSTALL_SKIP_PREREQS=1 - args=( "${args[@]/$1}" ) ;; --nobuild) BUILD=0 ;; - --architecture) + -a|--architecture) ARCHITECTURE=$2 - args=( "${args[@]/$1}" ) - args=( "${args[@]/$2}" ) shift ;; --runtime-id) CUSTOM_BUILD_ARGS="/p:Rid=\"$2\"" - args=( "${args[@]/$1}" ) - args=( "${args[@]/$2}" ) shift ;; # This is here just to eat away this parameter because CI still passes this in. --targets) - args=( "${args[@]/$1}" ) - args=( "${args[@]/$2}" ) shift ;; --linux-portable) LINUX_PORTABLE_INSTALL_ARGS="--runtime-id linux-x64" - CUSTOM_BUILD_ARGS="/p:Rid=\"linux-x64\" /p:OSName=\"linux\" /p:IslinuxPortable=\"true\"" - args=( "${args[@]/$1}" ) + CUSTOM_BUILD_ARGS="/p:OSName=\"linux\" /p:IslinuxPortable=\"true\"" + ;; + --stage0) + STAGE0_SOURCE_DIR=$2 + shift ;; --help) - echo "Usage: $0 [--configuration ] [--targets ] [--skip-prereqs] [--nopackage] [--docker ] [--help]" + echo "Usage: $0 [--configuration ] [--architecture ] [--skip-prereqs] [--nopackage] [--nobuild ] [--docker ] [--stage0 ] [--help]" echo "" echo "Options:" echo " --configuration Build the specified Configuration (Debug or Release, default: Debug)" + echo " --architecture Build the specified architecture (x64, arm or arm64 , default: x64)" echo " --skip-prereqs Skip checks for pre-reqs in dotnet_install" echo " --nopackage Skip packaging targets" echo " --nobuild Skip building, showing the command that would be used to build" echo " --docker Build in Docker using the Dockerfile located in scripts/docker/IMAGENAME" - echo " --linux-portable Builds the Linux portable .NET Tools instead of a distro-specific version." + echo " --stage0 Set the stage0 source directory. The default is to download it from Azure." echo " --help Display this help message" exit 0 ;; *) + args=$@ break ;; esac @@ -128,17 +125,22 @@ while [[ $# > 0 ]]; do shift done -# $args array may have empty elements in it. -# The easiest way to remove them is to cast to string and back to array. -# This will actually break quoted arguments, arguments like -# -test "hello world" will be broken into three arguments instead of two, as it should. -temp="${args[@]}" -args=($temp) +# The first 'pass' call to "dotnet msbuild build.proj" has a hard-coded "WriteDynamicPropsToStaticPropsFiles" target +# therefore, this call should not have other targets defined. Remove all targets passed in as 'extra parameters'. +argsnotargets=( ) +for arg in ${args[@]} +do + arglower="$(echo $arg | awk '{print tolower($0)}')" + if [[ $arglower != '/t:'* ]] && [[ $arglower != '/target:'* ]]; then + argsnotargets+=($arg) + fi +done # Create an install directory for the stage 0 CLI [ -z "$DOTNET_INSTALL_DIR" ] && export DOTNET_INSTALL_DIR=$REPOROOT/.dotnet_stage0/$ARCHITECTURE [ -d "$DOTNET_INSTALL_DIR" ] || mkdir -p $DOTNET_INSTALL_DIR +# Disable first run since we want to control all package sources export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 # Enable verbose VS Test Console logging @@ -149,19 +151,28 @@ export VSTEST_TRACE_BUILD=1 # Don't resolve shared frameworks from user or global locations export DOTNET_MULTILEVEL_LOOKUP=0 -# Install a stage 0 -if [ -z "$DOTNET_TOOL_DIR" ]; then - curl -sSL "https://dot.net/v1/dotnet-install.sh" | bash /dev/stdin --channel "release/2.0.0" --install-dir "$DOTNET_INSTALL_DIR" --architecture "$ARCHITECTURE" $LINUX_PORTABLE_INSTALL_ARGS +# Turn off MSBuild Node re-use +export MSBUILDDISABLENODEREUSE=1 - EXIT_CODE=$? - if [ $EXIT_CODE != 0 ]; then - echo "run-build: Error: installing stage0 with exit code $EXIT_CODE." >&2 - exit $EXIT_CODE - fi -else - cp -r $DOTNET_TOOL_DIR/* $DOTNET_INSTALL_DIR/ +# Install a stage 0 +INSTALL_ARCHITECTURE=$ARCHITECTURE +archlower="$(echo $ARCHITECTURE | awk '{print tolower($0)}')" +if [[ $archlower == 'arm'* ]]; then + INSTALL_ARCHITECTURE="x64" fi +if [ "$STAGE0_SOURCE_DIR" == "" ]; then + (set -x ; curl -sSL "https://dot.net/v1/dotnet-install.sh" | bash /dev/stdin --version "2.2.0-preview1-007799" --install-dir "$DOTNET_INSTALL_DIR" --architecture "$INSTALL_ARCHITECTURE" $LINUX_PORTABLE_INSTALL_ARGS) +else + echo "Copying bootstrap cli from $STAGE0_SOURCE_DIR" + cp -r $STAGE0_SOURCE_DIR/* "$DOTNET_INSTALL_DIR" +fi + +EXIT_CODE=$? +if [ $EXIT_CODE != 0 ]; then + echo "run-build: Error: installing stage0 with exit code $EXIT_CODE." >&2 + exit $EXIT_CODE +fi # Put stage 0 on the PATH (for this shell only) PATH="$DOTNET_INSTALL_DIR:$PATH" @@ -177,12 +188,10 @@ fi # Disable first run since we want to control all package sources export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 -echo "${args[@]}" - if [ $BUILD -eq 1 ]; then - dotnet msbuild build.proj /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles - dotnet msbuild build.proj /m /v:normal /fl /flp:v=diag /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS "${args[@]}" + dotnet msbuild build.proj /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles ${argsnotargets[@]} + dotnet msbuild build.proj /m /v:normal /fl /flp:v=diag /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS $args else echo "Not building due to --nobuild" - echo "Command that would be run is: 'dotnet msbuild build.proj /m /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS ${args[@]}'" + echo "Command that would be run is: 'dotnet msbuild build.proj /m /p:Architecture=$ARCHITECTURE $CUSTOM_BUILD_ARGS $args'" fi diff --git a/scripts/cli-build-env.bat b/scripts/cli-build-env.bat new file mode 100644 index 000000000..03b6ded6f --- /dev/null +++ b/scripts/cli-build-env.bat @@ -0,0 +1,17 @@ +@echo off +REM Copyright (c) .NET Foundation and contributors. All rights reserved. +REM Licensed under the MIT license. See LICENSE file in the project root for full license information. + +REM Get normalized version of parent path +for %%i in (%~dp0..\) DO ( + SET CLI_REPO_ROOT=%%~dpi +) + +title CLI Build (%CLI_REPO_ROOT%) + +REM Add Stage 0 CLI to path +set PATH=%CLI_REPO_ROOT%.dotnet_stage0\x64;%PATH% + +set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 +set DOTNET_MULTILEVEL_LOOKUP=0 +set NUGET_PACKAGES=%CLI_REPO_ROOT%.nuget\packages \ No newline at end of file diff --git a/scripts/dev-dotnet.sh b/scripts/cli-build-env.sh old mode 100755 new mode 100644 similarity index 68% rename from scripts/dev-dotnet.sh rename to scripts/cli-build-env.sh index e7d8e6eac..1534aeb66 --- a/scripts/dev-dotnet.sh +++ b/scripts/cli-build-env.sh @@ -4,22 +4,20 @@ # Licensed under the MIT license. See LICENSE file in the project root for full license information. # -set -e - SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done -DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" -source "$DIR/common/_common.sh" +REPO_ROOT="$( cd -P "$( dirname "$SOURCE" )/../" && pwd )" -if [ -d "$STAGE2_DIR" ]; then - PATH=$STAGE2_DIR/bin:$PATH - dotnet "$@" -else - echo "You don't have a dev build!" 1>&2 - exit 1 -fi +STAGE0_DIR=$REPO_ROOT/.dotnet_stage0/x64 +export PATH=$STAGE0_DIR:$PATH + + +export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 +export DOTNET_MULTILEVEL_LOOKUP=0 + +export NUGET_PACKAGES=$REPO_ROOT/.nuget/packages diff --git a/scripts/cli-test-env.bat b/scripts/cli-test-env.bat new file mode 100644 index 000000000..0fd84c053 --- /dev/null +++ b/scripts/cli-test-env.bat @@ -0,0 +1,20 @@ +@echo off +REM Copyright (c) .NET Foundation and contributors. All rights reserved. +REM Licensed under the MIT license. See LICENSE file in the project root for full license information. + +REM Get normalized version of parent path +for %%i in (%~dp0..\) DO ( + SET CLI_REPO_ROOT=%%~dpi +) + +title CLI Test (%CLI_REPO_ROOT%) + +REM Add Stage 2 CLI to path +set PATH=%CLI_REPO_ROOT%bin\2\win-x64\dotnet;%PATH% + +set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 +set DOTNET_MULTILEVEL_LOOKUP=0 +set NUGET_PACKAGES=%CLI_REPO_ROOT%.nuget\packages +set TEST_PACKAGES=%CLI_REPO_ROOT%bin\2\win-x64\test\packages +set TEST_ARTIFACTS=%CLI_REPO_ROOT%bin\2\win-x64\test\artifacts +set PreviousStageProps=%CLI_REPO_ROOT%bin\2\win-x64\PreviousStage.props diff --git a/scripts/cli-test-env.sh b/scripts/cli-test-env.sh new file mode 100755 index 000000000..556e032f7 --- /dev/null +++ b/scripts/cli-test-env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done + +REPO_ROOT="$( cd -P "$( dirname "$SOURCE" )/../" && pwd )" + +uname=$(uname) +if [ "$(uname)" = "Darwin" ] +then + RID=osx-x64 +else + RID=linux-x64 +fi + +STAGE2_DIR=$REPO_ROOT/bin/2/$RID/dotnet +export PATH=$STAGE2_DIR:$PATH + + +export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 +export DOTNET_MULTILEVEL_LOOKUP=0 + +export NUGET_PACKAGES=$REPO_ROOT/.nuget/packages +export TEST_PACKAGES=$REPO_ROOT/bin/2/$RID/test/packages +export TEST_ARTIFACTS=$REPO_ROOT/bin/2/$RID/test/artifacts +export PreviousStageProps=$REPO_ROOT/bin/2/$RID/PreviousStage.props diff --git a/scripts/dev-dotnet.ps1 b/scripts/dev-dotnet.ps1 deleted file mode 100644 index afcfe46d5..000000000 --- a/scripts/dev-dotnet.ps1 +++ /dev/null @@ -1,24 +0,0 @@ -# -# Copyright (c) .NET Foundation and contributors. All rights reserved. -# Licensed under the MIT license. See LICENSE file in the project root for full license information. -# - -$oldPath = $env:PATH -try { - # Put the stage2 output on the front of the path - if(!(Get-Command dotnet -ErrorAction SilentlyContinue)) { - throw "You need to have a version of 'dotnet' on your path so we can determine the RID" - } - - $rid = dotnet --version | where { $_ -match "^ Runtime Id:\s*(.*)$" } | foreach { $matches[1] } - $stage2 = "$PSScriptRoot\..\artifacts\$rid\stage2\bin" - if (Test-Path $stage2) { - $env:PATH="$stage2;$env:PATH" - } else { - Write-Output "You don't have a dev build in the 'artifacts\$rid\stage2' folder!" - } - - dotnet @args -} finally { - $env:PATH = $oldPath -} diff --git a/scripts/docker/alpine.3.6/Dockerfile b/scripts/docker/alpine.3.6/Dockerfile new file mode 100644 index 000000000..746f1bd4b --- /dev/null +++ b/scripts/docker/alpine.3.6/Dockerfile @@ -0,0 +1,15 @@ +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +# Dockerfile that creates a container suitable to build dotnet-cli +FROM microsoft/dotnet-buildtools-prereqs:alpine-3.6-3148f11-20171119021156 + +# This Dockerfile doesn't use the USER_ID, but the parameter needs to be declared to prevent docker +# from issuing a warning +ARG USER_ID=0 + +# Set working directory +WORKDIR /opt/code + diff --git a/scripts/docker/fedora.27/Dockerfile b/scripts/docker/fedora.27/Dockerfile new file mode 100644 index 000000000..e0f6e851d --- /dev/null +++ b/scripts/docker/fedora.27/Dockerfile @@ -0,0 +1,32 @@ +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +# Dockerfile that creates a container suitable to build dotnet-cli +FROM microsoft/dotnet-buildtools-prereqs:fedora-27-82a3800-20180326211504 + +RUN dnf install -y findutils + +RUN dnf upgrade -y nss + +RUN dnf clean all + +# Set a different rid to publish buildtools for, until we update to a version which +# natively supports fedora.24-x64 +ENV __PUBLISH_RID=fedora.23-x64 + +# Setup User to match Host User, and give superuser permissions +ARG USER_ID=0 +RUN useradd -m code_executor -u ${USER_ID} -g wheel +RUN echo 'code_executor ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +# With the User Change, we need to change permissions on these directories +RUN chmod -R a+rwx /usr/local +RUN chmod -R a+rwx /home + +# Set user to the one we just created +USER ${USER_ID} + +# Set working directory +WORKDIR /opt/code \ No newline at end of file diff --git a/scripts/docker/opensuse.43.2/Dockerfile b/scripts/docker/opensuse.43.2/Dockerfile new file mode 100644 index 000000000..b128f8bc9 --- /dev/null +++ b/scripts/docker/opensuse.43.2/Dockerfile @@ -0,0 +1,49 @@ +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +FROM microsoft/dotnet-buildtools-prereqs:opensuse-42.3-d46ee12-20180327014902 + +# Install the base toolchain we need to build anything (clang, cmake, make and the like) +# this does not include libraries that we need to compile different projects, we'd like +# them in a different layer. +RUN zypper -n install binutils \ + cmake \ + which \ + gcc \ + llvm-clang \ + tar \ + ncurses-utils \ + curl \ + git \ + sudo && \ + zypper clean -a + +# Dependencies of CoreCLR and CoreFX. + +RUN zypper -n install --force-resolution \ + libunwind \ + libicu \ + lttng-ust \ + libuuid1 \ + libopenssl1_0_0 \ + libcurl4 \ + krb5 && \ + zypper clean -a + +# Setup User to match Host User, and give superuser permissions +ARG USER_ID=0 +RUN useradd -m code_executor -u ${USER_ID} -g wheel +RUN echo 'code_executor ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +# With the User Change, we need to change permissions on these directories +RUN chmod -R a+rwx /usr/local +RUN chmod -R a+rwx /home +RUN chmod -R 755 /usr/lib/sudo + +# Set user to the one we just created +USER ${USER_ID} + +# Set working directory +WORKDIR /opt/code \ No newline at end of file diff --git a/scripts/docker/rhel.6/Dockerfile b/scripts/docker/rhel.6/Dockerfile new file mode 100644 index 000000000..1275f3293 --- /dev/null +++ b/scripts/docker/rhel.6/Dockerfile @@ -0,0 +1,31 @@ +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +# Dockerfile that creates a container suitable to build dotnet-cli +FROM microsoft/dotnet-buildtools-prereqs:centos-6-376e1a3-20174311014331 + +# yum doesn't work with the special curl version we have in the base docker image, +# so we remove /usr/local/lib from the library path for this command +RUN yum -q -y install sudo + +# Setup User to match Host User, and give superuser permissions +ARG USER_ID=0 +RUN useradd -m code_executor -u ${USER_ID} -g root +RUN echo 'code_executor ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +# With the User Change, we need to change permssions on these directories +RUN chmod -R a+rwx /usr/local +RUN chmod -R a+rwx /home +RUN chmod -R 755 /usr/bin/sudo + +# Set user to the one we just created +USER ${USER_ID} + +# Set library path to make CURL and ICU libraries that are in /usr/local/lib visible +ENV LD_LIBRARY_PATH /usr/local/lib + +# Set working directory +WORKDIR /opt/code + diff --git a/scripts/docker/rhel/Dockerfile b/scripts/docker/rhel/Dockerfile index 17ad16cf5..ec809ea73 100644 --- a/scripts/docker/rhel/Dockerfile +++ b/scripts/docker/rhel/Dockerfile @@ -4,11 +4,7 @@ # # Dockerfile that creates a container suitable to build dotnet-cli -FROM microsoft/dotnet-buildtools-prereqs:rhel-7-rpmpkg-c982313-20174116044113 - -# Install from sudo main package TODO This package needs to be mirrored -RUN yum install -y https://www.sudo.ws/sudo/dist/packages/RHEL/7/sudo-1.8.20-3.el7.x86_64.rpm \ - && yum clean all +FROM microsoft/dotnet-buildtools-prereqs:rhel-7-rpmpkg-e1b4a89-20175311035359 # Setup User to match Host User, and give superuser permissions ARG USER_ID=0 diff --git a/scripts/docker/ubuntu.18.04/Dockerfile b/scripts/docker/ubuntu.18.04/Dockerfile new file mode 100644 index 000000000..97d0578c7 --- /dev/null +++ b/scripts/docker/ubuntu.18.04/Dockerfile @@ -0,0 +1,29 @@ +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +# Dockerfile that creates a container suitable to build dotnet-cli +FROM microsoft/dotnet-buildtools-prereqs:ubuntu-18.04-f90bc20-20180320154721 + +RUN apt-get update && \ + apt-get -qqy install \ + sudo && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Setup User to match Host User, and give superuser permissions +ARG USER_ID=0 +RUN useradd -m code_executor -u ${USER_ID} -g sudo +RUN echo 'code_executor ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +# With the User Change, we need to change permissions on these directories +RUN chmod -R a+rwx /usr/local +RUN chmod -R a+rwx /home +RUN chmod -R 755 /usr/lib/sudo + +# Set user to the one we just created +USER ${USER_ID} + +# Set working directory +WORKDIR /opt/code \ No newline at end of file diff --git a/scripts/dockerrun.sh b/scripts/dockerrun.sh index abdaec636..1ffd92ee6 100755 --- a/scripts/dockerrun.sh +++ b/scripts/dockerrun.sh @@ -115,36 +115,31 @@ echo "Running command: $BUILD_COMMAND" echo "Using code from: $DOCKER_HOST_SHARE_DIR" [ -z "$INTERACTIVE" ] || echo "Running Interactive" +# Note: passwords/keys should not be passed in the environment docker run $INTERACTIVE -t --rm --sig-proxy=true \ --name $DOTNET_BUILD_CONTAINER_NAME \ -v $DOCKER_HOST_SHARE_DIR:/opt/code \ -e CHANNEL \ - -e CONNECTION_STRING \ - -e REPO_ID \ - -e REPO_USER \ - -e REPO_PASS \ - -e REPO_SERVER \ -e DOTNET_BUILD_SKIP_CROSSGEN \ -e PUBLISH_TO_AZURE_BLOB \ -e NUGET_FEED_URL \ -e NUGET_API_KEY \ - -e GITHUB_PASSWORD \ - -e ARTIFACT_STORAGE_KEY \ -e ARTIFACT_STORAGE_ACCOUNT \ -e ARTIFACT_STORAGE_CONTAINER \ - -e CHECKSUM_STORAGE_KEY \ -e CHECKSUM_STORAGE_ACCOUNT \ -e CHECKSUM_STORAGE_CONTAINER \ + -e BLOBFEED_STORAGE_CONTAINER \ -e CLIBUILD_SKIP_TESTS \ -e COMMITCOUNT \ -e DROPSUFFIX \ -e RELEASESUFFIX \ -e COREFXAZURECONTAINER \ -e AZUREACCOUNTNAME \ - -e AZUREACCESSTOKEN \ - -e VSOPASSWORD \ -e RELEASETOOLSGITURL \ -e CORESETUPBLOBROOTURL \ - -e CORESETUPBLOBACCESSTOKEN \ + -e PB_ASSETROOTURL \ + -e PB_PACKAGEVERSIONPROPSURL \ + -e PB_PUBLISHBLOBFEEDURL \ + -e EXTERNALRESTORESOURCES \ $DOTNET_BUILD_CONTAINER_TAG \ $BUILD_COMMAND "$@" diff --git a/scripts/unuse-dev.ps1 b/scripts/unuse-dev.ps1 deleted file mode 100644 index fbf5f4c18..000000000 --- a/scripts/unuse-dev.ps1 +++ /dev/null @@ -1,9 +0,0 @@ -# -# Copyright (c) .NET Foundation and contributors. All rights reserved. -# Licensed under the MIT license. See LICENSE file in the project root for full license information. -# - -# Remove the stage2 output from the path -$splat = $env:PATH.Split(";") -$stripped = @($splat | where { $_ -notlike "*artifacts\win7-x64\stage2*" }) -$env:PATH = [string]::Join(";", $stripped) diff --git a/scripts/use-dev.ps1 b/scripts/use-dev.ps1 deleted file mode 100644 index 1d7225bd6..000000000 --- a/scripts/use-dev.ps1 +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (c) .NET Foundation and contributors. All rights reserved. -# Licensed under the MIT license. See LICENSE file in the project root for full license information. -# - -# Put the stage2 output on the front of the path -$stage2 = "$PSScriptRoot\..\artifacts\win10-x64\stage2" -if (Test-Path $stage2) { - $splat = $env:PATH.Split(";") - $stage2 = Convert-Path $stage2 - if ($splat -notcontains $stage2) { - $env:PATH="$stage2;$env:PATH" - } -} else { - Write-Output "You don't have a dev build in the 'artifacts\win10-x64\stage2' folder!" -} diff --git a/src/redist/redist.csproj b/src/redist/redist.csproj new file mode 100644 index 000000000..9261c166c --- /dev/null +++ b/src/redist/redist.csproj @@ -0,0 +1,264 @@ + + + + + + + $(CliTargetFramework) + true + false + dotnet5.4 + $(SdkOutputDirectory) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DotnetToolsLayoutDirectory=$(SdkOutputDirectory)/DotnetTools; + TemplateFillInPackageName=%(BundledDotnetTools.Identity); + TemplateFillInPackageVersion=%(BundledDotnetTools.Version); + PreviousStageDirectory=$(PreviousStageDirectory) + + + + + + + + + + + + Microsoft.NETCore.DotNetAppHost + + + + + + + + + + <_NETCoreDotNetAppHostPackageVersion>@(NETCoreDotNetAppHostPackageVersions->Distinct()) + + + + + + AppHostTemplatePath=$(SdkOutputDirectory)/AppHostTemplate; + TemplateFillInPackageName=$(NETCoreDotNetAppHostPackageName); + TemplateFillInPackageVersion=$(_NETCoreDotNetAppHostPackageVersion); + PreviousStageDirectory=$(PreviousStageDirectory); + AppHostIntermediateDirectory=$(IntermediateDirectory)/AppHostIntermediate + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + false + + + + + + + + + + + + + + + + + + + + + TemplateLayoutDirectory=$(SdkOutputDirectory)/Templates; + TemplateFillInPackageName=%(BundledTemplate.Identity); + TemplateFillInPackageVersion=%(BundledTemplate.Version); + PreviousStageDirectory=$(PreviousStageDirectory) + + + + + + + + + + + + + + $(PublishDir)/vstest.console.runtimeconfig.json + "version": ".*" + "version": "$(MicrosoftNETCoreAppPackageVersion)" + + + + diff --git a/test/EndToEnd/EndToEnd.csproj b/test/EndToEnd/EndToEnd.csproj index 5c441480f..2cfa51620 100644 --- a/test/EndToEnd/EndToEnd.csproj +++ b/test/EndToEnd/EndToEnd.csproj @@ -1,7 +1,7 @@  $(CliTargetFramework) - $(CLI_SharedFrameworkVersion) + $(MicrosoftNETCoreAppPackageVersion) EndToEnd Exe $(AssetTargetFallback);dotnet5.4;portable-net451+win8 @@ -19,10 +19,9 @@
- + - - + diff --git a/test/EndToEnd/GivenAspNetAppsResolveImplicitVersions.cs b/test/EndToEnd/GivenAspNetAppsResolveImplicitVersions.cs new file mode 100644 index 000000000..da7163646 --- /dev/null +++ b/test/EndToEnd/GivenAspNetAppsResolveImplicitVersions.cs @@ -0,0 +1,222 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Xml.Linq; +using FluentAssertions; +using Microsoft.DotNet.TestFramework; +using Microsoft.DotNet.Tools.Test.Utilities; +using NuGet.ProjectModel; +using NuGet.Versioning; +using Xunit; + +namespace EndToEnd +{ + public class GivenAspNetAppsResolveImplicitVersions : TestBase + { + private const string AspNetTestProject = "TestWebAppSimple"; + + [Fact] + public void PortablePublishWithLatestTFMUsesBundledAspNetCoreAppVersion() + { + var _testInstance = TestAssets.Get(AspNetTestProject) + .CreateInstance(identifier: LatestSupportedAspNetCoreAppVersion) + .WithSourceFiles(); + + string projectDirectory = _testInstance.Root.FullName; + string projectPath = Path.Combine(projectDirectory, $"{AspNetTestProject}.csproj"); + + var project = XDocument.Load(projectPath); + var ns = project.Root.Name.Namespace; + + // Update TargetFramework to the right version of .NET Core + project.Root.Element(ns + "PropertyGroup") + .Element(ns + "TargetFramework") + .Value = "netcoreapp" + LatestSupportedAspNetCoreAppVersion; + + project.Save(projectPath); + + // Get the implicit version + new RestoreCommand() + .WithWorkingDirectory(projectDirectory) + .Execute() + .Should().Pass(); + + var assetsFilePath = Path.Combine(projectDirectory, "obj", "project.assets.json"); + var assetsFile = new LockFileFormat().Read(assetsFilePath); + + var restoredVersion = GetAspNetCoreAppVersion(assetsFile, portable: true); + restoredVersion.Should().NotBeNull(); + + var bundledVersionPath = Path.Combine(projectDirectory, ".BundledAspNetCoreVersion"); + var bundledVersion = File.ReadAllText(bundledVersionPath).Trim(); + + restoredVersion.ToNormalizedString().Should().BeEquivalentTo(bundledVersion, + "The bundled aspnetcore versions set in Microsoft.NETCoreSdk.BundledVersions.props should be idenitical to the versions set in DependencyVersions.props." + + "Please update MSBuildExtensions.targets in this repo so these versions match."); + } + + [Fact] + public void StandalonePublishWithLatestTFMUsesBundledAspNetCoreAppVersion() + { + var _testInstance = TestAssets.Get(AspNetTestProject) + .CreateInstance(identifier: LatestSupportedAspNetCoreAppVersion) + .WithSourceFiles(); + + string projectDirectory = _testInstance.Root.FullName; + string projectPath = Path.Combine(projectDirectory, $"{AspNetTestProject}.csproj"); + + var project = XDocument.Load(projectPath); + var ns = project.Root.Name.Namespace; + + // Update TargetFramework to the right version of .NET Core + project.Root.Element(ns + "PropertyGroup") + .Element(ns + "TargetFramework") + .Value = "netcoreapp" + LatestSupportedAspNetCoreAppVersion; + + var rid = Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.GetRuntimeIdentifier(); + + // Set RuntimeIdentifier to simulate standalone publish + project.Root.Element(ns + "PropertyGroup") + .Add(new XElement(ns + "RuntimeIdentifier", rid)); + + project.Save(projectPath); + + // Get the implicit version + new RestoreCommand() + .WithWorkingDirectory(projectDirectory) + .Execute() + .Should().Pass(); + + var assetsFilePath = Path.Combine(projectDirectory, "obj", "project.assets.json"); + var assetsFile = new LockFileFormat().Read(assetsFilePath); + + var restoredVersion = GetAspNetCoreAppVersion(assetsFile); + restoredVersion.Should().NotBeNull(); + + var bundledVersionPath = Path.Combine(projectDirectory, ".BundledAspNetCoreVersion"); + var bundledVersion = File.ReadAllText(bundledVersionPath).Trim(); + + restoredVersion.ToNormalizedString().Should().BeEquivalentTo(bundledVersion, + "The bundled aspnetcore versions set in Microsoft.NETCoreSdk.BundledVersions.props should be idenitical to the versions set in DependencyVersions.props." + + "Please update MSBuildExtensions.targets in this repo so these versions match."); + } + + [Theory] + [MemberData(nameof(SupportedAspNetCoreAppVersions))] + public void ItRollsForwardToTheLatestVersion(string minorVersion) + { + var _testInstance = TestAssets.Get(AspNetTestProject) + .CreateInstance(identifier: minorVersion) + .WithSourceFiles(); + + string projectDirectory = _testInstance.Root.FullName; + + string projectPath = Path.Combine(projectDirectory, $"{AspNetTestProject}.csproj"); + + var project = XDocument.Load(projectPath); + var ns = project.Root.Name.Namespace; + + // Update TargetFramework to the right version of .NET Core + project.Root.Element(ns + "PropertyGroup") + .Element(ns + "TargetFramework") + .Value = "netcoreapp" + minorVersion; + + var rid = Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.GetRuntimeIdentifier(); + + // Set RuntimeIdentifier to opt in to roll-forward behavior + project.Root.Element(ns + "PropertyGroup") + .Add(new XElement(ns + "RuntimeIdentifier", rid)); + + project.Save(projectPath); + + // Get the version rolled forward to + new RestoreCommand() + .WithWorkingDirectory(projectDirectory) + .Execute() + .Should().Pass(); + + string assetsFilePath = Path.Combine(projectDirectory, "obj", "project.assets.json"); + var assetsFile = new LockFileFormat().Read(assetsFilePath); + + var rolledForwardVersion = GetAspNetCoreAppVersion(assetsFile); + rolledForwardVersion.Should().NotBeNull(); + + if (rolledForwardVersion.IsPrerelease) + { + // If this version of .NET Core is still prerelease, then: + // - Floating the patch by adding ".*" to the major.minor version won't work, but + // - There aren't any patches to roll-forward to, so we skip testing this until the version + // leaves prerelease. + return; + } + + // Float the RuntimeFrameworkVersion to get the latest version of the runtime available from feeds + Directory.Delete(Path.Combine(projectDirectory, "obj"), true); + project.Root.Element(ns + "PropertyGroup") + .Add(new XElement(ns + "RuntimeFrameworkVersion", $"{minorVersion}.*")); + project.Save(projectPath); + + new RestoreCommand() + .WithWorkingDirectory(projectDirectory) + .Execute() + .Should().Pass(); + + var floatedAssetsFile = new LockFileFormat().Read(assetsFilePath); + + var floatedVersion = GetAspNetCoreAppVersion(floatedAssetsFile); + floatedVersion.Should().NotBeNull(); + + rolledForwardVersion.ToNormalizedString().Should().BeEquivalentTo(floatedVersion.ToNormalizedString(), + "the latest patch version properties in Microsoft.NETCoreSdk.BundledVersions.props need to be updated " + + "(see MSBuildExtensions.targets in this repo)"); + } + + [Fact] + public void WeCoverLatestAspNetCoreAppRollForward() + { + // Run "dotnet new web", get TargetFramework property, and make sure it's covered in SupportedAspNetCoreAppVersions + using (DisposableDirectory directory = Temp.CreateDirectory()) + { + string projectDirectory = directory.Path; + + new NewCommandShim() + .WithWorkingDirectory(projectDirectory) + .Execute("web --no-restore") + .Should().Pass(); + + string projectPath = Path.Combine(projectDirectory, Path.GetFileName(projectDirectory) + ".csproj"); + + var project = XDocument.Load(projectPath); + var ns = project.Root.Name.Namespace; + + string targetFramework = project.Root.Element(ns + "PropertyGroup") + .Element(ns + "TargetFramework") + .Value; + + SupportedAspNetCoreAppVersions.Select(v => $"netcoreapp{v[0]}") + .Should().Contain(targetFramework, $"the {nameof(SupportedAspNetCoreAppVersions)} property should include the default version " + + "of Microsoft.AspNetCore.App used by the templates created by \"dotnet new web\""); + + } + } + + private NuGetVersion GetAspNetCoreAppVersion(LockFile lockFile, bool portable = false) + { + return lockFile?.Targets?.SingleOrDefault(t => portable || t.RuntimeIdentifier != null) + ?.Libraries?.SingleOrDefault(l => + string.Compare(l.Name, "Microsoft.AspNetCore.App", StringComparison.CurrentCultureIgnoreCase) == 0) + ?.Version; + } + + public static string LatestSupportedAspNetCoreAppVersion = "2.2"; + + public static IEnumerable SupportedAspNetCoreAppVersions + { + get + { + yield return new object[] { LatestSupportedAspNetCoreAppVersion }; + } + } + } +} diff --git a/test/EndToEnd/GivenDotNetLinuxInstallers.cs b/test/EndToEnd/GivenDotNetLinuxInstallers.cs new file mode 100644 index 000000000..4968f0221 --- /dev/null +++ b/test/EndToEnd/GivenDotNetLinuxInstallers.cs @@ -0,0 +1,83 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.IO; +using Microsoft.DotNet.Tools.Test.Utilities; +using Xunit; + +namespace Microsoft.DotNet.Tests.EndToEnd +{ + public class GivenDotNetLinuxInstallers + { + [Fact] + public void ItHasExpectedDependencies() + { + var installerFile = Environment.GetEnvironmentVariable("SDK_INSTALLER_FILE"); + if (string.IsNullOrEmpty(installerFile)) + { + return; + } + + var ext = Path.GetExtension(installerFile); + switch (ext) + { + case ".deb": + DebianPackageHasDependencyOnAspNetCoreStoreAndDotnetRuntime(installerFile); + return; + case ".rpm": + RpmPackageHasDependencyOnAspNetCoreStoreAndDotnetRuntime(installerFile); + return; + } + } + + private void DebianPackageHasDependencyOnAspNetCoreStoreAndDotnetRuntime(string installerFile) + { + // Example output: + + // $ dpkg --info dotnet-sdk-2.1.105-ubuntu-x64.deb + + // new debian package, version 2.0. + // size 75660448 bytes: control archive=29107 bytes. + // 717 bytes, 11 lines control + // 123707 bytes, 1004 lines md5sums + // 1710 bytes, 28 lines * postinst #!/usr/bin/env + // Package: dotnet-sdk-2.1.104 + // Version: 2.1.104-1 + // Architecture: amd64 + // Maintainer: Microsoft + // Installed-Size: 201119 + // Depends: dotnet-runtime-2.0.6, aspnetcore-store-2.0.6 + // Section: devel + // Priority: standard + // Homepage: https://dotnet.github.io/core + // Description: Microsoft .NET Core SDK - 2.1.104 + + new TestCommand("dpkg") + .ExecuteWithCapturedOutput($"--info {installerFile}") + .Should().Pass() + .And.HaveStdOutMatching(@"Depends:.*\s?dotnet-runtime-\d+(\.\d+){2}") + .And.HaveStdOutMatching(@"Depends:.*\s?aspnetcore-store-\d+(\.\d+){2}"); + } + + private void RpmPackageHasDependencyOnAspNetCoreStoreAndDotnetRuntime(string installerFile) + { + // Example output: + + // $ rpm -qpR dotnet-sdk-2.1.105-rhel-x64.rpm + + // dotnet-runtime-2.0.7 >= 2.0.7 + // aspnetcore-store-2.0.7 >= 2.0.7 + // /bin/sh + // /bin/sh + // rpmlib(PayloadFilesHavePrefix) <= 4.0-1 + // rpmlib(CompressedFileNames) <= 3.0.4-1 + + new TestCommand("rpm") + .ExecuteWithCapturedOutput($"-qpR {installerFile}") + .Should().Pass() + .And.HaveStdOutMatching(@"dotnet-runtime-\d+(\.\d+){2} >= \d+(\.\d+){2}") + .And.HaveStdOutMatching(@"aspnetcore-store-\d+(\.\d+){2} >= \d+(\.\d+){2}"); + } + } +} diff --git a/test/EndToEnd/GivenDotNetUsesMSBuild.cs b/test/EndToEnd/GivenDotNetUsesMSBuild.cs index 724ffb378..f5def1d95 100644 --- a/test/EndToEnd/GivenDotNetUsesMSBuild.cs +++ b/test/EndToEnd/GivenDotNetUsesMSBuild.cs @@ -19,7 +19,7 @@ namespace Microsoft.DotNet.Tests.EndToEnd { string projectDirectory = directory.Path; - string newArgs = "console -f netcoreapp2.0 --debug:ephemeral-hive --no-restore"; + string newArgs = "console -f netcoreapp2.1 --debug:ephemeral-hive --no-restore"; new NewCommandShim() .WithWorkingDirectory(projectDirectory) .Execute(newArgs) @@ -112,7 +112,7 @@ namespace Microsoft.DotNet.Tests.EndToEnd new DotnetCommand() .WithWorkingDirectory(testProjectDirectory) .ExecuteWithCapturedOutput( - $"-d dependency-tool-invoker -c {configuration} -f netcoreapp2.0 portable") + $"-d dependency-tool-invoker -c {configuration} -f netcoreapp2.2 portable") .Should().Pass() .And.HaveStdOutContaining("Hello Portable World!");; } diff --git a/test/EndToEnd/GivenDotnetUsesDotnetTools.cs b/test/EndToEnd/GivenDotnetUsesDotnetTools.cs new file mode 100644 index 000000000..c9b46d6a9 --- /dev/null +++ b/test/EndToEnd/GivenDotnetUsesDotnetTools.cs @@ -0,0 +1,17 @@ +using FluentAssertions; +using Microsoft.DotNet.Tools.Test.Utilities; +using Xunit; + +namespace EndToEnd +{ + public class GivenDotnetUsesDotnetTools : TestBase + { + [Fact] + public void ThenOneDotnetToolsCanBeCalled() + { + new DotnetCommand() + .ExecuteWithCapturedOutput("dev-certs --help") + .Should().Pass(); + } + } +} diff --git a/test/EndToEnd/GivenSelfContainedAppsRollForward.cs b/test/EndToEnd/GivenSelfContainedAppsRollForward.cs new file mode 100644 index 000000000..080197472 --- /dev/null +++ b/test/EndToEnd/GivenSelfContainedAppsRollForward.cs @@ -0,0 +1,142 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Xml.Linq; +using FluentAssertions; +using Microsoft.DotNet.TestFramework; +using Microsoft.DotNet.Tools.Test.Utilities; +using NuGet.ProjectModel; +using NuGet.Versioning; +using Xunit; + +namespace EndToEnd +{ + public class GivenSelfContainedAppsRollForward : TestBase + { + + [Theory(Skip = "Runtime 1.1 support for openSUSE and Fedora 27 needed")] + // MemberData is used instead of InlineData here so we can access it in another test to + // verify that we are covering the latest release of .NET Core + [MemberData(nameof(SupportedNetCoreAppVersions))] + public void ItRollsForwardToTheLatestVersion(string minorVersion) + { + var _testInstance = TestAssets.Get("TestAppSimple") + .CreateInstance(identifier: minorVersion) + .WithSourceFiles(); + + string projectDirectory = _testInstance.Root.FullName; + + string projectPath = Path.Combine(projectDirectory, "TestAppSimple.csproj"); + + var project = XDocument.Load(projectPath); + var ns = project.Root.Name.Namespace; + + // Update TargetFramework to the right version of .NET Core + project.Root.Element(ns + "PropertyGroup") + .Element(ns + "TargetFramework") + .Value = "netcoreapp" + minorVersion; + + var rid = Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.GetRuntimeIdentifier(); + + // Set RuntimeIdentifier to opt in to roll-forward behavior + project.Root.Element(ns + "PropertyGroup") + .Add(new XElement(ns + "RuntimeIdentifier", rid)); + + project.Save(projectPath); + + // Get the version rolled forward to + new RestoreCommand() + .WithWorkingDirectory(projectDirectory) + .Execute() + .Should().Pass(); + + string assetsFilePath = Path.Combine(projectDirectory, "obj", "project.assets.json"); + var assetsFile = new LockFileFormat().Read(assetsFilePath); + + var rolledForwardVersion = GetNetCoreAppVersion(assetsFile); + rolledForwardVersion.Should().NotBeNull(); + + if (rolledForwardVersion.IsPrerelease) + { + // If this version of .NET Core is still prerelease, then: + // - Floating the patch by adding ".*" to the major.minor version won't work, but + // - There aren't any patches to roll-forward to, so we skip testing this until the version + // leaves prerelease. + return; + } + + // Float the RuntimeFrameworkVersion to get the latest version of the runtime available from feeds + Directory.Delete(Path.Combine(projectDirectory, "obj"), true); + project.Root.Element(ns + "PropertyGroup") + .Add(new XElement(ns + "RuntimeFrameworkVersion", $"{minorVersion}.*")); + project.Save(projectPath); + + new RestoreCommand() + .WithWorkingDirectory(projectDirectory) + .Execute() + .Should().Pass(); + + var floatedAssetsFile = new LockFileFormat().Read(assetsFilePath); + + var floatedVersion = GetNetCoreAppVersion(floatedAssetsFile); + floatedVersion.Should().NotBeNull(); + + rolledForwardVersion.ToNormalizedString().Should().BeEquivalentTo(floatedVersion.ToNormalizedString(), + "the latest patch version properties in Microsoft.NETCoreSdk.BundledVersions.props need to be updated " + + "(see MSBuildExtensions.targets in this repo)"); + } + + private NuGetVersion GetNetCoreAppVersion(LockFile lockFile) + { + return lockFile?.Targets?.SingleOrDefault(t => t.RuntimeIdentifier != null) + ?.Libraries?.SingleOrDefault(l => + string.Compare(l.Name, "Microsoft.NETCore.App", StringComparison.CurrentCultureIgnoreCase) == 0) + ?.Version; + } + + [Fact] + public void WeCoverLatestNetCoreAppRollForward() + { + // Run "dotnet new console", get TargetFramework property, and make sure it's covered in SupportedNetCoreAppVersions + using (DisposableDirectory directory = Temp.CreateDirectory()) + { + string projectDirectory = directory.Path; + + new NewCommandShim() + .WithWorkingDirectory(projectDirectory) + .Execute("console --no-restore") + .Should().Pass(); + + string projectPath = Path.Combine(projectDirectory, Path.GetFileName(projectDirectory) + ".csproj"); + + var project = XDocument.Load(projectPath); + var ns = project.Root.Name.Namespace; + + string targetFramework = project.Root.Element(ns + "PropertyGroup") + .Element(ns + "TargetFramework") + .Value; + + SupportedNetCoreAppVersions.Select(v => $"netcoreapp{v[0]}") + .Should().Contain(targetFramework, $"the {nameof(SupportedNetCoreAppVersions)} property should include the default version " + + "of .NET Core created by \"dotnet new\""); + + } + } + + public static IEnumerable SupportedNetCoreAppVersions + { + get + { + return new[] + { + "1.0", + "1.1", + "2.0", + "2.1" + }.Select(version => new object[] { version }); + } + } + } +} diff --git a/test/Microsoft.DotNet.Cli.Tests.sln b/test/Microsoft.DotNet.Cli.Tests.sln index 16df59a1d..6c9ab9014 100644 --- a/test/Microsoft.DotNet.Cli.Tests.sln +++ b/test/Microsoft.DotNet.Cli.Tests.sln @@ -1,8 +1,7 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26124.0 -MinimumVisualStudioVersion = 15.0.26124.0 +VisualStudioVersion = 15.0.27130.2024 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DotNet.TestFramework", "Microsoft.DotNet.TestFramework\Microsoft.DotNet.TestFramework.csproj", "{BEA33DFA-8559-4680-B40A-B522FBF37567}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DotNet.Tools.Tests.Utilities", "Microsoft.DotNet.Tools.Tests.Utilities\Microsoft.DotNet.Tools.Tests.Utilities.csproj", "{770FE8B9-6381-4328-AA36-D6A21114701E}" @@ -59,4 +58,7 @@ Global {AEB7B217-D4C4-46F1-9495-87F869F0ABE4}.Release|x86.ActiveCfg = Release|x86 {AEB7B217-D4C4-46F1-9495-87F869F0ABE4}.Release|x86.Build.0 = Release|x86 EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7AF6777A-0133-453A-B302-FDD974B8F39C} + EndGlobalSection EndGlobal diff --git a/test/Microsoft.DotNet.TestFramework/Microsoft.DotNet.TestFramework.csproj b/test/Microsoft.DotNet.TestFramework/Microsoft.DotNet.TestFramework.csproj index 4d3d8cf67..75dbb31cf 100644 --- a/test/Microsoft.DotNet.TestFramework/Microsoft.DotNet.TestFramework.csproj +++ b/test/Microsoft.DotNet.TestFramework/Microsoft.DotNet.TestFramework.csproj @@ -2,14 +2,16 @@ Microsoft.DotNet.TestFramework Class Library - netstandard1.5 + $(CliVersionPrefix) + netstandard2.0 ../../tools/Key.snk true true + 2.0.0 - + - + \ No newline at end of file diff --git a/test/Microsoft.DotNet.TestFramework/TestAssets.cs b/test/Microsoft.DotNet.TestFramework/TestAssets.cs index e4e94fe29..6d05788fd 100644 --- a/test/Microsoft.DotNet.TestFramework/TestAssets.cs +++ b/test/Microsoft.DotNet.TestFramework/TestAssets.cs @@ -59,8 +59,8 @@ namespace Microsoft.DotNet.TestFramework var assetDirectory = new DirectoryInfo(Path.Combine(_root.FullName, kind, name)); return new TestAssetInfo( - assetDirectory, - name, + assetDirectory, + name, this); } diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Assertions/CommandResultAssertions.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Assertions/CommandResultAssertions.cs index f8317f34a..bdb460302 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Assertions/CommandResultAssertions.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/Assertions/CommandResultAssertions.cs @@ -69,6 +69,13 @@ namespace Microsoft.DotNet.Tools.Test.Utilities return new AndConstraint(this); } + public AndConstraint NotHaveStdOutContaining(string pattern) + { + Execute.Assertion.ForCondition(!_commandResult.StdOut.Contains(pattern)) + .FailWith(AppendDiagnosticsTo($"The command output contained a result it should not have contained: {pattern}{Environment.NewLine}")); + return new AndConstraint(this); + } + public AndConstraint HaveStdOutMatching(string pattern, RegexOptions options = RegexOptions.None) { Execute.Assertion.ForCondition(Regex.Match(_commandResult.StdOut, pattern, options).Success) diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/BufferedReporter.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/BufferedReporter.cs new file mode 100644 index 000000000..d4c865b08 --- /dev/null +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/BufferedReporter.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using Microsoft.DotNet.Cli.Utils; + +namespace Microsoft.DotNet.Tools.Test.Utilities +{ + public class BufferedReporter : IReporter + { + public List Lines { get; private set; } = new List(); + + public void WriteLine(string message) + { + Lines.Add(message); + } + + public void WriteLine() + { + Lines.Add(""); + } + + public void Write(string message) + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/BuildServerCommand.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/BuildServerCommand.cs new file mode 100644 index 000000000..986587188 --- /dev/null +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/BuildServerCommand.cs @@ -0,0 +1,20 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Microsoft.DotNet.Cli.Utils; + +namespace Microsoft.DotNet.Tools.Test.Utilities +{ + public sealed class BuildServerCommand : DotnetCommand + { + public override CommandResult Execute(string args = "") + { + return base.Execute($"build-server {args}"); + } + + public override CommandResult ExecuteWithCapturedOutput(string args = "") + { + return base.ExecuteWithCapturedOutput($"build-server {args}"); + } + } +} diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/DotnetTestCommand.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/DotnetTestCommand.cs index 129080b8e..6e6dd548a 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/DotnetTestCommand.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/DotnetTestCommand.cs @@ -35,7 +35,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities return null; } - return $"/p:RuntimeIdentifier={_runtime}"; + return $"-property:RuntimeIdentifier={_runtime}"; } } } diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/RestoreCommand.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/RestoreCommand.cs index cc5804a1a..d2b43b702 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/RestoreCommand.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/RestoreCommand.cs @@ -35,7 +35,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities return null; } - return $"/p:RuntimeIdentifier={_runtime}"; + return $"-property:RuntimeIdentifier={_runtime}"; } } } diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/ToolCommand.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/ToolCommand.cs new file mode 100644 index 000000000..3a3589f73 --- /dev/null +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/ToolCommand.cs @@ -0,0 +1,20 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Microsoft.DotNet.Cli.Utils; + +namespace Microsoft.DotNet.Tools.Test.Utilities +{ + public sealed class ToolCommand : DotnetCommand + { + public override CommandResult Execute(string args = "") + { + return base.Execute($"tool {args}"); + } + + public override CommandResult ExecuteWithCapturedOutput(string args = "") + { + return base.ExecuteWithCapturedOutput($"tool {args}"); + } + } +} diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Microsoft.DotNet.Tools.Tests.Utilities.csproj b/test/Microsoft.DotNet.Tools.Tests.Utilities/Microsoft.DotNet.Tools.Tests.Utilities.csproj index 0a47e5b22..3bd17e138 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Microsoft.DotNet.Tools.Tests.Utilities.csproj +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/Microsoft.DotNet.Tools.Tests.Utilities.csproj @@ -1,12 +1,13 @@  Microsoft.DotNet.Tools.Tests.Utilities Class Library - netstandard1.5 + netstandard2.0 Microsoft.DotNet.Tools.Tests.Utilities ../../tools/Key.snk true true $(AssetTargetFallback);dotnet5.4;portable-net451+win8 + 2.0.0 @@ -16,7 +17,7 @@ - - + + \ No newline at end of file diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/NuGetFrameworks.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/NuGetFrameworks.cs new file mode 100644 index 000000000..a7ad2fa18 --- /dev/null +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/NuGetFrameworks.cs @@ -0,0 +1,17 @@ +using NuGet.Frameworks; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Microsoft.DotNet.Tools.Tests.Utilities +{ + // This class is for frameworks that aren't yet in NuGet's FrameworkConstants.CommonFrameworks class + public static class NuGetFrameworks + { + public static readonly NuGetFramework NetCoreApp21 + = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCoreApp, new Version(2, 1, 0, 0)); + + public static readonly NuGetFramework NetCoreApp22 + = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCoreApp, new Version(2, 2, 0, 0)); + } +} diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Properties/Properties.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Properties/Properties.cs index 98bfc776e..be0d4944b 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Properties/Properties.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/Properties/Properties.cs @@ -3,5 +3,8 @@ using System.Runtime.CompilerServices; -[assembly: InternalsVisibleTo("Microsoft.Extensions.DependencyModel.Tests , PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -[assembly: InternalsVisibleTo("Microsoft.DotNet.Configurer.UnitTests , PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] +[assembly: InternalsVisibleTo("Microsoft.Extensions.DependencyModel.Tests , PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] +[assembly: InternalsVisibleTo("Microsoft.DotNet.Configurer.UnitTests , PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] +[assembly: InternalsVisibleTo("dotnet.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] +[assembly: InternalsVisibleTo("Microsoft.DotNet.ToolPackage.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] +[assembly: InternalsVisibleTo("Microsoft.DotNet.ShellShim.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs index bf1cc2050..7de277852 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs @@ -15,6 +15,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities private static string s_buildRid; private string _artifacts; + private string _dotnetRoot; private string _builtDotnet; private string _nugetPackages; private string _stage2Sdk; @@ -37,9 +38,14 @@ namespace Microsoft.DotNet.Tools.Test.Utilities string directory = AppContext.BaseDirectory; #endif - while (!Directory.Exists(Path.Combine(directory, ".git")) && directory != null) + while (directory != null) { - directory = Directory.GetParent(directory).FullName; + var gitDirOrFile = Path.Combine(directory, ".git"); + if (Directory.Exists(gitDirOrFile) || File.Exists(gitDirOrFile)) + { + break; + } + directory = Directory.GetParent(directory)?.FullName; } if (directory == null) @@ -80,6 +86,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities public string Artifacts => _artifacts; public string BuiltDotnet => _builtDotnet; + public string DotnetRoot => _dotnetRoot; public string NugetPackages => _nugetPackages; public string Stage2Sdk => _stage2Sdk; public string Stage2WithBackwardsCompatibleRuntimesDirectory => _stage2WithBackwardsCompatibleRuntimesDirectory; @@ -101,6 +108,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities previousStage.ToString(), BuildRid); _builtDotnet = builtDotnet ?? Path.Combine(_artifacts, "intermediate", "sharedFrameworkPublish"); + _dotnetRoot = Path.Combine(_artifacts, "dotnet"); _nugetPackages = nugetPackages ?? Path.Combine(RepoRoot, ".nuget", "packages"); _stage2Sdk = Directory .EnumerateDirectories(Path.Combine(_artifacts, "dotnet", "sdk")) @@ -112,7 +120,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities _testPackages = Environment.GetEnvironmentVariable("TEST_PACKAGES"); if (string.IsNullOrEmpty(_testPackages)) { - throw new InvalidOperationException("TEST_PACKAGES environment variable not set"); + _testPackages = Path.Combine(_artifacts, "test", "packages"); } _testWorkingFolder = Path.Combine(RepoRoot, diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/UnixOnlyFactAttribute.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/UnixOnlyFactAttribute.cs new file mode 100644 index 000000000..78be9c856 --- /dev/null +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/UnixOnlyFactAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Microsoft.DotNet.PlatformAbstractions; +using Xunit; + +namespace Microsoft.DotNet.Tools.Test.Utilities +{ + public class UnixOnlyFactAttribute : FactAttribute + { + public UnixOnlyFactAttribute() + { + if (RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows) + { + this.Skip = "This test requires Unix to run"; + } + } + } +} diff --git a/testAsset.props b/testAsset.props index b130414b8..8d003d8ab 100644 --- a/testAsset.props +++ b/testAsset.props @@ -1,4 +1,8 @@ + + $(MSBuildThisFileDirectory) + + $(TEST_PACKAGES) diff --git a/tools/CrossGen.Dependencies/CrossGen.Dependencies.csproj b/tools/CrossGen.Dependencies/CrossGen.Dependencies.csproj index 33051ba8e..0ca594efa 100644 --- a/tools/CrossGen.Dependencies/CrossGen.Dependencies.csproj +++ b/tools/CrossGen.Dependencies/CrossGen.Dependencies.csproj @@ -1,11 +1,11 @@  - netcoreapp2.0 + netcoreapp2.2 $(SharedFrameworkRid) - + diff --git a/tools/Signing.Dependencies/Signing.Dependencies.csproj b/tools/Signing.Dependencies/Signing.Dependencies.csproj index dc8cd6914..f4ae4c40e 100644 --- a/tools/Signing.Dependencies/Signing.Dependencies.csproj +++ b/tools/Signing.Dependencies/Signing.Dependencies.csproj @@ -4,7 +4,7 @@ - +