Skip to content

Commit

Permalink
WI #2488 Migrate to .NET 6.0 (#2497)
Browse files Browse the repository at this point in the history
  • Loading branch information
fm-117 committed Apr 20, 2023
1 parent e756a30 commit 18d1cb1
Show file tree
Hide file tree
Showing 104 changed files with 961 additions and 13,738 deletions.
38 changes: 38 additions & 0 deletions .editorconfig
@@ -0,0 +1,38 @@
# NOTE: Requires **VS2019 16.3** or later

# TypeCobol code analysis
# Description: Code analysis rules for TypeCobol.

# Code files
[*.{cs,vb}]


dotnet_diagnostic.CA1046.severity = error

dotnet_diagnostic.CA2218.severity = error

dotnet_diagnostic.CS0108.severity = error

dotnet_diagnostic.CS0109.severity = error

dotnet_diagnostic.CS0114.severity = error

dotnet_diagnostic.CS0168.severity = error

dotnet_diagnostic.CS0183.severity = error

dotnet_diagnostic.CS0184.severity = error

dotnet_diagnostic.CS0472.severity = error

dotnet_diagnostic.CS0642.severity = error

dotnet_diagnostic.CS0659.severity = error

dotnet_diagnostic.CS0660.severity = error

dotnet_diagnostic.CS1058.severity = error

dotnet_diagnostic.CS1717.severity = error

dotnet_diagnostic.CS1718.severity = error
29 changes: 29 additions & 0 deletions .github/workflows/buildAndTest.yml
@@ -0,0 +1,29 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: Build and Test one configuration

on:
workflow_call:
inputs:
build-configuration:
required: true
type: string

jobs:
build:

runs-on: windows-latest

steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration ${{ inputs.build-configuration }}
- name: Test
run: dotnet test --no-build --verbosity normal --configuration ${{ inputs.build-configuration }}
34 changes: 34 additions & 0 deletions .github/workflows/dotnet.yml
@@ -0,0 +1,34 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: Build and Test all configurations

on:
push:
branches:
- master
- develop
- develop_net6.0
pull_request:
branches:
- master
- develop
- develop_net6.0

jobs:
build-and-test-ei-debug:
uses: ./.github/workflows/buildAndTest.yml
with:
build-configuration: EI_Debug
build-and-test-debug:
uses: ./.github/workflows/buildAndTest.yml
with:
build-configuration: Debug
build-and-test-ei-release:
uses: ./.github/workflows/buildAndTest.yml
with:
build-configuration: EI_Release
build-and-test-release:
uses: ./.github/workflows/buildAndTest.yml
with:
build-configuration: Release
21 changes: 0 additions & 21 deletions BuildScript.bat

This file was deleted.

59 changes: 13 additions & 46 deletions CLI/src/CLI.csproj
@@ -1,56 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="..\..\TypeCobol\Common.props" />
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\..\Common.props" />

<PropertyGroup>
<ProjectGuid>{5BEF9D4C-B1FB-455D-A2EA-B4DB5108ECFD}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TypeCobol.CLI</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyName>TypeCobol.CLI</AssemblyName>
<DoNotCopyLocalIfInGac>false</DoNotCopyLocalIfInGac>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup>

<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml" />
<ProjectReference Include="..\..\Codegen\src\Codegen.csproj" />
<ProjectReference Include="..\..\TypeCobol.Analysis\TypeCobol.Analysis.csproj" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Codegen\src\Codegen.csproj">
<Project>{4034cbc5-d3dc-45e5-81f2-605579e6b876}</Project>
<Name>Codegen</Name>
</ProjectReference>
<ProjectReference Include="..\..\TypeCobol.Analysis\TypeCobol.Analysis.csproj">
<Project>{c3250314-c22b-4eb6-9174-17d0791af7be}</Project>
<Name>TypeCobol.Analysis</Name>
</ProjectReference>
<ProjectReference Include="..\..\TypeCobol\TypeCobol.csproj">
<Project>{7ac7a3e5-91f2-44bf-955d-86cc61375742}</Project>
<Name>TypeCobol</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="**\*.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="DefaultCopies\SQLCA.cpy">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<None Include="config\TCIntrinsic-SampleDate.txt">
<None Update="DefaultCopies\**\*">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
</Project>

</Project>
128 changes: 41 additions & 87 deletions CLI/test/CLI.Test.csproj
@@ -1,118 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\TypeCobol\Common.props" />
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\..\Common.props" />

