Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public sealed class FileTransformation : ILegacyOnlyProjectTransformation
"Reference",
"ProjectReference",
"PackageReference",
"Protobuf",
"COMReference",
"Antlr4",
"Antlr3"
Expand Down
24 changes: 24 additions & 0 deletions Project2015To2017.Tests/FileTransformationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,29 @@ public void TransformsFilesPreserveCOMReferences()
Assert.AreEqual((comReferencesBefore[0] as XElement).Value, (comReferencesAfter[0] as XElement).Value);
Assert.AreEqual((comReferencesBefore[1] as XElement).Value, (comReferencesAfter[1] as XElement).Value);
}

[TestMethod]
public void TransformsFilesPreserveProtobuf()
{
var project = new ProjectReader().Read(Path.Combine("TestFiles", "FileInclusion", "projectWithProtobuf.testcsproj"));
project.CodeFileExtension = "cs";
var transformation = new FileTransformation();

var protobufBefore = project.ProjectDocument.Root.DescendantNodes().
Where(node => node.NodeType == System.Xml.XmlNodeType.Element).
Where(node => (node as XElement).Name.LocalName.Equals("Protobuf")).ToList();

Assert.AreEqual(2, protobufBefore.Count);

transformation.Transform(project);

var protobufAfter = project.ProjectDocument.Root.DescendantNodes().
Where(node => node.NodeType == System.Xml.XmlNodeType.Element).
Where(node => (node as XElement).Name.LocalName.Equals("Protobuf")).ToList();

Assert.AreEqual(2, protobufAfter.Count);
Assert.AreEqual((protobufBefore[0] as XElement).Value, (protobufAfter[0] as XElement).Value);
Assert.AreEqual((protobufBefore[1] as XElement).Value, (protobufAfter[1] as XElement).Value);
}
}
}
3 changes: 3 additions & 0 deletions Project2015To2017.Tests/Project2015To2017.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@
<None Include="TestFiles\FileInclusion\intermediatePathExclusion.testcsproj">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestFiles\FileInclusion\projectWithProtobuf.testcsproj">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="TestFiles\FileInclusion\SourceFileSubTypeCode.cs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion />
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{215B1102-3351-4C2B-BCC3-198013BBDB66}</ProjectGuid>
<MyType>WindowsForms</MyType>
<AssemblyName>Project1</AssemblyName>
<OutputType>WinExe</OutputType>
<StartupObject>Project1.Form1</StartupObject>
<AssemblyMajorVersion>1</AssemblyMajorVersion>
<AssemblyMinorVersion>0</AssemblyMinorVersion>
<AssemblyRevisionNumber>0</AssemblyRevisionNumber>
<RootNamespace>Project1</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>True</DebugSymbols>
<DefineDebug>True</DefineDebug>
<DefineTrace>True</DefineTrace>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE;Win32,Project1</DefineConstants>
<PlatformTarget>x86</PlatformTarget>
<StartArguments />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugSymbols>False</DebugSymbols>
<DefineDebug>False</DefineDebug>
<DefineTrace>True</DefineTrace>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE;Win32,Project1</DefineConstants>
<PlatformTarget>x86</PlatformTarget>
<StartArguments />
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.XML" />
<Reference Include="Microsoft.CSharp" />
<ProjectReference Include="..\UpgradeSupport\UpgradeHelpers.Gui\UpgradeHelpers.Gui.csproj">
<Project>{F852374C-22BA-4CB6-AA34-DA1A589B9D8D}</Project>
<Name>UpgradeHelpers.Gui</Name>
</ProjectReference>
<Protobuf Include="MSXML2" />
<Reference Include="Microsoft.VisualBasic.Compatibility.Data" />
<Reference Include="MSDATASRC">
<Name>MSDATASRC</Name>
</Reference>
<Protobuf Include="MSDATASRC" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="ExtendedMappings.xml" />
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<EmbeddedResource Include="Form1.resX">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<Compile Include="Properties\AssemblyInfo.cs" />
<None Include="Project1_UpgradeReport.htm">
<Subtype>Preview</Subtype>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>