Skip to content

Commit f3497e3

Browse files
Timur KelmanTimur Kelman
authored andcommitted
exclude CSharpRefReturn project from ConvertWholeSolutionAsync (to VB)
It can never be converted because of the ref return properties
1 parent 807d815 commit f3497e3

7 files changed

Lines changed: 75 additions & 88 deletions

File tree

Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/CSharpRefReturn/CSharpRefReturn.vbproj renamed to Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/CSharpRefReturn/CSharpRefReturn.csproj

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,23 @@
22
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
44
<PropertyGroup>
5-
<OptionInfer>On</OptionInfer>
65
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
76
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
8-
<ProjectGuid>{39A0B42C-38C5-0F53-0E16-D1FFBA52E129}</ProjectGuid>
7+
<ProjectGuid>{8B843547-F49D-40A2-8C4E-1B81D8C5D589}</ProjectGuid>
98
<OutputType>Library</OutputType>
109
<AppDesignerFolder>Properties</AppDesignerFolder>
11-
<RootNamespace></RootNamespace>
10+
<RootNamespace>CSharpRefReturn</RootNamespace>
1211
<AssemblyName>CSharpRefReturn</AssemblyName>
1312
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
1413
<FileAlignment>512</FileAlignment>
1514
<Deterministic>true</Deterministic>
16-
<DefaultItemExcludes>$(DefaultItemExcludes);$(ProjectDir)**\*.cs</DefaultItemExcludes>
1715
</PropertyGroup>
1816
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1917
<DebugSymbols>true</DebugSymbols>
2018
<DebugType>full</DebugType>
2119
<Optimize>false</Optimize>
2220
<OutputPath>bin\Debug\</OutputPath>
23-
<DefineConstants>DEBUG,TRACE</DefineConstants>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
2422
<ErrorReport>prompt</ErrorReport>
2523
<WarningLevel>4</WarningLevel>
2624
</PropertyGroup>
@@ -43,8 +41,8 @@
4341
<Reference Include="System.Xml" />
4442
</ItemGroup>
4543
<ItemGroup>
46-
<Compile Include="RefReturnList.vb" />
47-
<Compile Include="Properties\AssemblyInfo.vb" />
44+
<Compile Include="RefReturnList.cs" />
45+
<Compile Include="Properties\AssemblyInfo.cs" />
4846
</ItemGroup>
49-
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
47+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
5048
</Project>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("CSharpRefReturn")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("CSharpRefReturn")]
13+
[assembly: AssemblyCopyright("Copyright © 2024")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("8b843547-f49d-40a2-8c4e-1b81d8c5d589")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/CSharpRefReturn/Properties/AssemblyInfo.vb

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace CSharpRefReturn
8+
{
9+
public class RefReturnList<T>
10+
{
11+
private T dummy;
12+
public ref T this[int i] {
13+
get {
14+
return ref dummy;
15+
}
16+
}
17+
18+
public ref T RefProperty
19+
{
20+
get
21+
{
22+
return ref dummy;
23+
}
24+
}
25+
}
26+
}

Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/CSharpRefReturn/RefReturnList.vb

Lines changed: 0 additions & 39 deletions
This file was deleted.

Tests/TestData/MultiFileCharacterization/CSToVBResults/ConvertWholeSolution/CharacterizationTestSolution.sln

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Prefix.VbLibrary", "Prefix.
2626
EndProject
2727
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VisualBasicConsoleApp", "ConsoleApp1\VisualBasicConsoleApp.vbproj", "{C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}"
2828
EndProject
29-
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "CSharpRefReturn", "CSharpRefReturn\CSharpRefReturn.vbproj", "{39A0B42C-38C5-0F53-0E16-D1FFBA52E129}"
29+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpRefReturn", "CSharpRefReturn\CSharpRefReturn.csproj", "{8B843547-F49D-40A2-8C4E-1B81D8C5D589}"
3030
EndProject
3131
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "VisualBasicUsingCSharpRefReturn", "VisualBasicUsesCSharpRefReturn\VisualBasicUsingCSharpRefReturn.vbproj", "{6266982D-4807-4619-A71D-1440D0B6B6F4}"
3232
EndProject
@@ -72,10 +72,10 @@ Global
7272
{C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Debug|Any CPU.Build.0 = Debug|Any CPU
7373
{C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Release|Any CPU.ActiveCfg = Release|Any CPU
7474
{C69D27C1-FF4E-43CB-BB0F-9BF811BF0F81}.Release|Any CPU.Build.0 = Release|Any CPU
75-
{39A0B42C-38C5-0F53-0E16-D1FFBA52E129}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
76-
{39A0B42C-38C5-0F53-0E16-D1FFBA52E129}.Debug|Any CPU.Build.0 = Debug|Any CPU
77-
{39A0B42C-38C5-0F53-0E16-D1FFBA52E129}.Release|Any CPU.ActiveCfg = Release|Any CPU
78-
{39A0B42C-38C5-0F53-0E16-D1FFBA52E129}.Release|Any CPU.Build.0 = Release|Any CPU
75+
{8B843547-F49D-40A2-8C4E-1B81D8C5D589}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
76+
{8B843547-F49D-40A2-8C4E-1B81D8C5D589}.Debug|Any CPU.Build.0 = Debug|Any CPU
77+
{8B843547-F49D-40A2-8C4E-1B81D8C5D589}.Release|Any CPU.ActiveCfg = Release|Any CPU
78+
{8B843547-F49D-40A2-8C4E-1B81D8C5D589}.Release|Any CPU.Build.0 = Release|Any CPU
7979
{6266982D-4807-4619-A71D-1440D0B6B6F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
8080
{6266982D-4807-4619-A71D-1440D0B6B6F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
8181
{6266982D-4807-4619-A71D-1440D0B6B6F4}.Release|Any CPU.ActiveCfg = Release|Any CPU

Tests/VB/MultiFileSolutionAndProjectTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ public MultiFileSolutionAndProjectTests(MultiFileTestFixture multiFileTestFixtur
2121
[Fact] /* enable for executing locally */
2222
public async Task ConvertWholeSolutionAsync()
2323
{
24-
await _multiFileTestFixture.ConvertProjectsWhereAsync(p => true, Language.VB);
24+
//the `CSharpRefReturn` project is excluded because it has ref return properties which are not supported in VB
25+
await _multiFileTestFixture.ConvertProjectsWhereAsync(p => p.Name != "CSharpRefReturn", Language.VB);
2526
}
2627

2728
[Fact] /* enable for executing locally */

0 commit comments

Comments
 (0)