<PropertyGroup>
<ProjectGuid>{CFBF4D30-56F3-4794-9067-B651DC1CAB1E}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CLI.Test</RootNamespace>
<AssemblyName>CLI.Test</AssemblyName>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<DoNotCopyLocalIfInGac>true</DoNotCopyLocalIfInGac>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
</ItemGroup>
<ItemGroup>
<Compile Include="*.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\TypeCobol\TypeCobol.csproj">
<Project>{7ac7a3e5-91f2-44bf-955d-86cc61375742}</Project>
<Name>TypeCobol</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="..\..\TypeCobol.Analysis.Test\Report\InBulkCallPgm.cbl">
<Link>ressources\zcallpgmreportdfa_1\input\InBulkCallPgm.cbl</Link>
<None Include="..\..\TypeCobol.Analysis.Test\Report\InBulkCallPgm.cbl" Link="ressources\zcallpgmreportdfa_1\input\InBulkCallPgm.cbl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\..\TypeCobol.Analysis.Test\Report\InBulkCallPgm.csv">
<Link>ressources\zcallpgmreportdfa_1\output_expected\InBulkCallPgm.csv</Link>
<None Include="..\..\TypeCobol.Analysis.Test\Report\InBulkCallPgm.csv" Link="ressources\zcallpgmreportdfa_1\output_expected\InBulkCallPgm.csv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\..\TypeCobol.Analysis.Test\Report\InBulkCallPgm88Set.cbl">
<Link>ressources\zcallpgmreportdfa_2\input\InBulkCallPgm88Set.cbl</Link>
<None Include="..\..\TypeCobol.Analysis.Test\Report\InBulkCallPgm88Set.cbl" Link="ressources\zcallpgmreportdfa_2\input\InBulkCallPgm88Set.cbl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\..\TypeCobol.Analysis.Test\Report\InBulkCallPgm88Set.csv">
<Link>ressources\zcallpgmreportdfa_2\output_expected\InBulkCallPgm88Set.csv</Link>
<None Include="..\..\TypeCobol.Analysis.Test\Report\InBulkCallPgm88Set.csv" Link="ressources\zcallpgmreportdfa_2\output_expected\InBulkCallPgm88Set.csv">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\..\TypeCobol.Test\Parser\EILegacy\XMYCOPY.cpy">
<Link>ressources\ycopylist\input\XMYCOPY.cpy</Link>
</None>
<None Include="..\..\TypeCobol.Test\Parser\EILegacy\XMYCOPY.cpy" Link="ressources\ycopylist\input\XMYCOPY.cpy">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\..\TypeCobol.Test\Parser\EILegacy\XMYCOPY1.cpy">
<Link>ressources\ycopylist\input\XMYCOPY1.cpy</Link>
<None Include="..\..\TypeCobol.Test\Parser\EILegacy\XMYCOPY1.cpy" Link="ressources\ycopylist\input\XMYCOPY1.cpy">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\..\TypeCobol.Test\Parser\EILegacy\YCONVEA.CPY">
<Link>ressources\ycopylist\input\YCONVEA.CPY</Link>
<None Include="..\..\TypeCobol.Test\Parser\EILegacy\YCONVEA.CPY" Link="ressources\ycopylist\input\YCONVEA.CPY">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\..\TypeCobol.Test\Parser\EILegacy\YCPYRDZ.CPY">
<Link>ressources\ycopylist\input\YCPYRDZ.CPY</Link>
<None Include="..\..\TypeCobol.Test\Parser\EILegacy\YCPYRDZ.CPY" Link="ressources\ycopylist\input\YCPYRDZ.CPY">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\..\TypeCobol.Test\Parser\EILegacy\YMYCOPY.cpy">
<Link>ressources\ycopylist\input\YMYCOPY.cpy</Link>
<None Include="..\..\TypeCobol.Test\Parser\EILegacy\YMYCOPY.cpy" Link="ressources\ycopylist\input\YMYCOPY.cpy">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\..\TypeCobol.Test\Parser\EILegacy\YPRTD20.CPY">
<Link>ressources\ycopylist\input\YPRTD20.CPY</Link>
<None Include="..\..\TypeCobol.Test\Parser\EILegacy\YPRTD20.CPY" Link="ressources\ycopylist\input\YPRTD20.CPY">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\..\TypeCobol.Test\Parser\EILegacy\YXXXFAL.cpy">
<Link>ressources\ycopylist\input\YXXXFAL.cpy</Link>
<None Include="..\..\TypeCobol.Test\Parser\EILegacy\YXXXFAL.cpy" Link="ressources\ycopylist\input\YXXXFAL.cpy">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\..\TypeCobol.Test\Parser\EILegacy\YXXXFAS.cpy">
<Link>ressources\ycopylist\input\YXXXFAS.cpy</Link>
<None Include="..\..\TypeCobol.Test\Parser\EILegacy\YXXXFAS.cpy" Link="ressources\ycopylist\input\YXXXFAS.cpy">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\..\TypeCobol.Test\Parser\Programs\TypeCobol\QualifiedVarSubsriptAccess.rdz.tcbl">
<Link>ressources\failcoboloptionparse\input\QualifiedVarSubsriptAccess.rdz.tcbl</Link>
<None Include="..\..\TypeCobol.Test\Parser\Programs\TypeCobol\QualifiedVarSubsriptAccess.rdz.tcbl" Link="ressources\failcoboloptionparse\input\QualifiedVarSubsriptAccess.rdz.tcbl">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="ressources\**">
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
<PackageReference Include="coverlet.collector" Version="3.1.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\TypeCobol\TypeCobol.csproj" />
<!-- To import TypeCobol.Analysis.dll which contains dummy quality analyzers -->
<ProjectReference Include="..\..\TypeCobol.Analysis.Test\TypeCobol.Analysis.Test.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="ressources\**\*">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
</ItemGroup>
</When>
</Choose>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<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>

</Project>
9 changes: 7 additions & 2 deletions CLI/test/CLITest.cs
Expand Up @@ -477,8 +477,13 @@ internal static string Test(string workingDirectory, string arguments, ReturnCod
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startInfo.FileName = "cmd.exe";
startInfo.WorkingDirectory = workingDirectory;
startInfo.Arguments = @"/c " + ".." + Path.DirectorySeparatorChar + ".." + Path.DirectorySeparatorChar +
"TypeCobol.CLI.exe " + arguments;
// Find TypeCobol.CLI.exe location
string currentDirectory = Environment.CurrentDirectory;
string configuration = Path.GetFileName(currentDirectory);
string pathToExe = Path.Combine(currentDirectory, "..", "..", "..", "..");
pathToExe = Path.GetFullPath(pathToExe);
pathToExe = Path.Combine(pathToExe, "CLI", "src", "bin", configuration, "TypeCobol.CLI.exe");
startInfo.Arguments = @"/c " + pathToExe + " " + arguments;

process.StartInfo = startInfo;
process.StartInfo.RedirectStandardOutput = true;
Expand Down

0 comments on commit 18d1cb1

Please sign in to comment.