From f77f39f015e05c8d9cc5b191b8ad33b536eedf0a Mon Sep 17 00:00:00 2001 From: Nirmal Guru Date: Mon, 25 Jun 2018 01:06:08 +0530 Subject: [PATCH] Feedback changes on #80 (#84) * Getting Ready for feedback Fix Local Build Fix NuSpec less packaging Upstream (build env) patches - SourceControlInformation fix - Add some Labels * Removed _SdkVisualStudioVersion workaround No Longer needed since we need VS/MSBuild 15 and above Silverlight and WP targets are not affected! * Privatized ('_' prefix) internal variable names So that we won't clash with other names that matches these! * clean up Inference targets upstream patch for Identifier check comments clean up * Update Desktop Items upstream patch: fixed EmbeddedResource Added section comments * Added WPF 'tmp_proj' workaround back Some people really need it!!! And no, they don't want to update to net472 * Updated VS Project System support upstream patches: Added Nesting and Dependent files support Workaround for CodeAnalysis, Intellisense, etc... * Build env updates Move packaging related props * WPF/WFF tmp ptoject workaround updates Use '_TargetAssemblyProjectName' Generalize Fixup target Drop '_Sdk' for user facing properties. * Update Project System Support Take 2: DynamicDependentFile not working, keep static evaluation for now! Include missing ProjectSystem.targets file * Prefix '_' to 'IsGeneratedProject' property Since, IsGeneratedProject is not supposed to be a user facing property! * Finalize LanguageTargets Remove Test Hooks Give a common property * Make 'MSBuild:Compile' into a property just like every other custom tool so that we can keep track of it! * Warn when using MSBuild Core for projects that require full MSBuild! * Compat with oboslete properties Issue a warning when using those properties * Add docs for using the SDK For now it only includes migration path from old SDK version. * Update placeholder URL Will work once the PR is merged * Fix condition on using MSBuild Core target Just a little fix --- .editorconfig | 6 +- Directory.Build.rsp | 2 +- Directory.Build.targets | 2 +- Docs/Using-Extras-SDK.md | 64 +++++++++++++++ Source/Directory.Build.props | 11 +-- Source/Directory.Build.targets | 10 +-- .../LanguageTargets/CheckMissing.targets | 5 +- .../Build/LanguageTargets/Desktop.targets | 25 ++++-- .../Build/LanguageTargets/Portable.targets | 10 +-- .../Build/LanguageTargets/Silverlight.targets | 12 ++- .../Build/LanguageTargets/Windows.targets | 9 +- .../LanguageTargets/WindowsPhone.targets | 20 +++-- .../Build/LanguageTargets/Xamarin.targets | 8 +- .../Build/MSBuild.NET.Extras.Sdk.props | 6 +- .../Build/MSBuild.NET.Extras.Sdk.targets | 8 +- .../Build/MSBuild.NET.Inference.targets | 10 ++- .../Build/MSBuild.NET.Platforms.targets | 13 ++- .../Build/MSBuild.NET.Workarounds.props | 34 ++++++-- .../Build/MSBuild.NET.Workarounds.targets | 82 +++++++++++++------ .../Build/MSBuild.Sdk.ExtrasShim.targets | 49 +++++++++++ .../DefaultItems/Platforms/Common.props | 2 +- .../DefaultItems/Platforms/Common.targets | 1 + .../Platforms/Desktop.VisualBasic.props | 2 +- .../DefaultItems/Platforms/Desktop.props | 14 +++- .../DefaultItems/Platforms/Desktop.targets | 15 ++-- .../DefaultItems/Platforms/Xaml.props | 9 +- .../DefaultItems/Platforms/Xaml.targets | 4 +- .../MSBuild.Sdk.Extras.csproj | 7 +- .../MSBuild.Sdk.Extras.nuspec | 9 +- .../MSBuild.NET.ProjectSystem.props | 29 +++++-- .../MSBuild.NET.ProjectSystem.targets | 11 +++ ...inition.xml => ApplicationDefinition.xaml} | 0 .../Rules/CSharp.ProjectItemsSchema.xaml | 14 ++++ .../Rules/{Page.xml => Page.xaml} | 0 .../Rules/ProjectItemsSchema.xaml | 50 +++++++++++ .../Rules/{Resource.xml => Resource.xaml} | 0 .../Rules/VisualBasic.ProjectItemsSchema.xaml | 22 +++++ .../Rules/Wpf.ProjectItemsSchema.xml | 13 --- TestProjects/Directory.Build.props | 6 +- TestProjects/Directory.Build.targets | 2 +- Tools/MSBuild.Packaging.props | 15 ++++ Tools/MSBuild.Packaging.targets | 56 ++++++++----- Tools/Sign-Package.ps1 | 10 +-- 43 files changed, 501 insertions(+), 176 deletions(-) create mode 100644 Docs/Using-Extras-SDK.md create mode 100644 Source/MSBuild.Sdk.Extras/Build/MSBuild.Sdk.ExtrasShim.targets create mode 100644 Source/MSBuild.Sdk.Extras/ProjectSystem/MSBuild.NET.ProjectSystem.targets rename Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/{ApplicationDefinition.xml => ApplicationDefinition.xaml} (100%) create mode 100644 Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/CSharp.ProjectItemsSchema.xaml rename Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/{Page.xml => Page.xaml} (100%) create mode 100644 Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/ProjectItemsSchema.xaml rename Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/{Resource.xml => Resource.xaml} (100%) create mode 100644 Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/VisualBasic.ProjectItemsSchema.xaml delete mode 100644 Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/Wpf.ProjectItemsSchema.xml create mode 100644 Tools/MSBuild.Packaging.props diff --git a/.editorconfig b/.editorconfig index 19693c8..e86a51e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,6 +6,7 @@ root = true # Don't use tabs for indentation. [*] +charset = utf-8 indent_style = space # (Please don't specify an indent_size here; that has too many unintended consequences.) @@ -17,7 +18,10 @@ indent_size = 4 # Code files [*.{cs,csx,vb,vbx}] indent_size = 4 -charset = utf-8-bom + +# Script files +[*.{cmd,bat,ps1}] +indent_size = 4 # Xml project files [*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] diff --git a/Directory.Build.rsp b/Directory.Build.rsp index ade9e42..d71a0fc 100644 --- a/Directory.Build.rsp +++ b/Directory.Build.rsp @@ -1,6 +1,6 @@ /MaxCPUCount /BinaryLogger /DetailedSummary -/Verbosity:minimal +/Verbosity:normal /NodeReuse:false /Restore \ No newline at end of file diff --git a/Directory.Build.targets b/Directory.Build.targets index 859ccb0..4d0798c 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -6,6 +6,6 @@ $(DefaultItemExcludes)$(_ProjectItemExcludes) - + \ No newline at end of file diff --git a/Docs/Using-Extras-SDK.md b/Docs/Using-Extras-SDK.md new file mode 100644 index 0000000..2afe373 --- /dev/null +++ b/Docs/Using-Extras-SDK.md @@ -0,0 +1,64 @@ +# Using the Extras Sdk + +## Migrate from previous versions + +If you're using v1.6+ of the Extras SDK, then you would know that few properties have been changed, and the help is provided as a warning to use the new property names. + +If you're not using the new version, and/or wish to migrate your build system to support this version, here are the instructions to do just that: + +0. BACK UP! BACK UP! (if you're not using version control) + +1. First remove any workarounds (check the closed issues first) that you've applied using the previous Extras SDK version. + +2. If you're using Visual Studio IDE v15.6+ (if you can update, then update) and use SDK style. + +Your project diff: + +```diff +- ++ + + + net46;uwp10.0;tizen40 + + + +- + + + +- + + +``` + +```diff +- PackageReference style ++ SDK style +``` + +More info: [ReadMe](../README.md) + +3. Remove any UWP/Tizen package referneces as they are implicitly included if you're using SDK style. + +4. Rename these properties to the new ones + +### User facing properties + +| OLD Property | NEW Property/Behaviour | +| --- | ---- | +| `ExtrasSkipLibraryLayout` | `SkipWindowsLibraryLayout` | +| `_SdkSetAndroidResgenFile` | `IncludeAndroidResgenFile` | +| `SuppressWarnIfOldSdkPack` | `IgnoreOldSdkWarning` | +| `ExtrasUwpMetaPackageVersion` | `_ImplicitPlatformPackageVersion` + `TargetFramework` condition | +| `ExtrasImplicitPlatformPackageDisabled` | `DisableImplicitFrameworkReferences` + `TargetFramework` condition | +| `ExtrasImplicitPlatformPackageIsPrivate` | Auto set for library like items | +| `EmbeddedResourceGeneratorVisibilityIsInternal` | opposite of `EmbeddedResourceGeneratedCodeIsPublic` | + +5. If you're using it for WinForms/WPF, you can set `EnableWpfProjectSetup`/`EnableWinFormsProjectSetup` to `true` to include required references and default items. + +6. That's it you're done! If you find any issues during build, check with the [Templates/TestProjects](../TestProjects) included and create an issue if that doesn't help. + +## Customizing your Build setup + +TBD \ No newline at end of file diff --git a/Source/Directory.Build.props b/Source/Directory.Build.props index 595f821..a7fa857 100644 --- a/Source/Directory.Build.props +++ b/Source/Directory.Build.props @@ -2,9 +2,9 @@ - + - + ~Packages @@ -12,12 +12,7 @@ $(BuildToolsPath)MSBuild.OutputPaths.targets - - true - false - true - true - + Oren Novotny diff --git a/Source/Directory.Build.targets b/Source/Directory.Build.targets index 96b2534..89438ae 100644 --- a/Source/Directory.Build.targets +++ b/Source/Directory.Build.targets @@ -1,6 +1,6 @@ - + @@ -12,14 +12,8 @@ + - - true - - - - - \ No newline at end of file diff --git a/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/CheckMissing.targets b/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/CheckMissing.targets index 9b51fd7..5c91d0c 100644 --- a/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/CheckMissing.targets +++ b/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/CheckMissing.targets @@ -5,14 +5,13 @@ - <_SdkFallbackLanguageTargets Condition="'$(IsMultiTargetingBuild)' != 'true'">$(MSBuildToolsPath)\Microsoft.Common.CurrentVersion.targets - <_SdkFallbackLanguageTargets Condition="'$(IsMultiTargetingBuild)' == 'true'">$(MSBuildToolsPath)\Microsoft.Common.CrossTargeting.targets + <_SdkFallbackLanguageTargets>$(MSBuildToolsPath)\Microsoft.Common.targets - + diff --git a/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/Desktop.targets b/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/Desktop.targets index dccb0e1..c44ff31 100644 --- a/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/Desktop.targets +++ b/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/Desktop.targets @@ -4,20 +4,27 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - <_SdkDesktopTargets Condition="'$(_LanguageSourceName)' != 'FSharp'">$(MSBuildExtensionsPath)\$(_SdkVisualStudioVersion)\Bin\Microsoft.$(_LanguageSourceName).targets - <_SdkDesktopTargets Condition="'$(_LanguageSourceName)' == 'FSharp'">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(_SdkVisualStudioVersion)\FSharp\Microsoft.FSharp.Targets + + $(ToolDepsJsonGeneratorProject.TrimEnd('GenerateDeps\GenerateDeps.proj')) + $(_NugetFallbackFolder.TrimEnd('..\..\..\..\NuGetFallbackFolder')) + $(NETCoreSdkBundledVersionsProps.TrimEnd('..\..\..\Microsoft.NETCoreSdk.BundledVersions.props')) + + + + <_FSharpTargetsPath>$(MicrosoftNETSdkTargetsPath)Microsoft.NET.Sdk.FSharpTargetsShim.targets + <_FSharpTargetsPath Condition="!Exists('$(_FSharpTargetsPath)')">$(MicrosoftNETSdkTargetsPath)Microsoft.NET.Sdk.FSharp.targets + + + + <_SdkLanguageTargets Condition="'$(_LanguageSourceName)' != 'FSharp'">$(MSBuildToolsPath)\Microsoft.$(_LanguageSourceName).targets + <_SdkLanguageTargets Condition="'$(_LanguageSourceName)' == 'FSharp'">$(_FSharpTargetsPath) - <_SdkLanguageTargetsMissing Condition="!Exists('$(_SdkDesktopTargets)')">true + <_SdkLanguageTargetsMissing Condition="!Exists('$(_SdkLanguageTargets)')">true - + \ No newline at end of file diff --git a/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/Portable.targets b/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/Portable.targets index 3fad9ca..977f4d3 100644 --- a/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/Portable.targets +++ b/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/Portable.targets @@ -4,16 +4,16 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - <_SdkPortableTargets Condition="'$(_LanguageSourceName)' != 'FSharp'">$(MSBuildExtensionsPath)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.$(_LanguageSourceName).targets - <_SdkPortableTargets Condition="'$(_LanguageSourceName)' == 'FSharp'">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(_SdkVisualStudioVersion)\FSharp\Microsoft.Portable.FSharp.Targets + + <_SdkLanguageTargets Condition="'$(_LanguageSourceName)' != 'FSharp'">$(MSBuildExtensionsPath)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.$(_LanguageSourceName).targets + <_SdkLanguageTargets Condition="'$(_LanguageSourceName)' == 'FSharp'">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.Portable.FSharp.Targets - <_SdkLanguageTargetsMissing Condition="!Exists('$(_SdkPortableTargets)')">true + <_SdkLanguageTargetsMissing Condition="!Exists('$(_SdkLanguageTargets)')">true - + \ No newline at end of file diff --git a/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/Silverlight.targets b/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/Silverlight.targets index 833dde4..5f382b3 100644 --- a/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/Silverlight.targets +++ b/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/Silverlight.targets @@ -7,11 +7,17 @@ <_SdkMSBuildExtensionsPath>$(MSBuildProgramFiles32)\MSBuild - <_SdkSilverlightTargets Condition="'$(_SdkSilverlightTargets)' == ''">$(_SdkMSBuildExtensionsPath)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.$(_LanguageSourceName).targets - <_SdkLanguageTargetsMissing Condition="!Exists('$(_SdkSilverlightTargets)')">true - + + <_SdkLanguageTargets>$(_SdkMSBuildExtensionsPath)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.$(_LanguageSourceName).targets + + + + <_SdkLanguageTargetsMissing Condition="!Exists('$(_SdkLanguageTargets)')">true + + + \ No newline at end of file diff --git a/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/Windows.targets b/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/Windows.targets index cb4704b..f0d6afd 100644 --- a/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/Windows.targets +++ b/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/Windows.targets @@ -5,11 +5,14 @@ - <_SdkWindowsTargets Condition="'$(_SdkWindowsTargets)' == ''">$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(_SdkVisualStudioVersion)\Microsoft.Windows.UI.Xaml.$(_LanguageSourceName).targets - <_SdkLanguageTargetsMissing Condition="!Exists('$(_SdkWindowsTargets)')">true + <_SdkLanguageTargets>$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.$(_LanguageSourceName).targets - + + <_SdkLanguageTargetsMissing Condition="!Exists('$(_SdkLanguageTargets)')">true + + + \ No newline at end of file diff --git a/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/WindowsPhone.targets b/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/WindowsPhone.targets index 0686192..636e1b3 100644 --- a/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/WindowsPhone.targets +++ b/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/WindowsPhone.targets @@ -7,15 +7,19 @@ <_SdkMSBuildExtensionsPath>$(MSBuildProgramFiles32)\MSBuild - <_SdkWindowsPhoneOverridesTargets Condition="'$(_SdkWindowsPhoneOverridesTargets)' == ''">$(_SdkMSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).$(TargetFrameworkVersion).Overrides.targets - <_SdkWindowsPhoneTargets Condition="'$(_SdkWindowsPhoneTargets)' == ''">$(_SdkMSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).$(_LanguageSourceName).targets - <_SdkLanguageTargetsMissing Condition="!Exists('$(_SdkWindowsPhoneTargets)')">true - - - - - + + <_SdkLanguageTargets>$(_SdkMSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).$(_LanguageSourceName).targets + <_SdkLanguageOverridesTargets>$(_SdkMSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).$(TargetFrameworkVersion).Overrides.targets + + + + <_SdkLanguageTargetsMissing Condition="!Exists('$(_SdkLanguageTargets)')">true + + + + + \ No newline at end of file diff --git a/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/Xamarin.targets b/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/Xamarin.targets index 7dcf322..27491b1 100644 --- a/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/Xamarin.targets +++ b/Source/MSBuild.Sdk.Extras/Build/LanguageTargets/Xamarin.targets @@ -20,15 +20,15 @@ <_SdkTargetsImportType Condition="'$(IsApplePlatform)' == 'true'">ObjCBinding.$(_LanguageSourceName) - - <_SdkXamarinPlatformTargets>$(MSBuildExtensionsPath)\Xamarin\$(_SdkTargetPlatformName)\Xamarin.$(_SdkTargetPlatformName).$(_SdkTargetsImportType).targets + + <_SdkLanguageTargets>$(MSBuildExtensionsPath)\Xamarin\$(_SdkTargetPlatformName)\Xamarin.$(_SdkTargetPlatformName).$(_SdkTargetsImportType).targets - <_SdkLanguageTargetsMissing Condition="!Exists('$(_SdkXamarinPlatformTargets)')">true + <_SdkLanguageTargetsMissing Condition="!Exists('$(_SdkLanguageTargets)')">true - + diff --git a/Source/MSBuild.Sdk.Extras/Build/MSBuild.NET.Extras.Sdk.props b/Source/MSBuild.Sdk.Extras/Build/MSBuild.NET.Extras.Sdk.props index 0d2fa46..bd0b68e 100644 --- a/Source/MSBuild.Sdk.Extras/Build/MSBuild.NET.Extras.Sdk.props +++ b/Source/MSBuild.Sdk.Extras/Build/MSBuild.NET.Extras.Sdk.props @@ -27,7 +27,7 @@ - + <_LanguageSourceName>Common @@ -40,6 +40,10 @@ $(DefaultLanguage) + + 15.0 + + Properties My Project diff --git a/Source/MSBuild.Sdk.Extras/Build/MSBuild.NET.Extras.Sdk.targets b/Source/MSBuild.Sdk.Extras/Build/MSBuild.NET.Extras.Sdk.targets index d74f43b..453f9c9 100644 --- a/Source/MSBuild.Sdk.Extras/Build/MSBuild.NET.Extras.Sdk.targets +++ b/Source/MSBuild.Sdk.Extras/Build/MSBuild.NET.Extras.Sdk.targets @@ -4,15 +4,12 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + true - - <_SdkVisualStudioVersion>$(VisualStudioVersion) - <_SdkVisualStudioVersion Condition="'$(_SdkVisualStudioVersion)' == '' OR '$(_SdkVisualStudioVersion)' < '14.0'">15.0 - - @@ -25,5 +22,6 @@ + \ No newline at end of file diff --git a/Source/MSBuild.Sdk.Extras/Build/MSBuild.NET.Inference.targets b/Source/MSBuild.Sdk.Extras/Build/MSBuild.NET.Inference.targets index e75684f..b53f65f 100644 --- a/Source/MSBuild.Sdk.Extras/Build/MSBuild.NET.Inference.targets +++ b/Source/MSBuild.Sdk.Extras/Build/MSBuild.NET.Inference.targets @@ -5,19 +5,21 @@ - + $(TargetFramework.ToLowerInvariant()) net40-client + net35-cf + netmf44 net45 - wp8 wpa81 win8 + wp8 sl5 - + .NETFramework .NETStandard .NETCoreApp diff --git a/Source/MSBuild.Sdk.Extras/Build/MSBuild.NET.Platforms.targets b/Source/MSBuild.Sdk.Extras/Build/MSBuild.NET.Platforms.targets index 1bb23e4..985bcae 100644 --- a/Source/MSBuild.Sdk.Extras/Build/MSBuild.NET.Platforms.targets +++ b/Source/MSBuild.Sdk.Extras/Build/MSBuild.NET.Platforms.targets @@ -11,10 +11,11 @@ <_SdkPlatformName Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">Desktop <_SdkPlatformName Condition="$(TargetFrameworkIdentifier.StartsWith('Xamarin'))">Xamarin <_SdkPlatformName Condition="'$(TargetFrameworkIdentifier)' == 'MonoAndroid' OR '$(TargetFrameworkIdentifier)' == 'MonoTouch' OR '$(TargetFrameworkIdentifier)' == 'MonoMac'">Xamarin + - <_SdkPlatformTargets>$(MSBuildThisFileDirectory)Platforms\$(_SdkPlatformName).targets - <_SdkLanguageTargets>$(MSBuildThisFileDirectory)LanguageTargets\$(_SdkPlatformName).targets - $(_SdkLanguageTargets) + + $(MSBuildThisFileDirectory)LanguageTargets\$(_SdkPlatformName).targets + @@ -23,7 +24,11 @@ $(TargetFramework.Replace('.','_').Replace('-','_').ToUpperInvariant()) - + + $(MSBuildThisFileDirectory)Platforms\$(_SdkPlatformName).targets + + + diff --git a/Source/MSBuild.Sdk.Extras/Build/MSBuild.NET.Workarounds.props b/Source/MSBuild.Sdk.Extras/Build/MSBuild.NET.Workarounds.props index 19660f5..6027881 100644 --- a/Source/MSBuild.Sdk.Extras/Build/MSBuild.NET.Workarounds.props +++ b/Source/MSBuild.Sdk.Extras/Build/MSBuild.NET.Workarounds.props @@ -8,24 +8,42 @@ true - - _[a-z0-9]{8}_wpftmp - true + <_GeneratedProjectSuffixPattern>_[a-z0-9]{8}_wpftmp - - <_OriginalProjectName>$(_TargetAssemblyProjectName) - <_OriginalProjectName Condition="'$(_OriginalProjectName)' == ''">$([System.Text.RegularExpressions.Regex]::Replace('$(MSBuildProjectName)', '$(GeneratedProjectSuffixPattern)', '')) + + + + + <_IsGeneratedProject>true + <_OriginalProjectName Condition="'$(_OriginalProjectName)' == ''">$(AssemblyName) + <_LanguageSourceName Condition="Exists('$(MSBuildProjectDirectory)\$(_OriginalProjectName).csproj')">CSharp + <_LanguageSourceName Condition="Exists('$(MSBuildProjectDirectory)\$(_OriginalProjectName).vbproj')">VisualBasic + + + + + + + <_IsGeneratedProject>true + <_OriginalProjectName Condition="'$(_OriginalProjectName)' == ''">$(_TargetAssemblyProjectName) + <_OriginalProjectName Condition="'$(_OriginalProjectName)' == ''">$([System.Text.RegularExpressions.Regex]::Replace('$(MSBuildProjectName)', '$(_GeneratedProjectSuffixPattern)%24', '')) + + + + + + + <_OriginalProjectFile>$(_OriginalProjectName)$(MSBuildProjectExtension) <_OriginalProjectExtensionsPath Condition="$(MSBuildProjectExtensionsPath.Contains('$(MSBuildProjectName)'))">$(MSBuildProjectExtensionsPath.Replace('$(MSBuildProjectName)', '$(_OriginalProjectName)')) - $(_OriginalProjectExtensionsPath) diff --git a/Source/MSBuild.Sdk.Extras/Build/MSBuild.NET.Workarounds.targets b/Source/MSBuild.Sdk.Extras/Build/MSBuild.NET.Workarounds.targets index 283d026..061dec6 100644 --- a/Source/MSBuild.Sdk.Extras/Build/MSBuild.NET.Workarounds.targets +++ b/Source/MSBuild.Sdk.Extras/Build/MSBuild.NET.Workarounds.targets @@ -4,29 +4,61 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + <_IgnoreMSBuildCoreWarning>true + <_IgnoreMSBuildCoreWarning Condition="'$(EnableWpfProjectSetup)' == 'true'">false + <_IgnoreMSBuildCoreWarning Condition="'$(_SdkPlatformName)' == 'Silverlight'">false + <_IgnoreMSBuildCoreWarning Condition="$(_SdkPlatformName.StartsWith('Windows'))">false + + + + + + + <_IgnoreMissingLanguageTargetsError>$(_SdkLanguageTargetsMissing) + + + + + - false + false true - - + Condition="'$(_IsGeneratedProject)' == 'true' AND '$(DisableFixupPropertiesWithGeneratedSuffix)' != 'true'"> + + <_RootNamespaceInGeneratedProject>$(RootNamespace) - $([System.Text.RegularExpressions.Regex]::Replace('$(_RootNamespaceInGeneratedProject)', '$(GeneratedProjectSuffixPattern)', '')) + + + + $(_OriginalProjectName) + $(_RootNamespaceInGeneratedProject.Replace('$(MSBuildProjectName)', '$(_OriginalProjectName)')) + + + $([System.Text.RegularExpressions.Regex]::Replace('$(_RootNamespaceInGeneratedProject)', '$(_GeneratedProjectSuffixPattern)', '')) + $([System.Text.RegularExpressions.Regex]::Replace('$(_RootNamespaceInGeneratedProject)', $(_GeneratedProjectSuffixPattern.Replace('_', '.')), '')) - + + + @@ -38,25 +70,27 @@ --> + Condition="'@(ApplicationDefinition)' != '' OR '@(Page)' != '' OR '@(Resource)' != ''"> false + true - + + + + $(TargetsForTfmSpecificContentInPackage);_IncludeWindowsLibraryLayoutItems + + + - - - $(TargetsForTfmSpecificContentInPackage);IncludeWindowsLibraryLayoutItems - - - @@ -85,15 +119,15 @@ - + - WarnWhenUsingOldSdk;$(PackDependsOn) - true + _WarnWhenUsingOldSdk;$(PackDependsOn) + true - - + + \ No newline at end of file diff --git a/Source/MSBuild.Sdk.Extras/Build/MSBuild.Sdk.ExtrasShim.targets b/Source/MSBuild.Sdk.Extras/Build/MSBuild.Sdk.ExtrasShim.targets new file mode 100644 index 0000000..3e2454b --- /dev/null +++ b/Source/MSBuild.Sdk.Extras/Build/MSBuild.Sdk.ExtrasShim.targets @@ -0,0 +1,49 @@ + + + + false + true + + + + $(SuppressWarnIfOldSdkPack) + $(ExtrasSkipLibraryLayout) + $(_SdkSetAndroidResgenFile) + + + + <_ImplicitPlatformPackageVersion Condition="$(TargetFramework.StartsWith('uap'))">$(ExtrasUwpMetaPackageVersion) + $(ExtrasImplicitPlatformPackageDisabled) + + + + + + + + + + + <_SdkObsoleteProperty Include="ExtrasSkipLibraryLayout" Replacement="SkipWindowsLibraryLayout" Condition="'$(ExtrasSkipLibraryLayout)' != ''"/> + <_SdkObsoleteProperty Include="_SdkSetAndroidResgenFile" Replacement="IncludeAndroidResgenFile" Condition="'$(_SdkSetAndroidResgenFile)' != ''"/> + <_SdkObsoleteProperty Include="SuppressWarnIfOldSdkPack" Replacement="IgnoreOldSdkWarning" Condition="'$(SuppressWarnIfOldSdkPack)' != ''"/> + <_SdkObsoleteProperty Include="ExtrasUwpMetaPackageVersion" Replacement="_ImplicitPlatformPackageVersion (with TargetFramework condition)" Condition="'$(ExtrasUwpMetaPackageVersion)' != ''"/> + <_SdkObsoleteProperty Include="ExtrasImplicitPlatformPackageDisabled" Replacement="DisableImplicitFrameworkReferences (with TargetFramework condition)" Condition="'$(ExtrasImplicitPlatformPackageDisabled)' != ''"/> + <_SdkObsoleteProperty Include="ExtrasImplicitPlatformPackageIsPrivate" Condition="'$(ExtrasImplicitPlatformPackageIsPrivate)' != ''"/> + <_SdkObsoleteProperty Include="EmbeddedResourceGeneratorVisibilityIsInternal" Replacement="EmbeddedResourceGeneratedCodeIsPublic" Condition="'$(EmbeddedResourceGeneratorVisibilityIsInternal)' != ''"/> + + + + + + + + + + \ No newline at end of file diff --git a/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Common.props b/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Common.props index 4b45eb8..8ef475a 100644 --- a/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Common.props +++ b/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Common.props @@ -16,7 +16,7 @@ Designer - MSBuild:Compile + $(DefaultGeneratorTool) diff --git a/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Common.targets b/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Common.targets index 41aa9ef..0672b92 100644 --- a/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Common.targets +++ b/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Common.targets @@ -5,6 +5,7 @@ + MSBuild:Compile .Designer diff --git a/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Desktop.VisualBasic.props b/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Desktop.VisualBasic.props index a2154ed..1bad64e 100644 --- a/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Desktop.VisualBasic.props +++ b/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Desktop.VisualBasic.props @@ -12,7 +12,7 @@ - MSBuild:Compile + $(DefaultGeneratorTool) diff --git a/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Desktop.props b/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Desktop.props index 1338c5f..289bd8f 100644 --- a/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Desktop.props +++ b/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Desktop.props @@ -4,9 +4,11 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + - MSBuild:Compile + $(DefaultGeneratorTool) @@ -32,19 +34,23 @@ $([MSBuild]::ValueOrDefault('%(Filename)', '').Replace('$(DefaultDesignerFileSuffix)', '$(DefaultLanguageSourceExtension)')) + + + - $([System.Text.RegularExpressions.Regex]::Replace('%(FileName)', '$(LangIdRegEx)|\$(DefaultDesignerFileSuffix)', '%(DefaultLanguageSourceExtension)')) + %(Filename)$(DefaultLanguageSourceExtension) - + + diff --git a/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Desktop.targets b/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Desktop.targets index 8da4405..7d85509 100644 --- a/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Desktop.targets +++ b/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Desktop.targets @@ -21,8 +21,8 @@ - $(AppDesignerFolder)\app.manifest - app.manifest + $(AppDesignerFolder)\App.manifest + App.manifest @@ -35,29 +35,32 @@ PublicSettingsSingleFileGenerator + + true $(EnableDefaultWpfItems) true + + true true false - - - {94E38DFF-614B-4CBD-B67C-F211BB35CE8B} + + true true - + \ No newline at end of file diff --git a/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Xaml.props b/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Xaml.props index ce1905b..448e243 100644 --- a/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Xaml.props +++ b/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Xaml.props @@ -7,15 +7,15 @@ Designer - MSBuild:Compile + $(DefaultGeneratorTool) Designer - MSBuild:Compile + $(DefaultGeneratorTool) Designer - MSBuild:Compile + $(DefaultGeneratorTool) @@ -41,6 +41,9 @@ $(XamlCodeGeneratorTool) + + + %(Filename) diff --git a/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Xaml.targets b/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Xaml.targets index b6d1346..8010322 100644 --- a/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Xaml.targets +++ b/Source/MSBuild.Sdk.Extras/DefaultItems/Platforms/Xaml.targets @@ -26,11 +26,11 @@ - MSBuild:Compile + $(DefaultGeneratorTool) - MSBuild:XamlIntelliSenseFileGenerator + XamlIntelliSenseFileGenerator - - - \ No newline at end of file diff --git a/Source/MSBuild.Sdk.Extras/MSBuild.Sdk.Extras.nuspec b/Source/MSBuild.Sdk.Extras/MSBuild.Sdk.Extras.nuspec index 6c3218b..f96f878 100644 --- a/Source/MSBuild.Sdk.Extras/MSBuild.Sdk.Extras.nuspec +++ b/Source/MSBuild.Sdk.Extras/MSBuild.Sdk.Extras.nuspec @@ -12,17 +12,14 @@ $licenseUrl$ $projectUrl$ $releaseNotes$ - + false true - + - - - - + \ No newline at end of file diff --git a/Source/MSBuild.Sdk.Extras/ProjectSystem/MSBuild.NET.ProjectSystem.props b/Source/MSBuild.Sdk.Extras/ProjectSystem/MSBuild.NET.ProjectSystem.props index fda5f76..a749dce 100644 --- a/Source/MSBuild.Sdk.Extras/ProjectSystem/MSBuild.NET.ProjectSystem.props +++ b/Source/MSBuild.Sdk.Extras/ProjectSystem/MSBuild.NET.ProjectSystem.props @@ -4,19 +4,38 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - + + + + + + + + + Project + + Project - + File;BrowseObject - + File;BrowseObject - + File;BrowseObject + + + + + + + + + \ No newline at end of file diff --git a/Source/MSBuild.Sdk.Extras/ProjectSystem/MSBuild.NET.ProjectSystem.targets b/Source/MSBuild.Sdk.Extras/ProjectSystem/MSBuild.NET.ProjectSystem.targets new file mode 100644 index 0000000..ae19534 --- /dev/null +++ b/Source/MSBuild.Sdk.Extras/ProjectSystem/MSBuild.NET.ProjectSystem.targets @@ -0,0 +1,11 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + + <_SdkProjectSystemRulesDirectory>$(MSBuildThisFileDirectory)Rules\ + + + \ No newline at end of file diff --git a/Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/ApplicationDefinition.xml b/Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/ApplicationDefinition.xaml similarity index 100% rename from Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/ApplicationDefinition.xml rename to Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/ApplicationDefinition.xaml diff --git a/Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/CSharp.ProjectItemsSchema.xaml b/Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/CSharp.ProjectItemsSchema.xaml new file mode 100644 index 0000000..1053f3b --- /dev/null +++ b/Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/CSharp.ProjectItemsSchema.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/Page.xml b/Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/Page.xaml similarity index 100% rename from Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/Page.xml rename to Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/Page.xaml diff --git a/Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/ProjectItemsSchema.xaml b/Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/ProjectItemsSchema.xaml new file mode 100644 index 0000000..b8b026a --- /dev/null +++ b/Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/ProjectItemsSchema.xaml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/Resource.xml b/Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/Resource.xaml similarity index 100% rename from Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/Resource.xml rename to Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/Resource.xaml diff --git a/Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/VisualBasic.ProjectItemsSchema.xaml b/Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/VisualBasic.ProjectItemsSchema.xaml new file mode 100644 index 0000000..5adc8b5 --- /dev/null +++ b/Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/VisualBasic.ProjectItemsSchema.xaml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/Wpf.ProjectItemsSchema.xml b/Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/Wpf.ProjectItemsSchema.xml deleted file mode 100644 index eb4002f..0000000 --- a/Source/MSBuild.Sdk.Extras/ProjectSystem/Rules/Wpf.ProjectItemsSchema.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/TestProjects/Directory.Build.props b/TestProjects/Directory.Build.props index dd3fe21..da852df 100644 --- a/TestProjects/Directory.Build.props +++ b/TestProjects/Directory.Build.props @@ -2,14 +2,14 @@ - + $(SolutionDir) $(SolutionDir) - + - + $(BuildToolsPath)MSBuild.OutputPaths.targets diff --git a/TestProjects/Directory.Build.targets b/TestProjects/Directory.Build.targets index 1ca2ef4..8c8673a 100644 --- a/TestProjects/Directory.Build.targets +++ b/TestProjects/Directory.Build.targets @@ -1,6 +1,6 @@ - + NIRIN Nirmal Guru © NIRIN Foundation. diff --git a/Tools/MSBuild.Packaging.props b/Tools/MSBuild.Packaging.props new file mode 100644 index 0000000..e2ae1f9 --- /dev/null +++ b/Tools/MSBuild.Packaging.props @@ -0,0 +1,15 @@ + + + + + Full + + + + + + + + + + \ No newline at end of file diff --git a/Tools/MSBuild.Packaging.targets b/Tools/MSBuild.Packaging.targets index 9e3edeb..d7f618c 100644 --- a/Tools/MSBuild.Packaging.targets +++ b/Tools/MSBuild.Packaging.targets @@ -1,36 +1,42 @@ - - false - true - - Full - - MSBuildSdk <_DefaultTags>msbuild;sdk;dotnet $(_DefaultTags);$(PackageTags) $(_DefaultTags) - true true + true - + + true + + + + true + $(DefaultItemExcludes);$(DefaultExcludesInProjectFolder) + $(DefaultContentItemExcludes);**\*$(DefaultLanguageSourceExtension);**\*.resx + + + + true + false + true + false false false - **\*$(DefaultLanguageSourceExtension) + true - - - + + + - - + + - InitializeSourceControlInformationFromSourceControlManager; BuildOnlySettings; PrepareForBuild; PreBuildEvent; @@ -42,15 +48,25 @@ - - $(MSBuildProjectDirectory)\$(MSBuildProjectName).nuspec + + + InitializeSourceControlInformation;$(CoreBuildDependsOn) - + + $(MSBuildProjectName).nuspec + + + $(GenerateNuspecDependsOn);SetNuSpecProperties - + + + + 0 + + id=$(PackageId); diff --git a/Tools/Sign-Package.ps1 b/Tools/Sign-Package.ps1 index 97a4e82..b7ecd59 100644 --- a/Tools/Sign-Package.ps1 +++ b/Tools/Sign-Package.ps1 @@ -4,8 +4,8 @@ $repoDirectory = "$currentDirectory\..\" # See if we have the ClientSecret available if ([string]::IsNullOrEmpty($env:SignClientSecret)) { - Write-Host "Client Secret not found, not signing packages" - return; + Write-Host "Client Secret not found, not signing packages" + return; } & nuget install SignClient -Version 0.9.1 -SolutionDir "$repoDirectory" -Verbosity quiet -ExcludeVersion @@ -17,9 +17,9 @@ $appPath = "$repoDirectory\packages\SignClient\tools\netcoreapp2.0\SignClient.dl $nupgks = Get-ChildItem $Env:ArtifactDirectory\*.nupkg | Select-Object -ExpandProperty FullName foreach ($nupkg in $nupgks) { - Write-Host "Submitting $nupkg for signing" - dotnet $appPath 'sign' -c $appSettings -i $nupkg -r $env:SignClientUser -s $env:SignClientSecret -n 'MSBuild.Sdk.Extras' -d 'MSBuild.Sdk.Extras' -u 'https://github.com/onovotny/MSBuildSdkExtras' - Write-Host "Finished signing $nupkg" + Write-Host "Submitting $nupkg for signing" + dotnet $appPath 'sign' -c $appSettings -i $nupkg -r $env:SignClientUser -s $env:SignClientSecret -n 'MSBuild.Sdk.Extras' -d 'MSBuild.Sdk.Extras' -u 'https://github.com/onovotny/MSBuildSdkExtras' + Write-Host "Finished signing $nupkg" } Write-Host "Sign-package complete" \ No newline at end of file