Skip to content

Commit

Permalink
Upgrade to Visual Studio 2022
Browse files Browse the repository at this point in the history
  • Loading branch information
Ch0senOne committed Dec 23, 2021
1 parent 0d1e897 commit c7bc198
Show file tree
Hide file tree
Showing 70 changed files with 1,415 additions and 1,372 deletions.
4 changes: 2 additions & 2 deletions CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

[assembly: AssemblyProduct(T4Toolbox.AssemblyInfo.Product)]
[assembly: AssemblyDescription(T4Toolbox.AssemblyInfo.Description)]
[assembly: AssemblyCompany("Oleg Sych")]
[assembly: AssemblyCopyright("Copyright © Oleg Sych. All Rights Reserved.")]
[assembly: AssemblyCompany("Anton Shafalyuk")]
[assembly: AssemblyCopyright("Copyright © Anton Shafalyuk. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion(T4Toolbox.AssemblyInfo.Version)]
Expand Down
19 changes: 19 additions & 0 deletions NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="vs-impl-public" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-impl/nuget/v3/index.json" protocolVersion="3" />
<add key="vssdk-public" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vssdk/nuget/v3/index.json" protocolVersion="3" />
</packageSources>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<bindingRedirects>
<add key="skip" value="False" />
</bindingRedirects>
<packageManagement>
<add key="format" value="1" />
<add key="disabled" value="True" />
</packageManagement>
</configuration>
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ text templates in Visual Studio and allows you to:
- Generate multiple output files from a single text template
- Automatically add output files to one or more projects and folders
- Automatically add or check-out generated files from source control
- Edit text templates in Visual Studio 2015 with syntax colorization, outlining, QuickInfo tooltips,
- Edit text templates in Visual Studio 2022 with syntax colorization, outlining, QuickInfo tooltips,
error reporting and statement completion

You can install the latest stable version of T4 Toolbox using the Extension Manager in Visual Studio or download
Expand All @@ -17,7 +17,7 @@ To learn more, visit the [Getting Started](http://olegsych.github.io/T4Toolbox/g
[![Build status](https://ci.appveyor.com/api/projects/status/github/olegsych/t4toolbox?branch=master&retina=true)](https://ci.appveyor.com/project/olegsych/t4toolbox/branch/master)

Pre-requisites
- [Visual Studio 2017](https://www.visualstudio.com/downloads),
- [Visual Studio 2022](https://www.visualstudio.com/downloads),
- Edition: Community
- Toolsets:
- .NET desktop development toolset
Expand Down Expand Up @@ -61,7 +61,7 @@ You can debug unit and integration tests by selecting the Debug commands in Test
Alternatively, you can debug both generator and editor code by running it in Visual Studio. For that, set the
`T4Toolbox.vsix` project as the startup project in Solution Explorer and specify the following options on the
Debug page of the project properties.
- Start Action / Start external program: ```C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe```
- Start Action / Start external program: ```C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\devenv.exe```
- Start Options / Command line arguments: ```/rootSuffix Exp```

With these settings in place, building the solution will automatically install the extension in the
Expand Down
8 changes: 4 additions & 4 deletions T4Toolbox.Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkProfile />
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
<MinimumVisualStudioVersion>17.0</MinimumVisualStudioVersion>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">17.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
Expand All @@ -37,9 +37,9 @@
</PropertyGroup>

<!-- Sign assemblies if the T4Toolbox.snk file is present -->
<PropertyGroup Condition="Exists('$(MSBuildThisFileDirectory)\T4Toolbox.snk')">
<PropertyGroup Condition="Exists('$(MSBuildThisFileDirectory)\T4Toolbox.pfx')">
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)\T4Toolbox.snk</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)\T4Toolbox.pfx</AssemblyOriginatorKeyFile>
<DefineConstants>$(DefineConstants);SIGN_ASSEMBLY</DefineConstants>
</PropertyGroup>

Expand Down
6 changes: 3 additions & 3 deletions T4Toolbox.sln
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26430.16
MinimumVisualStudioVersion = 10.0.40219.1
# Visual Studio 17
VisualStudioVersion = 17.0.31912.275
MinimumVisualStudioVersion = 17.0
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{42F21B27-CBA5-4FB6-A855-8B74F05F56CD}"
ProjectSection(SolutionItems) = preProject
appveyor.yml = appveyor.yml
Expand Down
6 changes: 6 additions & 0 deletions T4Toolbox.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_LINES/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<OutputType>Library</OutputType>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<Import Project="..\..\T4Toolbox.Common.props" />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.TextTemplating.Interfaces.10.0" />
<Reference Include="Microsoft.VisualStudio.TextTemplating.Interfaces.11.0" />
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
Expand All @@ -32,14 +32,11 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<PackageReference Include="StyleCop.MSBuild">
<Version>6.2.0</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\packages\StyleCop.MSBuild.5.0.0\build\StyleCop.MSBuild.targets" Condition="Exists('..\..\packages\StyleCop.MSBuild.5.0.0\build\StyleCop.MSBuild.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\StyleCop.MSBuild.5.0.0\build\StyleCop.MSBuild.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\StyleCop.MSBuild.5.0.0\build\StyleCop.MSBuild.targets'))" />
</Target>
</Project>
4 changes: 0 additions & 4 deletions src/T4Toolbox.DirectiveProcessors/packages.config

This file was deleted.

32 changes: 22 additions & 10 deletions src/T4Toolbox.TemplateAnalysis/T4Toolbox.TemplateAnalysis.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@
<PropertyGroup>
<ProjectGuid>{65BF3FA7-6B2B-47DD-8FC1-BB25754F12D3}</ProjectGuid>
<OutputType>Library</OutputType>
<YaccLexTools>..\..\packages\YaccLexTools.0.2.2\tools\</YaccLexTools>
<YaccLexTools>$(PkgYaccLexTools)\tools\</YaccLexTools>
<GplexTool>"$(YaccLexTools)gplex.exe"</GplexTool>
<GppgTool>"$(YaccLexTools)gppg.exe"</GppgTool>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.Text.Data" />
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
</ItemGroup>
Expand Down Expand Up @@ -70,16 +71,30 @@
<Compile Include="ValueDescriptor.cs" />
<Yacc Include="TemplateParser.y" />
<Lex Include="TemplateScanner.lex" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\T4Toolbox\T4Toolbox.csproj">
<Project>{682e771a-76f7-4972-bbdc-1250b67f399b}</Project>
<Name>T4Toolbox</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Text.Data">
<Version>17.0.487</Version>
</PackageReference>
<PackageReference Include="StyleCop.MSBuild">
<Version>6.2.0</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="YaccLexTools">
<Version>0.2.2</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\packages\StyleCop.MSBuild.5.0.0\build\StyleCop.MSBuild.targets" Condition="Exists('..\..\packages\StyleCop.MSBuild.5.0.0\build\StyleCop.MSBuild.targets')" />
<Target Name="BeforeGenerateScanners" BeforeTargets="GenerateScanners">
<Delete Files="$(IntermediateOutputPath)%(Lex.Filename).g.lex.cs" />
</Target>
<Target Name="GenerateScanners" Inputs="@(Lex)" Outputs="$(IntermediateOutputPath)%(Filename).g.lex.cs" BeforeTargets="CoreCompile">
<Exec Command="echo #pragma warning disable 1591 &gt; &quot;$(IntermediateOutputPath)%(Lex.Filename).g.lex.cs&quot;" WorkingDirectory="$(ProjectDir)" />
<Exec Command="$(GplexTool) &quot;/out:-&quot; &quot;%(Lex.FullPath)&quot; &gt;&gt; &quot;$(IntermediateOutputPath)%(Lex.Filename).g.lex.cs&quot;" WorkingDirectory="$(ProjectDir)" />
Expand All @@ -90,6 +105,9 @@
</Compile>
</ItemGroup>
</Target>
<Target Name="BeforeGenerateParsers" BeforeTargets="GenerateParsers">
<Delete Files="$(IntermediateOutputPath)%(Yacc.Filename).g.yacc.cs" />
</Target>
<Target Name="GenerateParsers" Inputs="@(Yacc)" Outputs="$(IntermediateOutputPath)%(Filename).g.yacc.cs" BeforeTargets="CoreCompile">
<Exec Command="$(GppgTool) /gplex &quot;%(Yacc.FullPath)&quot; &gt; &quot;$(IntermediateOutputPath)%(Yacc.Filename).g.yacc.cs&quot;" WorkingDirectory="$(ProjectDir)" />
<ItemGroup>
Expand All @@ -98,10 +116,4 @@
</Compile>
</ItemGroup>
</Target>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\StyleCop.MSBuild.5.0.0\build\StyleCop.MSBuild.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\StyleCop.MSBuild.5.0.0\build\StyleCop.MSBuild.targets'))" />
</Target>
</Project>
5 changes: 0 additions & 5 deletions src/T4Toolbox.TemplateAnalysis/packages.config

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,13 @@
<OutputType>Library</OutputType>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.CoreUtility" />
<Reference Include="Microsoft.VisualStudio.Editor" />
<Reference Include="Microsoft.VisualStudio.Language" />
<Reference Include="Microsoft.VisualStudio.Language.Intellisense" />
<Reference Include="Microsoft.VisualStudio.OLE.Interop" />
<Reference Include="Microsoft.VisualStudio.Shell.15.0" />
<!-- Explicitly specify version of Microsoft.VisualStudio.Shell.Immutable.10.0 because Version=15.0.0.0 doesn't define SVsServiceProvider -->
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.Shell.Interop" />
<Reference Include="Microsoft.VisualStudio.Text.Data" />
<Reference Include="Microsoft.VisualStudio.Text.Logic" />
<Reference Include="Microsoft.VisualStudio.Text.UI" />
<Reference Include="Microsoft.VisualStudio.Text.UI.Wpf" />
<Reference Include="Microsoft.VisualStudio.TextManager.Interop" />
<Reference Include="Microsoft.VisualStudio.Utilities" />
<Reference Include="PresentationCore" />
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
Expand Down Expand Up @@ -70,14 +58,17 @@
<Compile Include="TemplateTagger.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<PackageReference Include="Microsoft.VisualStudio.SDK">
<Version>17.0.31902.203</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Validation">
<Version>17.0.34</Version>
</PackageReference>
<PackageReference Include="StyleCop.MSBuild">
<Version>6.2.0</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\packages\StyleCop.MSBuild.5.0.0\build\StyleCop.MSBuild.targets" Condition="Exists('..\..\packages\StyleCop.MSBuild.5.0.0\build\StyleCop.MSBuild.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\StyleCop.MSBuild.5.0.0\build\StyleCop.MSBuild.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\StyleCop.MSBuild.5.0.0\build\StyleCop.MSBuild.targets'))" />
</Target>
</Project>
4 changes: 0 additions & 4 deletions src/T4Toolbox.VisualStudio.Editor/packages.config

This file was deleted.

2 changes: 2 additions & 0 deletions src/T4Toolbox.VisualStudio/BrowseObjectExtender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace T4Toolbox.VisualStudio
using System.Globalization;
using System.Runtime.InteropServices;
using EnvDTE;
using Microsoft;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.Shell.Interop;

Expand Down Expand Up @@ -122,6 +123,7 @@ public string CustomToolTemplate
// Report an error if the template cannot be found
string fullPath = value;
var templateLocator = (TemplateLocator)this.serviceProvider.GetService(typeof(TemplateLocator));
Assumes.Present(templateLocator);
if (!templateLocator.LocateTemplate(this.ProjectItem.FileNames[1], ref fullPath))
{
throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Template '{0}' could not be found", value));
Expand Down
2 changes: 2 additions & 0 deletions src/T4Toolbox.VisualStudio/BrowseObjectExtenderProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace T4Toolbox.VisualStudio
{
using System;
using EnvDTE;
using Microsoft;
using Microsoft.VisualStudio.Shell.Interop;

/// <summary>
Expand All @@ -24,6 +25,7 @@ public BrowseObjectExtenderProvider(IServiceProvider serviceProvider, string ext
{
this.serviceProvider = serviceProvider;
this.objectExtenders = (ObjectExtenders)serviceProvider.GetService(typeof(ObjectExtenders));
Assumes.Present(this.objectExtenders);
this.extenderCategory = extenderCategory;
this.providerCookie = this.objectExtenders.RegisterExtenderProvider(extenderCategory, BrowseObjectExtenderProvider.ExtenderName, this);
}
Expand Down
2 changes: 1 addition & 1 deletion src/T4Toolbox.VisualStudio/CustomToolParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private static void GetProjectItem(object component, out IVsBuildPropertyStorage
"component");
}

parent.GetProjectItem(out project, out itemId);
parent.GetProjectItem(out project, out itemId);
}

private object GetDefaultValue()
Expand Down
3 changes: 3 additions & 0 deletions src/T4Toolbox.VisualStudio/CustomToolParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace T4Toolbox.VisualStudio
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
using Microsoft;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.TextTemplating;
Expand Down Expand Up @@ -145,6 +146,7 @@ public PropertyDescriptorCollection GetProperties()
public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
{
this.templatingService = (ITextTemplating)this.serviceProvider.GetService(typeof(STextTemplating));
Assumes.Present(this.templatingService);
this.templatingHost = (ITextTemplatingEngineHost)this.templatingService;

string templateFileName;
Expand Down Expand Up @@ -246,6 +248,7 @@ private bool ResolveTemplate(out string templateFileName)
}

var templateLocator = (TemplateLocator)this.serviceProvider.GetService(typeof(TemplateLocator));
Assumes.Present(templateLocator);
if (!templateLocator.LocateTemplate(inputFileName, ref templateFileName))
{
return false;
Expand Down
Loading

0 comments on commit c7bc198

Please sign in to comment.