Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pr cleanup #86

Merged
merged 18 commits into from
Jun 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 1 addition & 56 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# EditorConfig is awesome:http://EditorConfig.org
# From https://raw.githubusercontent.com/dotnet/roslyn/master/.editorconfig

# top-most EditorConfig file
root = true

# Don't use tabs for indentation.
[*]
charset = utf-8
charset = utf-8-bom
indent_style = space
# (Please don't specify an indent_size here; that has too many unintended consequences.)

Expand Down Expand Up @@ -35,57 +34,3 @@ indent_size = 2
[*.{json,yml,yaml}]
indent_size = 2

# Dotnet code style settings:
[*.{cs,vb}]
# Sort using and Import directives with System.* appearing first
dotnet_sort_system_directives_first = true
# Avoid "this." and "Me." if not 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

# Use language keywords instead of framework type names for type references
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion

# Suggest more modern language features when available
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion

dotnet_style_require_accessibility_modifiers = omit_if_default:suggestion

# CSharp code style settings:
[*.cs]
# Prefer "var" everywhere
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = true:suggestion

# Prefer method-like constructs to have a block body
csharp_style_expression_bodied_methods = false:none
csharp_style_expression_bodied_constructors = false:none
csharp_style_expression_bodied_operators = false:none

# Prefer property-like constructs to have an expression-body
csharp_style_expression_bodied_properties = true:none
csharp_style_expression_bodied_indexers = true:none
csharp_style_expression_bodied_accessors = true:none

# Suggest more modern language features when available
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
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion

# Newline settings
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
14 changes: 8 additions & 6 deletions .vsts-shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,17 @@ steps:

- powershell: |
mkdir $Env:Temp\Packages -Force
msbuild /Restore /t:Build
displayName: Build

- task: CopyFiles@2
displayName: Copy Files
- task: DotNetCoreCLI@2
inputs:
Contents: '$(System.DefaultWorkingDirectory)\~Packages\**\*.nupkg'
TargetFolder: '$(Build.ArtifactStagingDirectory)\Packages'
flattenFolders: true
command: pack
packagesToPack: Source/MSBuild.Sdk.Extras/MSBuild.Sdk.Extras.csproj
configuration: $(BuildConfiguration)
packDirectory: $(Build.ArtifactStagingDirectory)\Packages
verbosityPack: Minimal
displayName: Build Package


- ${{ parameters.signSteps }}

Expand Down
17 changes: 0 additions & 17 deletions Directory.Build.props

This file was deleted.

6 changes: 0 additions & 6 deletions Directory.Build.rsp

This file was deleted.

11 changes: 0 additions & 11 deletions Directory.Build.targets

This file was deleted.

64 changes: 0 additions & 64 deletions Docs/Using-Extras-SDK.md

This file was deleted.

