From f429f6c3710a361446c32d54f398c6db5db89620 Mon Sep 17 00:00:00 2001 From: Rob Mensching <rob@firegiant.com> Date: Sat, 22 Dec 2018 09:00:16 -0800 Subject: Update to latest Home\repo-template --- .editorconfig | 37 ++++++++++++++++++++++++++++++++++ appveyor.yml | 6 ++++++ src/Directory.Build.props | 8 ++------ src/Directory.Build.targets | 48 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 93 insertions(+), 6 deletions(-) create mode 100644 .editorconfig create mode 100644 src/Directory.Build.targets diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..1d72e683 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,37 @@ +# Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. +# +# Do NOT modify this file. Update the canonical version in Home\repo-template\src\.editorconfig +# then update all of the repos. + +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true + +[*.{cs,vb}] +dotnet_sort_system_directives_first = true + +[*.cs] +csharp_indent_case_contents = true : error +csharp_indent_switch_labels = true : error +csharp_new_line_before_open_brace = all +csharp_prefer_braces = true : error +csharp_style_expression_bodied_methods = when_on_single_line : suggestion +csharp_style_expression_bodied_constructors = when_on_single_line : suggestion +csharp_style_expression_bodied_operators = when_on_single_line : suggestion +csharp_style_expression_bodied_properties = when_on_single_line : suggestion +csharp_style_expression_bodied_indexers = when_on_single_line : suggestion +csharp_style_expression_bodied_accessors = when_on_single_line : suggestion +csharp_style_var_elsewhere = true : suggestion +csharp_style_var_for_built_in_types = true : suggestion +csharp_style_var_when_type_is_apparent = true : suggestion +dotnet_style_qualification_for_event = true : error +dotnet_style_qualification_for_field = true : error +dotnet_style_qualification_for_method = true : error +dotnet_style_qualification_for_property = true : error + +[*.targets] +indent_size = 2 diff --git a/appveyor.yml b/appveyor.yml index 0c74d54b..d55322da 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,3 +1,8 @@ +# Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. +# +# Do NOT modify this file. Update the canonical version in Home\repo-template\src\appveyor.yml +# then update all of the repos. + image: Visual Studio 2017 version: 0.0.0.{build} @@ -17,6 +22,7 @@ pull_requests: nuget: disable_publish_on_pr: true +skip_branch_with_pr: true skip_tags: true artifacts: diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 9eacf3f5..f09c622b 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> <!-- - Do NOT modify this file. Update the canonical version in Home\src\Directory.Build.props + Do NOT modify this file. Update the canonical version in Home\repo-template\src\Directory.Build.props then update all of the repos. --> <Project> @@ -10,7 +10,7 @@ <EnableSourceLink Condition=" '$(NCrunch)' == '1' ">false</EnableSourceLink> <ProjectName Condition=" '$(ProjectName)' == '' ">$(MSBuildProjectName)</ProjectName> - <BaseOutputPath>$(MSBuildThisFileDirectory)..\build\</BaseOutputPath> + <BaseOutputPath>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\build\))</BaseOutputPath> <BaseIntermediateOutputPath>$(BaseOutputPath)obj\$(ProjectName)\</BaseIntermediateOutputPath> <OutputPath>$(BaseOutputPath)$(Configuration)\</OutputPath> @@ -20,10 +20,6 @@ <Product>WiX Toolset</Product> </PropertyGroup> - <PropertyGroup> - <WixToolsetRootFolder>$(MSBuildThisFileDirectory)..\..\</WixToolsetRootFolder> - </PropertyGroup> - <Import Project="Cpp.Build.props" Condition=" '$(MSBuildProjectExtension)'=='.vcxproj' " /> <Import Project="Custom.Build.props" Condition=" Exists('Custom.Build.props') " /> </Project> diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets new file mode 100644 index 00000000..dac7452a --- /dev/null +++ b/src/Directory.Build.targets @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> +<!-- + Do NOT modify this file. Update the canonical version in Home\repo-template\src\Directory.Build.targets + then update all of the repos. +--> +<!-- + Replace PackageReferences with ProjectReferences when the projects can be found in .sln. + See the original here: https://github.com/dotnet/sdk/issues/1151#issuecomment-385133284 +--> +<Project> + <PropertyGroup> + <ReplacePackageReferences>true</ReplacePackageReferences> + <TheSolutionPath Condition=" '$(NCrunch)'=='' ">$(SolutionPath)</TheSolutionPath> + <TheSolutionPath Condition=" '$(NCrunch)'=='1' ">$(NCrunchOriginalSolutionPath)</TheSolutionPath> + </PropertyGroup> + + <Choose> + <When Condition="$(ReplacePackageReferences) AND '$(TheSolutionPath)' != '' AND '$(TheSolutionPath)' != '*undefined*' AND Exists('$(TheSolutionPath)')"> + + <PropertyGroup> + <SolutionFileContent>$([System.IO.File]::ReadAllText($(TheSolutionPath)))</SolutionFileContent> + <SmartSolutionDir>$([System.IO.Path]::GetDirectoryName( $(TheSolutionPath) ))</SmartSolutionDir> + <RegexPattern>(?<="[PackageName]", ")(.*)(?=", ")</RegexPattern> + </PropertyGroup> + + <ItemGroup> + <!-- Keep the identity of the PackageReference --> + <SmartPackageReference Include="@(PackageReference)"> + <PackageName>%(Identity)</PackageName> + <InSolution>$(SolutionFileContent.Contains('\%(Identity).csproj'))</InSolution> + </SmartPackageReference> + + <!-- Filter them by mapping them to another ItemGroup using the WithMetadataValue item function --> + <PackageInSolution Include="@(SmartPackageReference->WithMetadataValue('InSolution', True))"> + <Pattern>$(RegexPattern.Replace('[PackageName]','%(PackageName)') )</Pattern> + <SmartPath>$([System.Text.RegularExpressions.Regex]::Match('$(SolutionFileContent)', '%(Pattern)'))</SmartPath> + </PackageInSolution> + + <ProjectReference Include="@(PackageInSolution->'$(SmartSolutionDir)\%(SmartPath)' )"/> + + <!-- Remove the package references that are now referenced as projects --> + <PackageReference Remove="@(PackageInSolution->'%(PackageName)' )"/> + </ItemGroup> + + </When> + </Choose> +</Project> -- cgit v1.2.3-55-g6feb