53 changes: 53 additions & 0 deletions MSBuild.Sdk.Extras.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,22 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MSBuild.Sdk.Extras", "Source\MSBuild.Sdk.Extras\MSBuild.Sdk.Extras.csproj", "{4D8D241C-7316-4988-834B-0CDF8FC85298}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{26026DB4-DD68-43BF-8858-15AD2016C0B2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Classlibrary", "Tests\Classlibrary\Classlibrary.csproj", "{3DD9488D-7B27-40D8-B0B4-2C5BD316EE15}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClasslibraryAsSdk", "Tests\ClasslibraryAsSdk\ClasslibraryAsSdk.csproj", "{8FF61263-2FFC-4375-AF2F-4380AEE1D45F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfControlLibrary", "Tests\WpfControlLibrary\WpfControlLibrary.csproj", "{252480F0-3EC6-4D0B-8E8F-A1CD2D6E469D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfApp1", "Tests\WpfApp1\WpfApp1.csproj", "{B04AF907-A486-47A3-8DEA-A3225FE90121}"
EndProject
Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "WpfApp2", "Tests\WpfApp2\WpfApp2.vbproj", "{3B80BC9F-47DE-44EB-BCEE-798B6EE29F8D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfAppUsingSdk", "Tests\WpfAppUsingSdk\WpfAppUsingSdk.csproj", "{935E6481-E537-454F-B3C0-EF20C2AC2839}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClasslibWithNuGetSdkRef", "Tests\ClasslibWithNuGetSdkRef\ClasslibWithNuGetSdkRef.csproj", "{96E4CC91-6E55-4650-BA58-D6D1EF138EE2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -23,10 +39,47 @@ Global
{4D8D241C-7316-4988-834B-0CDF8FC85298}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4D8D241C-7316-4988-834B-0CDF8FC85298}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4D8D241C-7316-4988-834B-0CDF8FC85298}.Release|Any CPU.Build.0 = Release|Any CPU
{3DD9488D-7B27-40D8-B0B4-2C5BD316EE15}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3DD9488D-7B27-40D8-B0B4-2C5BD316EE15}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3DD9488D-7B27-40D8-B0B4-2C5BD316EE15}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3DD9488D-7B27-40D8-B0B4-2C5BD316EE15}.Release|Any CPU.Build.0 = Release|Any CPU
{8FF61263-2FFC-4375-AF2F-4380AEE1D45F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8FF61263-2FFC-4375-AF2F-4380AEE1D45F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8FF61263-2FFC-4375-AF2F-4380AEE1D45F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8FF61263-2FFC-4375-AF2F-4380AEE1D45F}.Release|Any CPU.Build.0 = Release|Any CPU
{252480F0-3EC6-4D0B-8E8F-A1CD2D6E469D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{252480F0-3EC6-4D0B-8E8F-A1CD2D6E469D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{252480F0-3EC6-4D0B-8E8F-A1CD2D6E469D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{252480F0-3EC6-4D0B-8E8F-A1CD2D6E469D}.Release|Any CPU.Build.0 = Release|Any CPU
{B04AF907-A486-47A3-8DEA-A3225FE90121}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B04AF907-A486-47A3-8DEA-A3225FE90121}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B04AF907-A486-47A3-8DEA-A3225FE90121}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B04AF907-A486-47A3-8DEA-A3225FE90121}.Release|Any CPU.Build.0 = Release|Any CPU
{3B80BC9F-47DE-44EB-BCEE-798B6EE29F8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B80BC9F-47DE-44EB-BCEE-798B6EE29F8D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B80BC9F-47DE-44EB-BCEE-798B6EE29F8D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3B80BC9F-47DE-44EB-BCEE-798B6EE29F8D}.Release|Any CPU.Build.0 = Release|Any CPU
{935E6481-E537-454F-B3C0-EF20C2AC2839}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{935E6481-E537-454F-B3C0-EF20C2AC2839}.Debug|Any CPU.Build.0 = Debug|Any CPU
{935E6481-E537-454F-B3C0-EF20C2AC2839}.Release|Any CPU.ActiveCfg = Release|Any CPU
{935E6481-E537-454F-B3C0-EF20C2AC2839}.Release|Any CPU.Build.0 = Release|Any CPU
{96E4CC91-6E55-4650-BA58-D6D1EF138EE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{96E4CC91-6E55-4650-BA58-D6D1EF138EE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{96E4CC91-6E55-4650-BA58-D6D1EF138EE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{96E4CC91-6E55-4650-BA58-D6D1EF138EE2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{3DD9488D-7B27-40D8-B0B4-2C5BD316EE15} = {26026DB4-DD68-43BF-8858-15AD2016C0B2}
{8FF61263-2FFC-4375-AF2F-4380AEE1D45F} = {26026DB4-DD68-43BF-8858-15AD2016C0B2}
{252480F0-3EC6-4D0B-8E8F-A1CD2D6E469D} = {26026DB4-DD68-43BF-8858-15AD2016C0B2}
{B04AF907-A486-47A3-8DEA-A3225FE90121} = {26026DB4-DD68-43BF-8858-15AD2016C0B2}
{3B80BC9F-47DE-44EB-BCEE-798B6EE29F8D} = {26026DB4-DD68-43BF-8858-15AD2016C0B2}
{935E6481-E537-454F-B3C0-EF20C2AC2839} = {26026DB4-DD68-43BF-8858-15AD2016C0B2}
{96E4CC91-6E55-4650-BA58-D6D1EF138EE2} = {26026DB4-DD68-43BF-8858-15AD2016C0B2}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {93349570-79D8-4F89-8E78-C66401620727}
EndGlobalSection
Expand Down
28 changes: 22 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MSBuild.Sdk.Extras
# MSBuild.Sdk.Extras

## Summary

Expand Down Expand Up @@ -38,12 +38,12 @@ The final project should look like this:
```xml
<Project Sdk="MSBuild.Sdk.Extras">
<PropertyGroup>
<TargetFrameworks>net46;uwp10.0;tizen40</TargetFrameworks>
<TargetFrameworks>net46;uap10.0.16299;tizen40</TargetFrameworks>
</PropertyGroup>
</Project>
```

You can put the `global.json` file next to your solution:
You can put the `global.json` file next to your solution (use the latest available version of the extras):

```json
{
Expand All @@ -61,7 +61,7 @@ Then again, you might want to override the version for just one project _OR_ if
```xml
<Project Sdk="MSBuild.Sdk.Extras/1.6.0">
<PropertyGroup>
<TargetFrameworks>net46;uwp10.0;tizen40</TargetFrameworks>
<TargetFrameworks>net46;uap10.0.16299;tizen40</TargetFrameworks>
</PropertyGroup>
</Project>
```
Expand All @@ -84,7 +84,7 @@ For those who are using in a `PackageReference` style, you can't do that with v2
1. The same as above, replace the Sdk attribute's value.
2. Remove the workaround import specified with the old way. The import property should be `MSBuildSdkExtrasTargets`.
3. Do a trial build and then compare your project with the templates in the repo's [TestProjects](/TestProjects) folder to troubleshoot any issues if you encounter them.
4. Please file a issue if you can't troubleshoot on your own. So, that I can help you with the issue you are facing.
4. Please file a issue.

Your project diff:

Expand All @@ -93,7 +93,7 @@ Your project diff:
+ <Project Sdk="MSBuild.Sdk.Extras">
<!-- OTHER PROPERTIES -->
<PropertyGroup>
<TargetFrameworks>net46;uwp10.0;tizen40</TargetFrameworks>
<TargetFrameworks>net46;uap10.0.16299;tizen40</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand All @@ -113,6 +113,22 @@ Your project diff:

**Note**: If you're using Visual Studio for Mac, currently there's no support for resolving SDKs from NuGet. Until VS for Mac supports it, you can use `PackageReference` style. Also you have to include any UWP or Tizen meta-package manually. If you are already using the package, just update it to get the new fixes.

## Release Notes

### 1.6.0

- A few properties have been changed, and the help is provided as a warning to use the new property names.

| Old Property | New Property/Behaviour |
| --- | ----
| `SuppressWarnIfOldSdkPack` | `ExtrasIgnoreOldSdkWarning` |
| `ExtrasUwpMetaPackageVersion` | `ExtrasImplicitPlatformPackageVersion` + `TargetFramework` condition |
| `ExtrasImplicitPlatformPackageDisabled` | `DisableImplicitFrameworkReferences` + `TargetFramework` condition |
| `EmbeddedResourceGeneratorVisibilityIsInternal` | opposite of `EmbeddedResourceGeneratedCodeIsPublic` |

- Support for WPF and Windows Forms requires an opt-in property to enable:
Set `ExtrasEnableWpfProjectSetup`/`ExtrasEnableWinFormsProjectSetup` to `true` to include required references and default items.

## Single or multi-targeting

Once this package is configured, you can now use any supported TFM in your `TargetFramework` or `TargetFrameworks` element. The supported TFM families are:
Expand Down
13 changes: 1 addition & 12 deletions Source/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<Import Project="$(MSBuildThisFileDirectory)..\$(MSBuildThisFile)"/>

<Import Project="$(BuildToolsPath)MSBuild.OutputPaths.props" Label="OutputPaths"/>

<PropertyGroup Label="Output">
<PublishFolder>~Packages</PublishFolder>
</PropertyGroup>

<PropertyGroup Label="OutputPaths">
<CustomBeforeSdkTargets>$(BuildToolsPath)MSBuild.OutputPaths.targets</CustomBeforeSdkTargets>
</PropertyGroup>

<Import Project="$(BuildToolsPath)MSBuild.Packaging.props"/>
<Import Project="..\Tools\MSBuild.Packaging.props"/>

<PropertyGroup Label="PackageInfo">
<Authors>Oren Novotny</Authors>
Expand Down
15 changes: 8 additions & 7 deletions Source/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<Import Project="$(BuildToolsPath)MSBuild.Packaging.targets"/>

<Import Project="$(MSBuildThisFileDirectory)..\$(MSBuildThisFile)"/>
<Import Project="..\Tools\MSBuild.Packaging.targets"/>

<PropertyGroup Condition="'$(IsCloudBuild)' == ''">
<IsCloudBuild Condition="'$(APPVEYOR)' != '' OR '$(TF_BUILD)' == 'true'">true</IsCloudBuild>
<IsCloudBuild Condition="'$(TF_BUILD)' == 'true'">true</IsCloudBuild>
<IsCloudBuild Condition="'$(IsCloudBuild)' == ''">false</IsCloudBuild>
</PropertyGroup>

<Import Project="$(BuildToolsPath)MSBuild.DevLocal.targets" Condition="'$(IsCloudBuild)' != 'true'"/>
<Import Project="..\Tools\MSBuild.DevLocal.targets" Condition="'$(IsCloudBuild)' != 'true'"/>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-62925-02" PrivateAssets="All"/>
</ItemGroup>

<ItemGroup Condition="'$(IsCloudBuild)' == 'true'">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-*" PrivateAssets="All"/>
<ItemGroup Condition="'$(IsCloudBuild)' == 'true'">
<PackageReference Include="Nerdbank.GitVersioning" Version="2.1.23" PrivateAssets="All"/>
</ItemGroup>

Expand Down
Loading