From ad3bdd29526df591eb8e1d7fc32d527c88d35514 Mon Sep 17 00:00:00 2001 From: Roald Ruiter Date: Mon, 14 Sep 2020 09:47:37 +0200 Subject: [PATCH 1/2] Split project up into Core code and CLI specific code. --- src/TcBlack.sln | 88 ++++++++++---- src/{TcBlack => TcBlackCLI}/App.config | 0 src/{TcBlack => TcBlackCLI}/Backup.cs | 2 +- .../BuildTwinCatProject.bat | 0 src/{TcBlack => TcBlackCLI}/Program.cs | 3 +- .../Properties/AssemblyInfo.cs | 7 +- .../TcBlackCLI.csproj} | 21 ++-- src/{TcBlack => TcBlackCLI}/TcPou.cs | 3 +- .../TcProjectBuilder.cs | 2 +- src/{TcBlack => TcBlackCLI}/packages.config | 0 .../BackupTests.cs | 2 +- .../MockTcProjectBuilder.cs | 2 +- .../Properties/AssemblyInfo.cs | 34 ++++++ .../TcBlackCLITests.csproj} | 15 +-- .../TcPouTestData/FB_ExpectedComplex.TcPOU | 0 .../FB_ExpectedOverrideIndentation.TcPOU | 0 .../FB_ExpectedOverrideLineEnding.TcPOU | 0 ...ctedOverrideLineEndingAndIndentation.TcPOU | 0 .../TcPouTestData/FB_ExpectedSimple.TcPOU | 0 .../FB_ExpectedTabAndUnixLineEnd.TcPOU | 0 .../FB_ExpectedWithEmptyVars.TcPOU | 0 .../FB_ExpectedWithPropertiesAndMethods.TcPOU | 0 .../TcPouTestData/FB_InputComplex.TcPOU | 0 .../FB_InputOverrideIndentation.TcPOU | 0 .../FB_InputOverrideLineEnding.TcPOU | 0 ...nputOverrideLineEndingAndIndentation.TcPOU | 0 .../TcPouTestData/FB_InputSimple.TcPOU | 0 .../FB_InputTabAndUnixLineEnd.TcPOU | 0 .../TcPouTestData/FB_InputWithEmptyVars.TcPOU | 0 .../FB_InputWithPropertiesAndMethods.TcPOU | 0 .../TcPouTests.cs | 2 +- .../TcProjectBuilderTests.cs | 2 +- .../packages.config | 0 src/{TcBlack => TcBlackCore}/CodeLineBase.cs | 2 +- src/{TcBlack => TcBlackCore}/CompositeCode.cs | 2 +- src/{TcBlack => TcBlackCore}/EmptyLine.cs | 2 +- src/{TcBlack => TcBlackCore}/Global.cs | 2 +- .../ICodeLineOperations.cs | 2 +- src/{TcBlack => TcBlackCore}/Keywords.cs | 2 +- .../ObjectDefinition.cs | 2 +- src/TcBlackCore/Properties/AssemblyInfo.cs | 34 ++++++ src/TcBlackCore/TcBlackCore.csproj | 58 ++++++++++ .../UnknownCodeType.cs | 2 +- .../VariableBlockEnd.cs | 2 +- .../VariableBlockStart.cs | 2 +- .../VariableDeclaration.cs | 2 +- .../CompositeCodeTests.cs | 2 +- .../EmptyLineTests.cs | 2 +- .../ObjectDefinitionTests.cs | 2 +- .../Properties/AssemblyInfo.cs | 4 +- src/TcBlackCoreTests/TcBlackCoreTests.csproj | 95 +++++++++++++++ .../UnknownCodeTypeTests.cs | 2 +- .../VarBlockEndTests.cs | 2 +- .../VarBlockStartTests.cs | 2 +- .../VariableDeclarationTests.cs | 2 +- src/TcBlackCoreTests/packages.config | 12 ++ .../BackupFileAlreadyExists.txt | 1 - .../BackupFileAlreadyExists.txt.bak | 1 - .../InitializeObjectCreatesBackupFile.txt | 1 - .../failedBuildWithExtraTextBelow.log | 12 -- .../firstBuildOkSecondBuildFailed.log | 28 ----- .../TcProjectBuildTestData/succesfulBuild.log | 108 ------------------ 62 files changed, 344 insertions(+), 229 deletions(-) rename src/{TcBlack => TcBlackCLI}/App.config (100%) rename src/{TcBlack => TcBlackCLI}/Backup.cs (97%) rename src/{TcBlack => TcBlackCLI}/BuildTwinCatProject.bat (100%) rename src/{TcBlack => TcBlackCLI}/Program.cs (99%) rename src/{TcBlack => TcBlackCLI}/Properties/AssemblyInfo.cs (88%) rename src/{TcBlack/TcBlack.csproj => TcBlackCLI/TcBlackCLI.csproj} (84%) rename src/{TcBlack => TcBlackCLI}/TcPou.cs (98%) rename src/{TcBlack => TcBlackCLI}/TcProjectBuilder.cs (99%) rename src/{TcBlack => TcBlackCLI}/packages.config (100%) rename src/{TcBlackTests => TcBlackCLITests}/BackupTests.cs (98%) rename src/{TcBlackTests => TcBlackCLITests}/MockTcProjectBuilder.cs (96%) create mode 100644 src/TcBlackCLITests/Properties/AssemblyInfo.cs rename src/{TcBlackTests/TcBlackTests.csproj => TcBlackCLITests/TcBlackCLITests.csproj} (93%) rename src/{TcBlackTests => TcBlackCLITests}/TcPouTestData/FB_ExpectedComplex.TcPOU (100%) rename src/{TcBlackTests => TcBlackCLITests}/TcPouTestData/FB_ExpectedOverrideIndentation.TcPOU (100%) rename src/{TcBlackTests => TcBlackCLITests}/TcPouTestData/FB_ExpectedOverrideLineEnding.TcPOU (100%) rename src/{TcBlackTests => TcBlackCLITests}/TcPouTestData/FB_ExpectedOverrideLineEndingAndIndentation.TcPOU (100%) rename src/{TcBlackTests => TcBlackCLITests}/TcPouTestData/FB_ExpectedSimple.TcPOU (100%) rename src/{TcBlackTests => TcBlackCLITests}/TcPouTestData/FB_ExpectedTabAndUnixLineEnd.TcPOU (100%) rename src/{TcBlackTests => TcBlackCLITests}/TcPouTestData/FB_ExpectedWithEmptyVars.TcPOU (100%) rename src/{TcBlackTests => TcBlackCLITests}/TcPouTestData/FB_ExpectedWithPropertiesAndMethods.TcPOU (100%) rename src/{TcBlackTests => TcBlackCLITests}/TcPouTestData/FB_InputComplex.TcPOU (100%) rename src/{TcBlackTests => TcBlackCLITests}/TcPouTestData/FB_InputOverrideIndentation.TcPOU (100%) rename src/{TcBlackTests => TcBlackCLITests}/TcPouTestData/FB_InputOverrideLineEnding.TcPOU (100%) rename src/{TcBlackTests => TcBlackCLITests}/TcPouTestData/FB_InputOverrideLineEndingAndIndentation.TcPOU (100%) rename src/{TcBlackTests => TcBlackCLITests}/TcPouTestData/FB_InputSimple.TcPOU (100%) rename src/{TcBlackTests => TcBlackCLITests}/TcPouTestData/FB_InputTabAndUnixLineEnd.TcPOU (100%) rename src/{TcBlackTests => TcBlackCLITests}/TcPouTestData/FB_InputWithEmptyVars.TcPOU (100%) rename src/{TcBlackTests => TcBlackCLITests}/TcPouTestData/FB_InputWithPropertiesAndMethods.TcPOU (100%) rename src/{TcBlackTests => TcBlackCLITests}/TcPouTests.cs (99%) rename src/{TcBlackTests => TcBlackCLITests}/TcProjectBuilderTests.cs (99%) rename src/{TcBlackTests => TcBlackCLITests}/packages.config (100%) rename src/{TcBlack => TcBlackCore}/CodeLineBase.cs (91%) rename src/{TcBlack => TcBlackCore}/CompositeCode.cs (99%) rename src/{TcBlack => TcBlackCore}/EmptyLine.cs (91%) rename src/{TcBlack => TcBlackCore}/Global.cs (84%) rename src/{TcBlack => TcBlackCore}/ICodeLineOperations.cs (79%) rename src/{TcBlack => TcBlackCore}/Keywords.cs (99%) rename src/{TcBlack => TcBlackCore}/ObjectDefinition.cs (99%) create mode 100644 src/TcBlackCore/Properties/AssemblyInfo.cs create mode 100644 src/TcBlackCore/TcBlackCore.csproj rename src/{TcBlack => TcBlackCore}/UnknownCodeType.cs (91%) rename src/{TcBlack => TcBlackCore}/VariableBlockEnd.cs (94%) rename src/{TcBlack => TcBlackCore}/VariableBlockStart.cs (94%) rename src/{TcBlack => TcBlackCore}/VariableDeclaration.cs (99%) rename src/{TcBlackTests => TcBlackCoreTests}/CompositeCodeTests.cs (99%) rename src/{TcBlackTests => TcBlackCoreTests}/EmptyLineTests.cs (97%) rename src/{TcBlackTests => TcBlackCoreTests}/ObjectDefinitionTests.cs (99%) rename src/{TcBlackTests => TcBlackCoreTests}/Properties/AssemblyInfo.cs (92%) create mode 100644 src/TcBlackCoreTests/TcBlackCoreTests.csproj rename src/{TcBlackTests => TcBlackCoreTests}/UnknownCodeTypeTests.cs (97%) rename src/{TcBlackTests => TcBlackCoreTests}/VarBlockEndTests.cs (97%) rename src/{TcBlackTests => TcBlackCoreTests}/VarBlockStartTests.cs (97%) rename src/{TcBlackTests => TcBlackCoreTests}/VariableDeclarationTests.cs (99%) create mode 100644 src/TcBlackCoreTests/packages.config delete mode 100644 src/TcBlackTests/BackupTestData/BackupFileAlreadyExists.txt delete mode 100644 src/TcBlackTests/BackupTestData/BackupFileAlreadyExists.txt.bak delete mode 100644 src/TcBlackTests/BackupTestData/InitializeObjectCreatesBackupFile.txt delete mode 100644 src/TcBlackTests/TcProjectBuildTestData/failedBuildWithExtraTextBelow.log delete mode 100644 src/TcBlackTests/TcProjectBuildTestData/firstBuildOkSecondBuildFailed.log delete mode 100644 src/TcBlackTests/TcProjectBuildTestData/succesfulBuild.log diff --git a/src/TcBlack.sln b/src/TcBlack.sln index 785c0df..9f629b8 100644 --- a/src/TcBlack.sln +++ b/src/TcBlack.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.28307.1062 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcBlack", "TcBlack\TcBlack.csproj", "{6E641F94-D4BE-4576-A2A1-AE02BC173716}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcBlackCLI", "TcBlackCLI\TcBlackCLI.csproj", "{6E641F94-D4BE-4576-A2A1-AE02BC173716}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7081C59B-F88D-4CA8-80B6-0E5502E47BD7}" ProjectSection(SolutionItems) = preProject @@ -17,7 +17,11 @@ Project("{B1E792BE-AA5F-4E3C-8C82-674BF9C0715B}") = "ShowcaseProject", "Showcase EndProject Project("{DFBE7525-6864-4E62-8B2E-D530D69D9D96}") = "WorkingProjectForUnitTests", "WorkingProjectForUnitTests\WorkingProjectForUnitTests.tspproj", "{4B0F123F-79A6-40B6-8DAD-2C1DD5BF2DE7}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcBlackTests", "TcBlackTests\TcBlackTests.csproj", "{87DFDA93-482C-4C04-ABF1-50E23F24F85D}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcBlackCLITests", "TcBlackCLITests\TcBlackCLITests.csproj", "{87DFDA93-482C-4C04-ABF1-50E23F24F85D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcBlackCoreTests", "TcBlackCoreTests\TcBlackCoreTests.csproj", "{D86EFF5A-952E-42BD-AEB4-605F02ED336C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcBlackCore", "TcBlackCore\TcBlackCore.csproj", "{434C7A68-C27F-4F46-977E-2F60441FEB64}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -149,26 +153,6 @@ Global {0AB6833F-593B-4E68-AC63-B575821ACF23}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64) {0AB6833F-593B-4E68-AC63-B575821ACF23}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86) {0AB6833F-593B-4E68-AC63-B575821ACF23}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|Any CPU.ActiveCfg = Debug|TwinCAT RT (x64) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|Any CPU.Build.0 = Debug|TwinCAT RT (x64) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|TwinCAT CE7 (ARMV7) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|TwinCAT CE7 (ARMV7) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|TwinCAT OS (ARMT2) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|TwinCAT OS (ARMT2) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|TwinCAT RT (x64) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT RT (x64).Build.0 = Debug|TwinCAT RT (x64) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|TwinCAT RT (x86) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT RT (x86).Build.0 = Debug|TwinCAT RT (x86) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|Any CPU.ActiveCfg = Release|TwinCAT RT (x64) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|Any CPU.Build.0 = Release|TwinCAT RT (x64) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|TwinCAT CE7 (ARMV7) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|TwinCAT CE7 (ARMV7) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|TwinCAT OS (ARMT2) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT OS (ARMT2).Build.0 = Release|TwinCAT OS (ARMT2) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT RT (x64).ActiveCfg = Release|TwinCAT RT (x64) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86) {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Debug|Any CPU.ActiveCfg = Debug|TwinCAT RT (x64) {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Debug|Any CPU.Build.0 = Debug|TwinCAT RT (x64) {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|TwinCAT CE7 (ARMV7) @@ -189,6 +173,66 @@ Global {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64) {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86) {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|Any CPU.ActiveCfg = Debug|TwinCAT RT (x64) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|Any CPU.Build.0 = Debug|TwinCAT RT (x64) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|TwinCAT CE7 (ARMV7) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|TwinCAT CE7 (ARMV7) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|TwinCAT OS (ARMT2) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|TwinCAT OS (ARMT2) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|TwinCAT RT (x64) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT RT (x64).Build.0 = Debug|TwinCAT RT (x64) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|TwinCAT RT (x86) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT RT (x86).Build.0 = Debug|TwinCAT RT (x86) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|Any CPU.ActiveCfg = Release|TwinCAT RT (x64) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|Any CPU.Build.0 = Release|TwinCAT RT (x64) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|TwinCAT CE7 (ARMV7) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|TwinCAT CE7 (ARMV7) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|TwinCAT OS (ARMT2) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT OS (ARMT2).Build.0 = Release|TwinCAT OS (ARMT2) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT RT (x64).ActiveCfg = Release|TwinCAT RT (x64) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86) + {D86EFF5A-952E-42BD-AEB4-605F02ED336C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D86EFF5A-952E-42BD-AEB4-605F02ED336C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D86EFF5A-952E-42BD-AEB4-605F02ED336C}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|Any CPU + {D86EFF5A-952E-42BD-AEB4-605F02ED336C}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|Any CPU + {D86EFF5A-952E-42BD-AEB4-605F02ED336C}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|Any CPU + {D86EFF5A-952E-42BD-AEB4-605F02ED336C}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|Any CPU + {D86EFF5A-952E-42BD-AEB4-605F02ED336C}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|Any CPU + {D86EFF5A-952E-42BD-AEB4-605F02ED336C}.Debug|TwinCAT RT (x64).Build.0 = Debug|Any CPU + {D86EFF5A-952E-42BD-AEB4-605F02ED336C}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|Any CPU + {D86EFF5A-952E-42BD-AEB4-605F02ED336C}.Debug|TwinCAT RT (x86).Build.0 = Debug|Any CPU + {D86EFF5A-952E-42BD-AEB4-605F02ED336C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D86EFF5A-952E-42BD-AEB4-605F02ED336C}.Release|Any CPU.Build.0 = Release|Any CPU + {D86EFF5A-952E-42BD-AEB4-605F02ED336C}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|Any CPU + {D86EFF5A-952E-42BD-AEB4-605F02ED336C}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|Any CPU + {D86EFF5A-952E-42BD-AEB4-605F02ED336C}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|Any CPU + {D86EFF5A-952E-42BD-AEB4-605F02ED336C}.Release|TwinCAT OS (ARMT2).Build.0 = Release|Any CPU + {D86EFF5A-952E-42BD-AEB4-605F02ED336C}.Release|TwinCAT RT (x64).ActiveCfg = Release|Any CPU + {D86EFF5A-952E-42BD-AEB4-605F02ED336C}.Release|TwinCAT RT (x64).Build.0 = Release|Any CPU + {D86EFF5A-952E-42BD-AEB4-605F02ED336C}.Release|TwinCAT RT (x86).ActiveCfg = Release|Any CPU + {D86EFF5A-952E-42BD-AEB4-605F02ED336C}.Release|TwinCAT RT (x86).Build.0 = Release|Any CPU + {434C7A68-C27F-4F46-977E-2F60441FEB64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {434C7A68-C27F-4F46-977E-2F60441FEB64}.Debug|Any CPU.Build.0 = Debug|Any CPU + {434C7A68-C27F-4F46-977E-2F60441FEB64}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|Any CPU + {434C7A68-C27F-4F46-977E-2F60441FEB64}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|Any CPU + {434C7A68-C27F-4F46-977E-2F60441FEB64}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|Any CPU + {434C7A68-C27F-4F46-977E-2F60441FEB64}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|Any CPU + {434C7A68-C27F-4F46-977E-2F60441FEB64}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|Any CPU + {434C7A68-C27F-4F46-977E-2F60441FEB64}.Debug|TwinCAT RT (x64).Build.0 = Debug|Any CPU + {434C7A68-C27F-4F46-977E-2F60441FEB64}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|Any CPU + {434C7A68-C27F-4F46-977E-2F60441FEB64}.Debug|TwinCAT RT (x86).Build.0 = Debug|Any CPU + {434C7A68-C27F-4F46-977E-2F60441FEB64}.Release|Any CPU.ActiveCfg = Release|Any CPU + {434C7A68-C27F-4F46-977E-2F60441FEB64}.Release|Any CPU.Build.0 = Release|Any CPU + {434C7A68-C27F-4F46-977E-2F60441FEB64}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|Any CPU + {434C7A68-C27F-4F46-977E-2F60441FEB64}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|Any CPU + {434C7A68-C27F-4F46-977E-2F60441FEB64}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|Any CPU + {434C7A68-C27F-4F46-977E-2F60441FEB64}.Release|TwinCAT OS (ARMT2).Build.0 = Release|Any CPU + {434C7A68-C27F-4F46-977E-2F60441FEB64}.Release|TwinCAT RT (x64).ActiveCfg = Release|Any CPU + {434C7A68-C27F-4F46-977E-2F60441FEB64}.Release|TwinCAT RT (x64).Build.0 = Release|Any CPU + {434C7A68-C27F-4F46-977E-2F60441FEB64}.Release|TwinCAT RT (x86).ActiveCfg = Release|Any CPU + {434C7A68-C27F-4F46-977E-2F60441FEB64}.Release|TwinCAT RT (x86).Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/TcBlack/App.config b/src/TcBlackCLI/App.config similarity index 100% rename from src/TcBlack/App.config rename to src/TcBlackCLI/App.config diff --git a/src/TcBlack/Backup.cs b/src/TcBlackCLI/Backup.cs similarity index 97% rename from src/TcBlack/Backup.cs rename to src/TcBlackCLI/Backup.cs index bee6f0b..373d760 100644 --- a/src/TcBlack/Backup.cs +++ b/src/TcBlackCLI/Backup.cs @@ -1,6 +1,6 @@ using System.IO; -namespace TcBlack +namespace TcBlackCLI { public class Backup { diff --git a/src/TcBlack/BuildTwinCatProject.bat b/src/TcBlackCLI/BuildTwinCatProject.bat similarity index 100% rename from src/TcBlack/BuildTwinCatProject.bat rename to src/TcBlackCLI/BuildTwinCatProject.bat diff --git a/src/TcBlack/Program.cs b/src/TcBlackCLI/Program.cs similarity index 99% rename from src/TcBlack/Program.cs rename to src/TcBlackCLI/Program.cs index 6271fcc..be4b60d 100644 --- a/src/TcBlack/Program.cs +++ b/src/TcBlackCLI/Program.cs @@ -4,8 +4,9 @@ using System.Text.RegularExpressions; using System.Linq; using CommandLine; +using TcBlackCore; -namespace TcBlack +namespace TcBlackCLI { class Program { diff --git a/src/TcBlack/Properties/AssemblyInfo.cs b/src/TcBlackCLI/Properties/AssemblyInfo.cs similarity index 88% rename from src/TcBlack/Properties/AssemblyInfo.cs rename to src/TcBlackCLI/Properties/AssemblyInfo.cs index 1842866..e000cc4 100644 --- a/src/TcBlack/Properties/AssemblyInfo.cs +++ b/src/TcBlackCLI/Properties/AssemblyInfo.cs @@ -1,15 +1,14 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("TcBlack")] +[assembly: AssemblyTitle("TcBlackCLI")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("TcBlack")] +[assembly: AssemblyProduct("TcBlackCLI")] [assembly: AssemblyCopyright("Copyright © 2020")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,4 +31,4 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.2.0.0")] +[assembly: AssemblyVersion("0.3.0.0")] diff --git a/src/TcBlack/TcBlack.csproj b/src/TcBlackCLI/TcBlackCLI.csproj similarity index 84% rename from src/TcBlack/TcBlack.csproj rename to src/TcBlackCLI/TcBlackCLI.csproj index d0c74b9..2565b49 100644 --- a/src/TcBlack/TcBlack.csproj +++ b/src/TcBlackCLI/TcBlackCLI.csproj @@ -6,8 +6,8 @@ AnyCPU {6E641F94-D4BE-4576-A2A1-AE02BC173716} Exe - TcBlack - TcBlack + TcBlackCLI + TcBlackCLI v4.6.1 512 true @@ -46,21 +46,10 @@ - - - - - - - - - - - @@ -82,5 +71,11 @@ True + + + {434c7a68-c27f-4f46-977e-2f60441feb64} + TcBlackCore + + \ No newline at end of file diff --git a/src/TcBlack/TcPou.cs b/src/TcBlackCLI/TcPou.cs similarity index 98% rename from src/TcBlack/TcPou.cs rename to src/TcBlackCLI/TcPou.cs index 1d63975..7fc37cb 100644 --- a/src/TcBlack/TcPou.cs +++ b/src/TcBlackCLI/TcPou.cs @@ -1,6 +1,7 @@ using System.Xml; +using TcBlackCore; -namespace TcBlack +namespace TcBlackCLI { /// /// Load, format and save a TcPOU file. diff --git a/src/TcBlack/TcProjectBuilder.cs b/src/TcBlackCLI/TcProjectBuilder.cs similarity index 99% rename from src/TcBlack/TcProjectBuilder.cs rename to src/TcBlackCLI/TcProjectBuilder.cs index 1dc2d8d..106a204 100644 --- a/src/TcBlack/TcProjectBuilder.cs +++ b/src/TcBlackCLI/TcProjectBuilder.cs @@ -6,7 +6,7 @@ using System.Linq; using System.Text.RegularExpressions; -namespace TcBlack +namespace TcBlackCLI { public class ProjectBuildFailed : Exception { diff --git a/src/TcBlack/packages.config b/src/TcBlackCLI/packages.config similarity index 100% rename from src/TcBlack/packages.config rename to src/TcBlackCLI/packages.config diff --git a/src/TcBlackTests/BackupTests.cs b/src/TcBlackCLITests/BackupTests.cs similarity index 98% rename from src/TcBlackTests/BackupTests.cs rename to src/TcBlackCLITests/BackupTests.cs index 82e6734..072ac75 100644 --- a/src/TcBlackTests/BackupTests.cs +++ b/src/TcBlackCLITests/BackupTests.cs @@ -1,5 +1,5 @@ using Xunit; -using TcBlack; +using TcBlackCLI; using System.IO; namespace TcBlackTests diff --git a/src/TcBlackTests/MockTcProjectBuilder.cs b/src/TcBlackCLITests/MockTcProjectBuilder.cs similarity index 96% rename from src/TcBlackTests/MockTcProjectBuilder.cs rename to src/TcBlackCLITests/MockTcProjectBuilder.cs index df6a1f1..081dc6e 100644 --- a/src/TcBlackTests/MockTcProjectBuilder.cs +++ b/src/TcBlackCLITests/MockTcProjectBuilder.cs @@ -1,4 +1,4 @@ -using TcBlack; +using TcBlackCLI; namespace TcBlackTests { diff --git a/src/TcBlackCLITests/Properties/AssemblyInfo.cs b/src/TcBlackCLITests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..7aa8e46 --- /dev/null +++ b/src/TcBlackCLITests/Properties/AssemblyInfo.cs @@ -0,0 +1,34 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("TcBlackCLITests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("TcBlackCLITests")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("87dfda93-482c-4c04-abf1-50e23f24f85d")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("0.3.0.0")] diff --git a/src/TcBlackTests/TcBlackTests.csproj b/src/TcBlackCLITests/TcBlackCLITests.csproj similarity index 93% rename from src/TcBlackTests/TcBlackTests.csproj rename to src/TcBlackCLITests/TcBlackCLITests.csproj index 4a2122b..8151349 100644 --- a/src/TcBlackTests/TcBlackTests.csproj +++ b/src/TcBlackCLITests/TcBlackCLITests.csproj @@ -10,8 +10,8 @@ {87DFDA93-482C-4C04-ABF1-50E23F24F85D} Library Properties - BlackTests - BlackTests + TcBlackCLITests + TcBlackCLITests v4.6.1 512 true @@ -59,17 +59,10 @@ - - - - - - - @@ -100,9 +93,9 @@ - + {6e641f94-d4be-4576-a2a1-ae02bc173716} - TcBlack + TcBlackCLI diff --git a/src/TcBlackTests/TcPouTestData/FB_ExpectedComplex.TcPOU b/src/TcBlackCLITests/TcPouTestData/FB_ExpectedComplex.TcPOU similarity index 100% rename from src/TcBlackTests/TcPouTestData/FB_ExpectedComplex.TcPOU rename to src/TcBlackCLITests/TcPouTestData/FB_ExpectedComplex.TcPOU diff --git a/src/TcBlackTests/TcPouTestData/FB_ExpectedOverrideIndentation.TcPOU b/src/TcBlackCLITests/TcPouTestData/FB_ExpectedOverrideIndentation.TcPOU similarity index 100% rename from src/TcBlackTests/TcPouTestData/FB_ExpectedOverrideIndentation.TcPOU rename to src/TcBlackCLITests/TcPouTestData/FB_ExpectedOverrideIndentation.TcPOU diff --git a/src/TcBlackTests/TcPouTestData/FB_ExpectedOverrideLineEnding.TcPOU b/src/TcBlackCLITests/TcPouTestData/FB_ExpectedOverrideLineEnding.TcPOU similarity index 100% rename from src/TcBlackTests/TcPouTestData/FB_ExpectedOverrideLineEnding.TcPOU rename to src/TcBlackCLITests/TcPouTestData/FB_ExpectedOverrideLineEnding.TcPOU diff --git a/src/TcBlackTests/TcPouTestData/FB_ExpectedOverrideLineEndingAndIndentation.TcPOU b/src/TcBlackCLITests/TcPouTestData/FB_ExpectedOverrideLineEndingAndIndentation.TcPOU similarity index 100% rename from src/TcBlackTests/TcPouTestData/FB_ExpectedOverrideLineEndingAndIndentation.TcPOU rename to src/TcBlackCLITests/TcPouTestData/FB_ExpectedOverrideLineEndingAndIndentation.TcPOU diff --git a/src/TcBlackTests/TcPouTestData/FB_ExpectedSimple.TcPOU b/src/TcBlackCLITests/TcPouTestData/FB_ExpectedSimple.TcPOU similarity index 100% rename from src/TcBlackTests/TcPouTestData/FB_ExpectedSimple.TcPOU rename to src/TcBlackCLITests/TcPouTestData/FB_ExpectedSimple.TcPOU diff --git a/src/TcBlackTests/TcPouTestData/FB_ExpectedTabAndUnixLineEnd.TcPOU b/src/TcBlackCLITests/TcPouTestData/FB_ExpectedTabAndUnixLineEnd.TcPOU similarity index 100% rename from src/TcBlackTests/TcPouTestData/FB_ExpectedTabAndUnixLineEnd.TcPOU rename to src/TcBlackCLITests/TcPouTestData/FB_ExpectedTabAndUnixLineEnd.TcPOU diff --git a/src/TcBlackTests/TcPouTestData/FB_ExpectedWithEmptyVars.TcPOU b/src/TcBlackCLITests/TcPouTestData/FB_ExpectedWithEmptyVars.TcPOU similarity index 100% rename from src/TcBlackTests/TcPouTestData/FB_ExpectedWithEmptyVars.TcPOU rename to src/TcBlackCLITests/TcPouTestData/FB_ExpectedWithEmptyVars.TcPOU diff --git a/src/TcBlackTests/TcPouTestData/FB_ExpectedWithPropertiesAndMethods.TcPOU b/src/TcBlackCLITests/TcPouTestData/FB_ExpectedWithPropertiesAndMethods.TcPOU similarity index 100% rename from src/TcBlackTests/TcPouTestData/FB_ExpectedWithPropertiesAndMethods.TcPOU rename to src/TcBlackCLITests/TcPouTestData/FB_ExpectedWithPropertiesAndMethods.TcPOU diff --git a/src/TcBlackTests/TcPouTestData/FB_InputComplex.TcPOU b/src/TcBlackCLITests/TcPouTestData/FB_InputComplex.TcPOU similarity index 100% rename from src/TcBlackTests/TcPouTestData/FB_InputComplex.TcPOU rename to src/TcBlackCLITests/TcPouTestData/FB_InputComplex.TcPOU diff --git a/src/TcBlackTests/TcPouTestData/FB_InputOverrideIndentation.TcPOU b/src/TcBlackCLITests/TcPouTestData/FB_InputOverrideIndentation.TcPOU similarity index 100% rename from src/TcBlackTests/TcPouTestData/FB_InputOverrideIndentation.TcPOU rename to src/TcBlackCLITests/TcPouTestData/FB_InputOverrideIndentation.TcPOU diff --git a/src/TcBlackTests/TcPouTestData/FB_InputOverrideLineEnding.TcPOU b/src/TcBlackCLITests/TcPouTestData/FB_InputOverrideLineEnding.TcPOU similarity index 100% rename from src/TcBlackTests/TcPouTestData/FB_InputOverrideLineEnding.TcPOU rename to src/TcBlackCLITests/TcPouTestData/FB_InputOverrideLineEnding.TcPOU diff --git a/src/TcBlackTests/TcPouTestData/FB_InputOverrideLineEndingAndIndentation.TcPOU b/src/TcBlackCLITests/TcPouTestData/FB_InputOverrideLineEndingAndIndentation.TcPOU similarity index 100% rename from src/TcBlackTests/TcPouTestData/FB_InputOverrideLineEndingAndIndentation.TcPOU rename to src/TcBlackCLITests/TcPouTestData/FB_InputOverrideLineEndingAndIndentation.TcPOU diff --git a/src/TcBlackTests/TcPouTestData/FB_InputSimple.TcPOU b/src/TcBlackCLITests/TcPouTestData/FB_InputSimple.TcPOU similarity index 100% rename from src/TcBlackTests/TcPouTestData/FB_InputSimple.TcPOU rename to src/TcBlackCLITests/TcPouTestData/FB_InputSimple.TcPOU diff --git a/src/TcBlackTests/TcPouTestData/FB_InputTabAndUnixLineEnd.TcPOU b/src/TcBlackCLITests/TcPouTestData/FB_InputTabAndUnixLineEnd.TcPOU similarity index 100% rename from src/TcBlackTests/TcPouTestData/FB_InputTabAndUnixLineEnd.TcPOU rename to src/TcBlackCLITests/TcPouTestData/FB_InputTabAndUnixLineEnd.TcPOU diff --git a/src/TcBlackTests/TcPouTestData/FB_InputWithEmptyVars.TcPOU b/src/TcBlackCLITests/TcPouTestData/FB_InputWithEmptyVars.TcPOU similarity index 100% rename from src/TcBlackTests/TcPouTestData/FB_InputWithEmptyVars.TcPOU rename to src/TcBlackCLITests/TcPouTestData/FB_InputWithEmptyVars.TcPOU diff --git a/src/TcBlackTests/TcPouTestData/FB_InputWithPropertiesAndMethods.TcPOU b/src/TcBlackCLITests/TcPouTestData/FB_InputWithPropertiesAndMethods.TcPOU similarity index 100% rename from src/TcBlackTests/TcPouTestData/FB_InputWithPropertiesAndMethods.TcPOU rename to src/TcBlackCLITests/TcPouTestData/FB_InputWithPropertiesAndMethods.TcPOU diff --git a/src/TcBlackTests/TcPouTests.cs b/src/TcBlackCLITests/TcPouTests.cs similarity index 99% rename from src/TcBlackTests/TcPouTests.cs rename to src/TcBlackCLITests/TcPouTests.cs index 1459433..2cdaa4a 100644 --- a/src/TcBlackTests/TcPouTests.cs +++ b/src/TcBlackCLITests/TcPouTests.cs @@ -1,6 +1,6 @@ using System; using System.IO; -using TcBlack; +using TcBlackCLI; using Xunit; namespace TcBlackTests diff --git a/src/TcBlackTests/TcProjectBuilderTests.cs b/src/TcBlackCLITests/TcProjectBuilderTests.cs similarity index 99% rename from src/TcBlackTests/TcProjectBuilderTests.cs rename to src/TcBlackCLITests/TcProjectBuilderTests.cs index bbe57b9..1ec8349 100644 --- a/src/TcBlackTests/TcProjectBuilderTests.cs +++ b/src/TcBlackCLITests/TcProjectBuilderTests.cs @@ -1,6 +1,6 @@ using System; using System.IO; -using TcBlack; +using TcBlackCLI; using Xunit; namespace TcBlackTests diff --git a/src/TcBlackTests/packages.config b/src/TcBlackCLITests/packages.config similarity index 100% rename from src/TcBlackTests/packages.config rename to src/TcBlackCLITests/packages.config diff --git a/src/TcBlack/CodeLineBase.cs b/src/TcBlackCore/CodeLineBase.cs similarity index 91% rename from src/TcBlack/CodeLineBase.cs rename to src/TcBlackCore/CodeLineBase.cs index c9b60b3..d2164e9 100644 --- a/src/TcBlack/CodeLineBase.cs +++ b/src/TcBlackCore/CodeLineBase.cs @@ -1,4 +1,4 @@ -namespace TcBlack +namespace TcBlackCore { public abstract class CodeLineBase { diff --git a/src/TcBlack/CompositeCode.cs b/src/TcBlackCore/CompositeCode.cs similarity index 99% rename from src/TcBlack/CompositeCode.cs rename to src/TcBlackCore/CompositeCode.cs index de8b4c2..ec23a4f 100644 --- a/src/TcBlack/CompositeCode.cs +++ b/src/TcBlackCore/CompositeCode.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq; -namespace TcBlack +namespace TcBlackCore { public class CompositeCode : CodeLineBase, ICodeLineOperations { diff --git a/src/TcBlack/EmptyLine.cs b/src/TcBlackCore/EmptyLine.cs similarity index 91% rename from src/TcBlack/EmptyLine.cs rename to src/TcBlackCore/EmptyLine.cs index 1c64901..0467d01 100644 --- a/src/TcBlack/EmptyLine.cs +++ b/src/TcBlackCore/EmptyLine.cs @@ -1,4 +1,4 @@ -namespace TcBlack +namespace TcBlackCore { public class EmptyLine : CodeLineBase { diff --git a/src/TcBlack/Global.cs b/src/TcBlackCore/Global.cs similarity index 84% rename from src/TcBlack/Global.cs rename to src/TcBlackCore/Global.cs index 0e5c5f1..06c477b 100644 --- a/src/TcBlack/Global.cs +++ b/src/TcBlackCore/Global.cs @@ -1,4 +1,4 @@ -namespace TcBlack +namespace TcBlackCore { public static class Global { diff --git a/src/TcBlack/ICodeLineOperations.cs b/src/TcBlackCore/ICodeLineOperations.cs similarity index 79% rename from src/TcBlack/ICodeLineOperations.cs rename to src/TcBlackCore/ICodeLineOperations.cs index 89d348b..2d2645f 100644 --- a/src/TcBlack/ICodeLineOperations.cs +++ b/src/TcBlackCore/ICodeLineOperations.cs @@ -1,4 +1,4 @@ -namespace TcBlack +namespace TcBlackCore { internal interface ICodeLineOperations { diff --git a/src/TcBlack/Keywords.cs b/src/TcBlackCore/Keywords.cs similarity index 99% rename from src/TcBlack/Keywords.cs rename to src/TcBlackCore/Keywords.cs index abbcf4d..f3260c0 100644 --- a/src/TcBlack/Keywords.cs +++ b/src/TcBlackCore/Keywords.cs @@ -1,6 +1,6 @@ using System.Text.RegularExpressions; -namespace TcBlack +namespace TcBlackCore { class Keywords { diff --git a/src/TcBlack/ObjectDefinition.cs b/src/TcBlackCore/ObjectDefinition.cs similarity index 99% rename from src/TcBlack/ObjectDefinition.cs rename to src/TcBlackCore/ObjectDefinition.cs index 555c78c..8cf4d18 100644 --- a/src/TcBlack/ObjectDefinition.cs +++ b/src/TcBlackCore/ObjectDefinition.cs @@ -2,7 +2,7 @@ using System.Linq; using System.Text.RegularExpressions; -namespace TcBlack +namespace TcBlackCore { /// /// Format the definition of a FUNCTION, FUNCTION_BLOCK, etc. including the diff --git a/src/TcBlackCore/Properties/AssemblyInfo.cs b/src/TcBlackCore/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..6d9223b --- /dev/null +++ b/src/TcBlackCore/Properties/AssemblyInfo.cs @@ -0,0 +1,34 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("TcBlackCore")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("TcBlackCore")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("434c7a68-c27f-4f46-977e-2f60441feb64")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("0.3.0.0")] diff --git a/src/TcBlackCore/TcBlackCore.csproj b/src/TcBlackCore/TcBlackCore.csproj new file mode 100644 index 0000000..c04fd67 --- /dev/null +++ b/src/TcBlackCore/TcBlackCore.csproj @@ -0,0 +1,58 @@ + + + + + Debug + AnyCPU + {434C7A68-C27F-4F46-977E-2F60441FEB64} + Library + Properties + TcBlackCore + TcBlackCore + v4.6.1 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/TcBlack/UnknownCodeType.cs b/src/TcBlackCore/UnknownCodeType.cs similarity index 91% rename from src/TcBlack/UnknownCodeType.cs rename to src/TcBlackCore/UnknownCodeType.cs index 9637ec4..962fd6f 100644 --- a/src/TcBlack/UnknownCodeType.cs +++ b/src/TcBlackCore/UnknownCodeType.cs @@ -1,4 +1,4 @@ -namespace TcBlack +namespace TcBlackCore { public class UnknownCodeType : CodeLineBase { diff --git a/src/TcBlack/VariableBlockEnd.cs b/src/TcBlackCore/VariableBlockEnd.cs similarity index 94% rename from src/TcBlack/VariableBlockEnd.cs rename to src/TcBlackCore/VariableBlockEnd.cs index c1630d1..e7a3d36 100644 --- a/src/TcBlack/VariableBlockEnd.cs +++ b/src/TcBlackCore/VariableBlockEnd.cs @@ -1,4 +1,4 @@ -namespace TcBlack +namespace TcBlackCore { public class VariableBlockEnd : CodeLineBase { diff --git a/src/TcBlack/VariableBlockStart.cs b/src/TcBlackCore/VariableBlockStart.cs similarity index 94% rename from src/TcBlack/VariableBlockStart.cs rename to src/TcBlackCore/VariableBlockStart.cs index bfee4da..64ad8ee 100644 --- a/src/TcBlack/VariableBlockStart.cs +++ b/src/TcBlackCore/VariableBlockStart.cs @@ -1,4 +1,4 @@ -namespace TcBlack +namespace TcBlackCore { public class VariableBlockStart : CodeLineBase { diff --git a/src/TcBlack/VariableDeclaration.cs b/src/TcBlackCore/VariableDeclaration.cs similarity index 99% rename from src/TcBlack/VariableDeclaration.cs rename to src/TcBlackCore/VariableDeclaration.cs index 4e80535..189dc25 100644 --- a/src/TcBlack/VariableDeclaration.cs +++ b/src/TcBlackCore/VariableDeclaration.cs @@ -1,7 +1,7 @@ using System.Text; using System.Text.RegularExpressions; -namespace TcBlack +namespace TcBlackCore { public struct TcDeclaration { diff --git a/src/TcBlackTests/CompositeCodeTests.cs b/src/TcBlackCoreTests/CompositeCodeTests.cs similarity index 99% rename from src/TcBlackTests/CompositeCodeTests.cs rename to src/TcBlackCoreTests/CompositeCodeTests.cs index f5a544c..4e4fb37 100644 --- a/src/TcBlackTests/CompositeCodeTests.cs +++ b/src/TcBlackCoreTests/CompositeCodeTests.cs @@ -1,4 +1,4 @@ -using TcBlack; +using TcBlackCore; using Xunit; namespace TcBlackTests diff --git a/src/TcBlackTests/EmptyLineTests.cs b/src/TcBlackCoreTests/EmptyLineTests.cs similarity index 97% rename from src/TcBlackTests/EmptyLineTests.cs rename to src/TcBlackCoreTests/EmptyLineTests.cs index c377068..4dc9ebd 100644 --- a/src/TcBlackTests/EmptyLineTests.cs +++ b/src/TcBlackCoreTests/EmptyLineTests.cs @@ -1,5 +1,5 @@ using Xunit; -using TcBlack; +using TcBlackCore; namespace TcBlackTests { diff --git a/src/TcBlackTests/ObjectDefinitionTests.cs b/src/TcBlackCoreTests/ObjectDefinitionTests.cs similarity index 99% rename from src/TcBlackTests/ObjectDefinitionTests.cs rename to src/TcBlackCoreTests/ObjectDefinitionTests.cs index 3cf2e4d..220ae94 100644 --- a/src/TcBlackTests/ObjectDefinitionTests.cs +++ b/src/TcBlackCoreTests/ObjectDefinitionTests.cs @@ -1,4 +1,4 @@ -using TcBlack; +using TcBlackCore; using Xunit; namespace TcBlackTests diff --git a/src/TcBlackTests/Properties/AssemblyInfo.cs b/src/TcBlackCoreTests/Properties/AssemblyInfo.cs similarity index 92% rename from src/TcBlackTests/Properties/AssemblyInfo.cs rename to src/TcBlackCoreTests/Properties/AssemblyInfo.cs index 34ffbb7..416828d 100644 --- a/src/TcBlackTests/Properties/AssemblyInfo.cs +++ b/src/TcBlackCoreTests/Properties/AssemblyInfo.cs @@ -4,11 +4,11 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("TcBlackTests")] +[assembly: AssemblyTitle("TcBlackCoreTests")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("TcBlackTests")] +[assembly: AssemblyProduct("TcBlackCoreTests")] [assembly: AssemblyCopyright("Copyright © 2020")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/src/TcBlackCoreTests/TcBlackCoreTests.csproj b/src/TcBlackCoreTests/TcBlackCoreTests.csproj new file mode 100644 index 0000000..daf32c7 --- /dev/null +++ b/src/TcBlackCoreTests/TcBlackCoreTests.csproj @@ -0,0 +1,95 @@ + + + + + + + + Debug + AnyCPU + {D86EFF5A-952E-42BD-AEB4-605F02ED336C} + Library + Properties + TcBlackCoreTests + TcBlackCoreTests + v4.6.1 + 512 + true + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + ..\packages\xunit.abstractions.2.0.3\lib\net35\xunit.abstractions.dll + + + ..\packages\xunit.assert.2.4.1\lib\netstandard1.1\xunit.assert.dll + + + ..\packages\xunit.extensibility.core.2.4.1\lib\net452\xunit.core.dll + + + ..\packages\xunit.extensibility.execution.2.4.1\lib\net452\xunit.execution.desktop.dll + + + + + + + + + + + + + + + Designer + + + + + + + + {434c7a68-c27f-4f46-977e-2f60441feb64} + TcBlackCore + + + + + + 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}. + + + + + + + + \ No newline at end of file diff --git a/src/TcBlackTests/UnknownCodeTypeTests.cs b/src/TcBlackCoreTests/UnknownCodeTypeTests.cs similarity index 97% rename from src/TcBlackTests/UnknownCodeTypeTests.cs rename to src/TcBlackCoreTests/UnknownCodeTypeTests.cs index b9954fd..fca4765 100644 --- a/src/TcBlackTests/UnknownCodeTypeTests.cs +++ b/src/TcBlackCoreTests/UnknownCodeTypeTests.cs @@ -1,5 +1,5 @@ using Xunit; -using TcBlack; +using TcBlackCore; namespace TcBlackTests { diff --git a/src/TcBlackTests/VarBlockEndTests.cs b/src/TcBlackCoreTests/VarBlockEndTests.cs similarity index 97% rename from src/TcBlackTests/VarBlockEndTests.cs rename to src/TcBlackCoreTests/VarBlockEndTests.cs index 11c5753..7cf5687 100644 --- a/src/TcBlackTests/VarBlockEndTests.cs +++ b/src/TcBlackCoreTests/VarBlockEndTests.cs @@ -1,5 +1,5 @@ using Xunit; -using TcBlack; +using TcBlackCore; namespace TcBlackTests { diff --git a/src/TcBlackTests/VarBlockStartTests.cs b/src/TcBlackCoreTests/VarBlockStartTests.cs similarity index 97% rename from src/TcBlackTests/VarBlockStartTests.cs rename to src/TcBlackCoreTests/VarBlockStartTests.cs index 0aeb793..ea91ba8 100644 --- a/src/TcBlackTests/VarBlockStartTests.cs +++ b/src/TcBlackCoreTests/VarBlockStartTests.cs @@ -1,5 +1,5 @@ using Xunit; -using TcBlack; +using TcBlackCore; namespace TcBlackTests { diff --git a/src/TcBlackTests/VariableDeclarationTests.cs b/src/TcBlackCoreTests/VariableDeclarationTests.cs similarity index 99% rename from src/TcBlackTests/VariableDeclarationTests.cs rename to src/TcBlackCoreTests/VariableDeclarationTests.cs index d7d90bc..76fd553 100644 --- a/src/TcBlackTests/VariableDeclarationTests.cs +++ b/src/TcBlackCoreTests/VariableDeclarationTests.cs @@ -1,4 +1,4 @@ -using TcBlack; +using TcBlackCore; using Xunit; namespace TcBlackTests diff --git a/src/TcBlackCoreTests/packages.config b/src/TcBlackCoreTests/packages.config new file mode 100644 index 0000000..b54f082 --- /dev/null +++ b/src/TcBlackCoreTests/packages.config @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/TcBlackTests/BackupTestData/BackupFileAlreadyExists.txt b/src/TcBlackTests/BackupTestData/BackupFileAlreadyExists.txt deleted file mode 100644 index bbbfc78..0000000 --- a/src/TcBlackTests/BackupTestData/BackupFileAlreadyExists.txt +++ /dev/null @@ -1 +0,0 @@ -Some text. \ No newline at end of file diff --git a/src/TcBlackTests/BackupTestData/BackupFileAlreadyExists.txt.bak b/src/TcBlackTests/BackupTestData/BackupFileAlreadyExists.txt.bak deleted file mode 100644 index bbbfc78..0000000 --- a/src/TcBlackTests/BackupTestData/BackupFileAlreadyExists.txt.bak +++ /dev/null @@ -1 +0,0 @@ -Some text. \ No newline at end of file diff --git a/src/TcBlackTests/BackupTestData/InitializeObjectCreatesBackupFile.txt b/src/TcBlackTests/BackupTestData/InitializeObjectCreatesBackupFile.txt deleted file mode 100644 index bbbfc78..0000000 --- a/src/TcBlackTests/BackupTestData/InitializeObjectCreatesBackupFile.txt +++ /dev/null @@ -1 +0,0 @@ -Some text. \ No newline at end of file diff --git a/src/TcBlackTests/TcProjectBuildTestData/failedBuildWithExtraTextBelow.log b/src/TcBlackTests/TcProjectBuildTestData/failedBuildWithExtraTextBelow.log deleted file mode 100644 index 047fa39..0000000 --- a/src/TcBlackTests/TcProjectBuildTestData/failedBuildWithExtraTextBelow.log +++ /dev/null @@ -1,12 +0,0 @@ ------- Build started: Project: PLC (BrokenProject\PLC), Configuration: Debug TwinCAT RT (x64) ------ ------- Build started: Application: BrokenProject.PLC ------- -typify code ... -C:\Users\roald\Source\Repos\TcBlack\src\BrokenProject\PLC\POUs\MAIN.TcPOU(5) : error: Type definition expected instead of '' -C:\Users\roald\Source\Repos\TcBlack\src\BrokenProject\PLC\POUs\MAIN.TcPOU(2) : error: 'END_VAR' expected instead of '' -C:\Users\roald\Source\Repos\TcBlack\src\BrokenProject\PLC\POUs\MAIN.TcPOU(3) : error: ',, AT or :' expected instead of 'END_VAR' -Compile complete -- 3 errors, 0 warnings -Build complete -- 3 errors, 0 warnings : no download possible! -WRN | 7-6-2020 10:57:49 834 ms | 'TwinCAT XAE': Project 'PLC' build for platform 'TwinCAT RT (x64)' failed. -========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ========== -NuGet package restore canceled. - diff --git a/src/TcBlackTests/TcProjectBuildTestData/firstBuildOkSecondBuildFailed.log b/src/TcBlackTests/TcProjectBuildTestData/firstBuildOkSecondBuildFailed.log deleted file mode 100644 index 8e08973..0000000 --- a/src/TcBlackTests/TcProjectBuildTestData/firstBuildOkSecondBuildFailed.log +++ /dev/null @@ -1,28 +0,0 @@ ------- Build started: Project: PLC, Configuration: Debug TwinCAT RT (x64) ------ ------- Build started: Application: TwinCAT_Project1.PLC ------- -typify code ... -generate code... -generate global initializations ... -generate code initialization ... -generate relocations ... -Size of generated code: 49528 bytes -Size of global data: 11761 bytes -Total allocated memory size for code and data: 445720 bytes -Memory area 0 contains Data, Input, Output, Memory, Code, Persistent Data and Nonsafe Data: size: 1048576 bytes, highest used address: 445720, largest contiguous memory gap: 602856 bytes (57 %) -Build complete -- 0 errors, 0 warnings : ready for download! -Generate TMC information ... -Import symbol information ... -PLC.PLC : message: generate boot information... ------- Build started: Project: TwinCAT Project1, Configuration: Debug TwinCAT RT (x64) ------ -========== Build: 2 succeeded or up-to-date, 0 failed, 0 skipped ========== - ------- Build started: Project: PLC (BrokenProject\PLC), Configuration: Debug TwinCAT RT (x64) ------ ------- Build started: Application: BrokenProject.PLC ------- -typify code ... -C:\Users\roald\Source\Repos\TcBlack\src\BrokenProject\PLC\POUs\MAIN.TcPOU(5) : error: Type definition expected instead of '' -C:\Users\roald\Source\Repos\TcBlack\src\BrokenProject\PLC\POUs\MAIN.TcPOU(2) : error: 'END_VAR' expected instead of '' -C:\Users\roald\Source\Repos\TcBlack\src\BrokenProject\PLC\POUs\MAIN.TcPOU(3) : error: ',, AT or :' expected instead of 'END_VAR' -Compile complete -- 3 errors, 0 warnings -Build complete -- 3 errors, 0 warnings : no download possible! -WRN | 7-6-2020 10:57:49 834 ms | 'TwinCAT XAE': Project 'PLC' build for platform 'TwinCAT RT (x64)' failed. -========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ========== \ No newline at end of file diff --git a/src/TcBlackTests/TcProjectBuildTestData/succesfulBuild.log b/src/TcBlackTests/TcProjectBuildTestData/succesfulBuild.log deleted file mode 100644 index a6fc92f..0000000 --- a/src/TcBlackTests/TcProjectBuildTestData/succesfulBuild.log +++ /dev/null @@ -1,108 +0,0 @@ - -The operation could not be completed. De parameter is onjuist. - ------- Build started: Project: PLC, Configuration: Debug TwinCAT RT (x64) ------ ------- Build started: Application: TwinCAT_Project1.PLC ------- -typify code ... -generate code... -generate global initializations ... -generate code initialization ... -generate relocations ... -Size of generated code: 49528 bytes -Size of global data: 11761 bytes -Total allocated memory size for code and data: 445720 bytes -Memory area 0 contains Data, Input, Output, Memory, Code, Persistent Data and Nonsafe Data: size: 1048576 bytes, highest used address: 445720, largest contiguous memory gap: 602856 bytes (57 %) -Build complete -- 0 errors, 0 warnings : ready for download! -Generate TMC information ... -Import symbol information ... -PLC.PLC : message: generate boot information... ------- Build started: Project: TwinCAT Project1, Configuration: Debug TwinCAT RT (x64) ------ -========== Build: 2 succeeded or up-to-date, 0 failed, 0 skipped ========== - - -The following files were specified on the command line: - - - -These files could not be found and will not be loaded.------ Build started: Project: PLC, Configuration: Debug TwinCAT RT (x64) ------ ------- Build started: Application: TwinCAT_Project1.PLC ------- -typify code ... -generate code... -generate global initializations ... -generate code initialization ... -generate relocations ... -Size of generated code: 49528 bytes -Size of global data: 11761 bytes -Total allocated memory size for code and data: 445720 bytes -Memory area 0 contains Data, Input, Output, Memory, Code, Persistent Data and Nonsafe Data: size: 1048576 bytes, highest used address: 445720, largest contiguous memory gap: 602856 bytes (57 %) -Build complete -- 0 errors, 0 warnings : ready for download! -Generate TMC information ... -Import symbol information ... -PLC.PLC : message: generate boot information... ------- Build started: Project: TwinCAT Project1, Configuration: Debug TwinCAT RT (x64) ------ -========== Build: 2 succeeded or up-to-date, 0 failed, 0 skipped ========== - - -The following files were specified on the command line: - - - -These files could not be found and will not be loaded.------ Build started: Project: PLC, Configuration: Debug TwinCAT RT (x64) ------ ------- Build started: Application: TwinCAT_Project1.PLC ------- -typify code ... -generate code... -generate global initializations ... -generate code initialization ... -generate relocations ... -Size of generated code: 49528 bytes -Size of global data: 11761 bytes -Total allocated memory size for code and data: 445720 bytes -Memory area 0 contains Data, Input, Output, Memory, Code, Persistent Data and Nonsafe Data: size: 1048576 bytes, highest used address: 445720, largest contiguous memory gap: 602856 bytes (57 %) -Build complete -- 0 errors, 0 warnings : ready for download! -Generate TMC information ... -Import symbol information ... -PLC.PLC : message: generate boot information... ------- Build started: Project: TwinCAT Project1, Configuration: Debug TwinCAT RT (x64) ------ -========== Build: 2 succeeded or up-to-date, 0 failed, 0 skipped ========== - ------- Build started: Project: PLC, Configuration: Debug TwinCAT RT (x64) ------ ------- Build started: Application: TwinCAT_Project1.PLC ------- -typify code ... -generate code... -generate global initializations ... -generate code initialization ... -generate relocations ... -Size of generated code: 49528 bytes -Size of global data: 11761 bytes -Total allocated memory size for code and data: 445720 bytes -Memory area 0 contains Data, Input, Output, Memory, Code, Persistent Data and Nonsafe Data: size: 1048576 bytes, highest used address: 445720, largest contiguous memory gap: 602856 bytes (57 %) -Build complete -- 0 errors, 0 warnings : ready for download! -Generate TMC information ... -Import symbol information ... -PLC.PLC : message: generate boot information... ------- Build started: Project: TwinCAT Project1, Configuration: Debug TwinCAT RT (x64) ------ -========== Build: 2 succeeded or up-to-date, 0 failed, 0 skipped ========== - - -The following files were specified on the command line: - - - -These files could not be found and will not be loaded.------ Build started: Project: PLC, Configuration: Debug TwinCAT RT (x64) ------ ------- Build started: Application: TwinCAT_Project1.PLC ------- -typify code ... -generate code... -generate global initializations ... -generate code initialization ... -generate relocations ... -Size of generated code: 49528 bytes -Size of global data: 11761 bytes -Total allocated memory size for code and data: 445720 bytes -Memory area 0 contains Data, Input, Output, Memory, Code, Persistent Data and Nonsafe Data: size: 1048576 bytes, highest used address: 445720, largest contiguous memory gap: 602856 bytes (57 %) -Build complete -- 0 errors, 0 warnings : ready for download! -Generate TMC information ... -Import symbol information ... -PLC.PLC : message: generate boot information... ------- Build started: Project: TwinCAT Project1, Configuration: Debug TwinCAT RT (x64) ------ -========== Build: 2 succeeded or up-to-date, 0 failed, 0 skipped ========== - From b4ab8122c380daa263e2d0f5f9752c40f6e46d0d Mon Sep 17 00:00:00 2001 From: Roald Ruiter Date: Mon, 14 Sep 2020 11:06:42 +0200 Subject: [PATCH 2/2] Added extension project which can format structured text. --- src/TcBlack.sln | 138 ++++++----- src/TcBlack/TcDeclaration.cs | 58 +++++ src/TcBlackCore/TcBlackCore.csproj | 9 + src/TcBlackExtension/FormatStructuredText.cs | 113 +++++++++ .../FormatStructuredTextPackage.cs | 69 ++++++ .../FormatStructuredTextPackage.vsct | 78 +++++++ .../Properties/AssemblyInfo.cs | 32 +++ src/TcBlackExtension/TcBlackExtension.csproj | 215 ++++++++++++++++++ src/TcBlackExtension/VSPackage.resx | 126 ++++++++++ src/TcBlackExtension/packages.config | 25 ++ .../source.extension.vsixmanifest | 21 ++ src/TcBlackExtension/stylesheet.css | 129 +++++++++++ 12 files changed, 955 insertions(+), 58 deletions(-) create mode 100644 src/TcBlack/TcDeclaration.cs create mode 100644 src/TcBlackExtension/FormatStructuredText.cs create mode 100644 src/TcBlackExtension/FormatStructuredTextPackage.cs create mode 100644 src/TcBlackExtension/FormatStructuredTextPackage.vsct create mode 100644 src/TcBlackExtension/Properties/AssemblyInfo.cs create mode 100644 src/TcBlackExtension/TcBlackExtension.csproj create mode 100644 src/TcBlackExtension/VSPackage.resx create mode 100644 src/TcBlackExtension/packages.config create mode 100644 src/TcBlackExtension/source.extension.vsixmanifest create mode 100644 src/TcBlackExtension/stylesheet.css diff --git a/src/TcBlack.sln b/src/TcBlack.sln index 9f629b8..3d9323c 100644 --- a/src/TcBlack.sln +++ b/src/TcBlack.sln @@ -23,6 +23,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcBlackCoreTests", "TcBlack EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcBlackCore", "TcBlackCore\TcBlackCore.csproj", "{434C7A68-C27F-4F46-977E-2F60441FEB64}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcBlackExtension", "TcBlackExtension\TcBlackExtension.csproj", "{DE482F7D-9E9D-481C-A9B7-871D7ED05212}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -135,64 +137,6 @@ Global {87DFDA93-482C-4C04-ABF1-50E23F24F85D}.Release|TwinCAT RT (x64).Build.0 = Release|Any CPU {87DFDA93-482C-4C04-ABF1-50E23F24F85D}.Release|TwinCAT RT (x86).ActiveCfg = Release|Any CPU {87DFDA93-482C-4C04-ABF1-50E23F24F85D}.Release|TwinCAT RT (x86).Build.0 = Release|Any CPU - {0AB6833F-593B-4E68-AC63-B575821ACF23}.Debug|Any CPU.ActiveCfg = Debug|TwinCAT RT (x64) - {0AB6833F-593B-4E68-AC63-B575821ACF23}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|TwinCAT CE7 (ARMV7) - {0AB6833F-593B-4E68-AC63-B575821ACF23}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|TwinCAT CE7 (ARMV7) - {0AB6833F-593B-4E68-AC63-B575821ACF23}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|TwinCAT OS (ARMT2) - {0AB6833F-593B-4E68-AC63-B575821ACF23}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|TwinCAT OS (ARMT2) - {0AB6833F-593B-4E68-AC63-B575821ACF23}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|TwinCAT RT (x64) - {0AB6833F-593B-4E68-AC63-B575821ACF23}.Debug|TwinCAT RT (x64).Build.0 = Debug|TwinCAT RT (x64) - {0AB6833F-593B-4E68-AC63-B575821ACF23}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|TwinCAT RT (x86) - {0AB6833F-593B-4E68-AC63-B575821ACF23}.Debug|TwinCAT RT (x86).Build.0 = Debug|TwinCAT RT (x86) - {0AB6833F-593B-4E68-AC63-B575821ACF23}.Release|Any CPU.ActiveCfg = Release|TwinCAT RT (x64) - {0AB6833F-593B-4E68-AC63-B575821ACF23}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|TwinCAT CE7 (ARMV7) - {0AB6833F-593B-4E68-AC63-B575821ACF23}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|TwinCAT CE7 (ARMV7) - {0AB6833F-593B-4E68-AC63-B575821ACF23}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|TwinCAT OS (ARMT2) - {0AB6833F-593B-4E68-AC63-B575821ACF23}.Release|TwinCAT OS (ARMT2).Build.0 = Release|TwinCAT OS (ARMT2) - {0AB6833F-593B-4E68-AC63-B575821ACF23}.Release|TwinCAT RT (x64).ActiveCfg = Release|TwinCAT RT (x64) - {0AB6833F-593B-4E68-AC63-B575821ACF23}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64) - {0AB6833F-593B-4E68-AC63-B575821ACF23}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86) - {0AB6833F-593B-4E68-AC63-B575821ACF23}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86) - {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Debug|Any CPU.ActiveCfg = Debug|TwinCAT RT (x64) - {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Debug|Any CPU.Build.0 = Debug|TwinCAT RT (x64) - {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|TwinCAT CE7 (ARMV7) - {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|TwinCAT CE7 (ARMV7) - {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|TwinCAT OS (ARMT2) - {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|TwinCAT OS (ARMT2) - {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|TwinCAT RT (x64) - {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Debug|TwinCAT RT (x64).Build.0 = Debug|TwinCAT RT (x64) - {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|TwinCAT RT (x86) - {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Debug|TwinCAT RT (x86).Build.0 = Debug|TwinCAT RT (x86) - {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Release|Any CPU.ActiveCfg = Release|TwinCAT RT (x64) - {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Release|Any CPU.Build.0 = Release|TwinCAT RT (x64) - {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|TwinCAT CE7 (ARMV7) - {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|TwinCAT CE7 (ARMV7) - {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|TwinCAT OS (ARMT2) - {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Release|TwinCAT OS (ARMT2).Build.0 = Release|TwinCAT OS (ARMT2) - {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Release|TwinCAT RT (x64).ActiveCfg = Release|TwinCAT RT (x64) - {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64) - {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86) - {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|Any CPU.ActiveCfg = Debug|TwinCAT RT (x64) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|Any CPU.Build.0 = Debug|TwinCAT RT (x64) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|TwinCAT CE7 (ARMV7) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|TwinCAT CE7 (ARMV7) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|TwinCAT OS (ARMT2) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|TwinCAT OS (ARMT2) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|TwinCAT RT (x64) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT RT (x64).Build.0 = Debug|TwinCAT RT (x64) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|TwinCAT RT (x86) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT RT (x86).Build.0 = Debug|TwinCAT RT (x86) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|Any CPU.ActiveCfg = Release|TwinCAT RT (x64) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|Any CPU.Build.0 = Release|TwinCAT RT (x64) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|TwinCAT CE7 (ARMV7) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|TwinCAT CE7 (ARMV7) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|TwinCAT OS (ARMT2) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT OS (ARMT2).Build.0 = Release|TwinCAT OS (ARMT2) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT RT (x64).ActiveCfg = Release|TwinCAT RT (x64) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86) - {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86) {D86EFF5A-952E-42BD-AEB4-605F02ED336C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D86EFF5A-952E-42BD-AEB4-605F02ED336C}.Debug|Any CPU.Build.0 = Debug|Any CPU {D86EFF5A-952E-42BD-AEB4-605F02ED336C}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|Any CPU @@ -233,6 +177,84 @@ Global {434C7A68-C27F-4F46-977E-2F60441FEB64}.Release|TwinCAT RT (x64).Build.0 = Release|Any CPU {434C7A68-C27F-4F46-977E-2F60441FEB64}.Release|TwinCAT RT (x86).ActiveCfg = Release|Any CPU {434C7A68-C27F-4F46-977E-2F60441FEB64}.Release|TwinCAT RT (x86).Build.0 = Release|Any CPU + {0AB6833F-593B-4E68-AC63-B575821ACF23}.Debug|Any CPU.ActiveCfg = Debug|TwinCAT RT (x64) + {0AB6833F-593B-4E68-AC63-B575821ACF23}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|TwinCAT CE7 (ARMV7) + {0AB6833F-593B-4E68-AC63-B575821ACF23}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|TwinCAT CE7 (ARMV7) + {0AB6833F-593B-4E68-AC63-B575821ACF23}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|TwinCAT OS (ARMT2) + {0AB6833F-593B-4E68-AC63-B575821ACF23}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|TwinCAT OS (ARMT2) + {0AB6833F-593B-4E68-AC63-B575821ACF23}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|TwinCAT RT (x64) + {0AB6833F-593B-4E68-AC63-B575821ACF23}.Debug|TwinCAT RT (x64).Build.0 = Debug|TwinCAT RT (x64) + {0AB6833F-593B-4E68-AC63-B575821ACF23}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|TwinCAT RT (x86) + {0AB6833F-593B-4E68-AC63-B575821ACF23}.Debug|TwinCAT RT (x86).Build.0 = Debug|TwinCAT RT (x86) + {0AB6833F-593B-4E68-AC63-B575821ACF23}.Release|Any CPU.ActiveCfg = Release|TwinCAT RT (x64) + {0AB6833F-593B-4E68-AC63-B575821ACF23}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|TwinCAT CE7 (ARMV7) + {0AB6833F-593B-4E68-AC63-B575821ACF23}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|TwinCAT CE7 (ARMV7) + {0AB6833F-593B-4E68-AC63-B575821ACF23}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|TwinCAT OS (ARMT2) + {0AB6833F-593B-4E68-AC63-B575821ACF23}.Release|TwinCAT OS (ARMT2).Build.0 = Release|TwinCAT OS (ARMT2) + {0AB6833F-593B-4E68-AC63-B575821ACF23}.Release|TwinCAT RT (x64).ActiveCfg = Release|TwinCAT RT (x64) + {0AB6833F-593B-4E68-AC63-B575821ACF23}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64) + {0AB6833F-593B-4E68-AC63-B575821ACF23}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86) + {0AB6833F-593B-4E68-AC63-B575821ACF23}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|Any CPU.ActiveCfg = Debug|TwinCAT RT (x64) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|Any CPU.Build.0 = Debug|TwinCAT RT (x64) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|TwinCAT CE7 (ARMV7) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|TwinCAT CE7 (ARMV7) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|TwinCAT OS (ARMT2) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|TwinCAT OS (ARMT2) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|TwinCAT RT (x64) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT RT (x64).Build.0 = Debug|TwinCAT RT (x64) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|TwinCAT RT (x86) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Debug|TwinCAT RT (x86).Build.0 = Debug|TwinCAT RT (x86) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|Any CPU.ActiveCfg = Release|TwinCAT RT (x64) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|Any CPU.Build.0 = Release|TwinCAT RT (x64) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|TwinCAT CE7 (ARMV7) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|TwinCAT CE7 (ARMV7) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|TwinCAT OS (ARMT2) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT OS (ARMT2).Build.0 = Release|TwinCAT OS (ARMT2) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT RT (x64).ActiveCfg = Release|TwinCAT RT (x64) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86) + {BDD00A0B-9FFE-4A2C-B504-1A16BFE106B2}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86) + {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Debug|Any CPU.ActiveCfg = Debug|TwinCAT RT (x64) + {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Debug|Any CPU.Build.0 = Debug|TwinCAT RT (x64) + {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|TwinCAT CE7 (ARMV7) + {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|TwinCAT CE7 (ARMV7) + {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|TwinCAT OS (ARMT2) + {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|TwinCAT OS (ARMT2) + {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|TwinCAT RT (x64) + {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Debug|TwinCAT RT (x64).Build.0 = Debug|TwinCAT RT (x64) + {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|TwinCAT RT (x86) + {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Debug|TwinCAT RT (x86).Build.0 = Debug|TwinCAT RT (x86) + {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Release|Any CPU.ActiveCfg = Release|TwinCAT RT (x64) + {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Release|Any CPU.Build.0 = Release|TwinCAT RT (x64) + {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|TwinCAT CE7 (ARMV7) + {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|TwinCAT CE7 (ARMV7) + {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|TwinCAT OS (ARMT2) + {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Release|TwinCAT OS (ARMT2).Build.0 = Release|TwinCAT OS (ARMT2) + {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Release|TwinCAT RT (x64).ActiveCfg = Release|TwinCAT RT (x64) + {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64) + {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86) + {7CF85DA4-8F2E-4244-BC74-2C56883E6551}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86) + {DE482F7D-9E9D-481C-A9B7-871D7ED05212}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DE482F7D-9E9D-481C-A9B7-871D7ED05212}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DE482F7D-9E9D-481C-A9B7-871D7ED05212}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|Any CPU + {DE482F7D-9E9D-481C-A9B7-871D7ED05212}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|Any CPU + {DE482F7D-9E9D-481C-A9B7-871D7ED05212}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|Any CPU + {DE482F7D-9E9D-481C-A9B7-871D7ED05212}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|Any CPU + {DE482F7D-9E9D-481C-A9B7-871D7ED05212}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|Any CPU + {DE482F7D-9E9D-481C-A9B7-871D7ED05212}.Debug|TwinCAT RT (x64).Build.0 = Debug|Any CPU + {DE482F7D-9E9D-481C-A9B7-871D7ED05212}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|Any CPU + {DE482F7D-9E9D-481C-A9B7-871D7ED05212}.Debug|TwinCAT RT (x86).Build.0 = Debug|Any CPU + {DE482F7D-9E9D-481C-A9B7-871D7ED05212}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DE482F7D-9E9D-481C-A9B7-871D7ED05212}.Release|Any CPU.Build.0 = Release|Any CPU + {DE482F7D-9E9D-481C-A9B7-871D7ED05212}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|Any CPU + {DE482F7D-9E9D-481C-A9B7-871D7ED05212}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|Any CPU + {DE482F7D-9E9D-481C-A9B7-871D7ED05212}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|Any CPU + {DE482F7D-9E9D-481C-A9B7-871D7ED05212}.Release|TwinCAT OS (ARMT2).Build.0 = Release|Any CPU + {DE482F7D-9E9D-481C-A9B7-871D7ED05212}.Release|TwinCAT RT (x64).ActiveCfg = Release|Any CPU + {DE482F7D-9E9D-481C-A9B7-871D7ED05212}.Release|TwinCAT RT (x64).Build.0 = Release|Any CPU + {DE482F7D-9E9D-481C-A9B7-871D7ED05212}.Release|TwinCAT RT (x86).ActiveCfg = Release|Any CPU + {DE482F7D-9E9D-481C-A9B7-871D7ED05212}.Release|TwinCAT RT (x86).Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/TcBlack/TcDeclaration.cs b/src/TcBlack/TcDeclaration.cs new file mode 100644 index 0000000..154f948 --- /dev/null +++ b/src/TcBlack/TcDeclaration.cs @@ -0,0 +1,58 @@ +namespace TcBlack +{ + public struct TcDeclaration + { + public TcDeclaration( + string name, + string allocation, + string dataType, + string initialization, + string comment + ) + { + Name = name; + Allocation = allocation; + DataType = dataType; + Initialization = initialization; + Comment = comment; + } + + public override bool Equals(object obj) + { + if (obj == null || GetType() != obj.GetType()) + { + return false; + } + + var other = (TcDeclaration)obj; + return + Name == other.Name + && Allocation == other.Allocation + && DataType == other.DataType + && Initialization == other.Initialization + && Comment == other.Comment + ; + } + + public static bool operator==(TcDeclaration obj1, TcDeclaration obj2) + { + if (obj1 == null) + { + return obj2 == null; + } + + return obj1.Equals(obj2); + } + + public static bool operator !=(TcDeclaration obj1, TcDeclaration obj2) + { + return !(obj1 == obj2); + } + + public string Name { get; } + public string Allocation { get; } + public string DataType { get; } + public string Initialization { get; } + public string Comment { get; } + } +} \ No newline at end of file diff --git a/src/TcBlackCore/TcBlackCore.csproj b/src/TcBlackCore/TcBlackCore.csproj index c04fd67..4897cf5 100644 --- a/src/TcBlackCore/TcBlackCore.csproj +++ b/src/TcBlackCore/TcBlackCore.csproj @@ -30,6 +30,12 @@ prompt 4 + + true + + + TcBlackCoreSign.pfx + @@ -54,5 +60,8 @@ + + + \ No newline at end of file diff --git a/src/TcBlackExtension/FormatStructuredText.cs b/src/TcBlackExtension/FormatStructuredText.cs new file mode 100644 index 0000000..caebef5 --- /dev/null +++ b/src/TcBlackExtension/FormatStructuredText.cs @@ -0,0 +1,113 @@ +using System; +using System.ComponentModel.Design; +using EnvDTE; +using Microsoft.VisualStudio.Shell; +using Task = System.Threading.Tasks.Task; +using TcBlackCore; +using TCatSysManagerLib; + +namespace TcBlackExtension2 +{ + /// + /// Command handler + /// + internal sealed class FormatStructuredText + { + /// + /// Command ID. + /// + public const int CommandId = 0x0100; + + /// + /// Command menu group (command set GUID). + /// + public static readonly Guid CommandSet = + new Guid("2331eac3-39e5-4347-b678-a146d49c0a07"); + + /// + /// VS Package that provides this command, not null. + /// + private readonly AsyncPackage package; + + /// + /// Initializes a new instance of the class. + /// Adds our command handlers for menu (commands must exist in the command table file) + /// + /// Owner package, not null. + /// Command service to add command to, not null. + private FormatStructuredText(AsyncPackage package, OleMenuCommandService commandService) + { + this.package = package ?? throw new ArgumentNullException(nameof(package)); + commandService = commandService ?? + throw new ArgumentNullException(nameof(commandService)); + + var menuCommandID = new CommandID(CommandSet, CommandId); + var menuItem = new MenuCommand(Execute, menuCommandID); + commandService.AddCommand(menuItem); + } + + /// + /// Gets the instance of the command. + /// + public static FormatStructuredText Instance + { + get; + private set; + } + + /// + /// Gets the service provider from the owner package. + /// + private IAsyncServiceProvider ServiceProvider + { + get + { + return this.package; + } + } + + /// + /// Initializes the singleton instance of the command. + /// + /// Owner package, not null. + public static async Task InitializeAsync(AsyncPackage package) + { + // Switch to the main thread - the call to AddCommand in FormatStructuredText's constructor requires + // the UI thread. + await ThreadHelper.JoinableTaskFactory + .SwitchToMainThreadAsync(package.DisposalToken); + + OleMenuCommandService commandService = await package.GetServiceAsync( + (typeof(IMenuCommandService))) as OleMenuCommandService; + Instance = new FormatStructuredText(package, commandService); + } + + /// + /// This function is the callback used to execute the command when the menu item is clicked. + /// See the constructor to see how the menu item is associated with this function using + /// OleMenuCommandService service and MenuCommand class. + /// + /// Event sender. + /// Event args. + private void Execute(object sender, EventArgs e) + { + ThreadHelper.ThrowIfNotOnUIThread(); + + DTE dte = Package.GetGlobalService(typeof(DTE)) as DTE; + if (dte.ActiveWindow.ProjectItem.Object is ITcPlcDeclaration) + { + ITcPlcDeclaration declaration = + (ITcPlcDeclaration)dte.ActiveWindow.ProjectItem.Object; + + uint indents = 0; + string text = declaration.DeclarationText; + Global.indentation = text.Contains("\t") ? "\t" : " "; + Global.lineEnding = "\r\n"; + string formatedCode = new CompositeCode(text) + .Tokenize() + .Format(ref indents); + declaration.DeclarationText = formatedCode; + } + } + } +} diff --git a/src/TcBlackExtension/FormatStructuredTextPackage.cs b/src/TcBlackExtension/FormatStructuredTextPackage.cs new file mode 100644 index 0000000..8836112 --- /dev/null +++ b/src/TcBlackExtension/FormatStructuredTextPackage.cs @@ -0,0 +1,69 @@ +using System; +using System.Diagnostics.CodeAnalysis; +using System.Runtime.InteropServices; +using System.Threading; +using Microsoft.VisualStudio.Shell; +using Task = System.Threading.Tasks.Task; + +namespace TcBlackExtension2 +{ + /// + /// This is the class that implements the package exposed by this assembly. + /// + /// + /// + /// The minimum requirement for a class to be considered a valid package for Visual Studio + /// is to implement the IVsPackage interface and register itself with the shell. + /// This package uses the helper classes defined inside the Managed Package Framework (MPF) + /// to do it: it derives from the Package class that provides the implementation of the + /// IVsPackage interface and uses the registration attributes defined in the framework to + /// register itself and its components with the shell. These attributes tell the pkgdef creation + /// utility what data to put into .pkgdef file. + /// + /// + /// To get loaded into VS, the package must be referred by <Asset Type="Microsoft.VisualStudio.VsPackage" ...> in .vsixmanifest file. + /// + /// + [PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)] + [InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)] // Info on this package for Help/About + [ProvideMenuResource("Menus.ctmenu", 1)] + [Guid(FormatStructuredTextPackage.PackageGuidString)] + [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "pkgdef, VS and vsixmanifest are valid VS terms")] + public sealed class FormatStructuredTextPackage : AsyncPackage + { + /// + /// FormatStructuredTextPackage GUID string. + /// + public const string PackageGuidString = "f0d2f155-5908-42b2-a15d-9e628c6f43b4"; + + /// + /// Initializes a new instance of the class. + /// + public FormatStructuredTextPackage() + { + // Inside this method you can place any initialization code that does not require + // any Visual Studio service because at this point the package object is created but + // not sited yet inside Visual Studio environment. The place to do all the other + // initialization is the Initialize method. + } + + #region Package Members + + /// + /// Initialization of the package; this method is called right after the package is sited, so this is the place + /// where you can put all the initialization code that rely on services provided by VisualStudio. + /// + /// A cancellation token to monitor for initialization cancellation, which can occur when VS is shutting down. + /// A provider for progress updates. + /// A task representing the async work of package initialization, or an already completed task if there is none. Do not return null from this method. + protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress progress) + { + // When initialized asynchronously, the current thread may be a background thread at this point. + // Do any initialization that requires the UI thread after switching to the UI thread. + await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); + await FormatStructuredText.InitializeAsync(this); + } + + #endregion + } +} diff --git a/src/TcBlackExtension/FormatStructuredTextPackage.vsct b/src/TcBlackExtension/FormatStructuredTextPackage.vsct new file mode 100644 index 0000000..18fa199 --- /dev/null +++ b/src/TcBlackExtension/FormatStructuredTextPackage.vsct @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/TcBlackExtension/Properties/AssemblyInfo.cs b/src/TcBlackExtension/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..1153f7a --- /dev/null +++ b/src/TcBlackExtension/Properties/AssemblyInfo.cs @@ -0,0 +1,32 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("TcBlackExtension")] +[assembly: AssemblyDescription("Visual Studio Extension to Format TwinCAT Structured Text")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("TcBlackExtension")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("0.1.0.0")] diff --git a/src/TcBlackExtension/TcBlackExtension.csproj b/src/TcBlackExtension/TcBlackExtension.csproj new file mode 100644 index 0000000..e27ff33 --- /dev/null +++ b/src/TcBlackExtension/TcBlackExtension.csproj @@ -0,0 +1,215 @@ + + + + + 15.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + true + + + + false + + + + + + + + Debug + AnyCPU + 2.0 + {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {DE482F7D-9E9D-481C-A9B7-871D7ED05212} + Library + Properties + TcBlackExtension + TcBlackExtension + v4.6.1 + true + true + true + true + true + false + Program + $(DevEnvDir)devenv.exe + /rootsuffix Exp + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + Designer + + + + + Menus.ctmenu + + + + + + False + + + False + + + False + + + False + + + + False + + + ..\packages\Microsoft.VisualStudio.CoreUtility.15.0.26228\lib\net45\Microsoft.VisualStudio.CoreUtility.dll + + + ..\packages\Microsoft.VisualStudio.Imaging.15.0.26228\lib\net45\Microsoft.VisualStudio.Imaging.dll + + + ..\packages\Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.14.3.25408\lib\net20\Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.dll + True + + + ..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6071\lib\Microsoft.VisualStudio.OLE.Interop.dll + + + ..\packages\Microsoft.VisualStudio.Shell.15.0.15.0.26228\lib\Microsoft.VisualStudio.Shell.15.0.dll + + + ..\packages\Microsoft.VisualStudio.Shell.Framework.15.0.26228\lib\net45\Microsoft.VisualStudio.Shell.Framework.dll + + + ..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6071\lib\Microsoft.VisualStudio.Shell.Interop.dll + + + ..\packages\Microsoft.VisualStudio.Shell.Interop.10.0.10.0.30319\lib\Microsoft.VisualStudio.Shell.Interop.10.0.dll + True + + + ..\packages\Microsoft.VisualStudio.Shell.Interop.11.0.11.0.61030\lib\Microsoft.VisualStudio.Shell.Interop.11.0.dll + True + + + ..\packages\Microsoft.VisualStudio.Shell.Interop.12.0.12.0.30110\lib\Microsoft.VisualStudio.Shell.Interop.12.0.dll + True + + + ..\packages\Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime.14.3.25407\lib\Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime.dll + True + + + ..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.Shell.Interop.8.0.dll + + + ..\packages\Microsoft.VisualStudio.Shell.Interop.9.0.9.0.30729\lib\Microsoft.VisualStudio.Shell.Interop.9.0.dll + + + ..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6070\lib\Microsoft.VisualStudio.TextManager.Interop.dll + + + ..\packages\Microsoft.VisualStudio.TextManager.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.TextManager.Interop.8.0.dll + + + ..\packages\Microsoft.VisualStudio.Threading.15.0.240\lib\net45\Microsoft.VisualStudio.Threading.dll + + + ..\packages\Microsoft.VisualStudio.Utilities.15.0.26228\lib\net46\Microsoft.VisualStudio.Utilities.dll + + + ..\packages\Microsoft.VisualStudio.Validation.15.0.82\lib\net45\Microsoft.VisualStudio.Validation.dll + + + False + + + + + + + + + + + + + + + true + VSPackage + + + + + {434c7a68-c27f-4f46-977e-2f60441feb64} + TcBlackCore + + + + + + + + {3C49D6C3-93DC-11D0-B162-00A0248C244B} + 3 + 3 + 0 + primary + False + True + + + + + + + + + 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}. + + + + + + + + + + + + \ No newline at end of file diff --git a/src/TcBlackExtension/VSPackage.resx b/src/TcBlackExtension/VSPackage.resx new file mode 100644 index 0000000..64d18ff --- /dev/null +++ b/src/TcBlackExtension/VSPackage.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + FormatStructuredText Extension + + + FormatStructuredText Visual Studio Extension Detailed Info + + \ No newline at end of file diff --git a/src/TcBlackExtension/packages.config b/src/TcBlackExtension/packages.config new file mode 100644 index 0000000..422d9ae --- /dev/null +++ b/src/TcBlackExtension/packages.config @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/TcBlackExtension/source.extension.vsixmanifest b/src/TcBlackExtension/source.extension.vsixmanifest new file mode 100644 index 0000000..8cb7608 --- /dev/null +++ b/src/TcBlackExtension/source.extension.vsixmanifest @@ -0,0 +1,21 @@ + + + + + TcBlackExtension + Empty VSIX Project. + + + + + + + + + + + + + + + diff --git a/src/TcBlackExtension/stylesheet.css b/src/TcBlackExtension/stylesheet.css new file mode 100644 index 0000000..d5e9c71 --- /dev/null +++ b/src/TcBlackExtension/stylesheet.css @@ -0,0 +1,129 @@ +body { + margin: 0; + padding: 0; + border: 0; + color: #1E1E1E; + font-size: 13px; + font-family: "Segoe UI", Helvetica, Arial, sans-serif; + line-height: 1.45; + word-wrap: break-word; +} + +/* General & 'Reset' Stuff */ + + +.container { + width: 980px; + margin: 0 auto; +} + +section { + display: block; + margin: 0; +} + +h1, h2, h3, h4, h5, h6 { + margin: 0; +} + +/* Header,
+ header - container + h1 - project name + h2 - project description +*/ + +#header { + color: #FFF; + background: #68217a; + position:relative; +} +#hangcloud { + width: 190px; + height: 160px; + background: url("../images/bannerart03.png"); + position: absolute; + top: 0; + right: -30px; +} +h1, h2 { + font-family: "Segoe UI Light", "Segoe UI", Helvetica, Arial, sans-serif; + line-height: 1; + margin: 0 18px; + padding: 0; +} +#header h1 { + font-size: 3.4em; + padding-top: 18px; + font-weight: normal; + margin-left: 15px; +} + +#header h2 { + font-size: 1.5em; + margin-top: 10px; + padding-bottom: 18px; + font-weight: normal; +} + + +#main_content { + width: 100%; + display: flex; + flex-direction: row; +} + + +h1, h2, h3, h4, h5, h6 { + font-weight: bolder; +} + +#main_content h1 { + font-size: 1.8em; + margin-top: 34px; +} + + #main_content h1:first-child { + margin-top: 30px; + } + +#main_content h2 { + font-size: 1.4em; + font-weight: bold; +} +p, ul { + margin: 11px 18px; +} + +#main_content a { + color: #06C; + text-decoration: none; +} +ul { + margin-top: 13px; + margin-left: 18px; + padding-left: 0; +} + ul li { + margin-left: 18px; + padding-left: 0; + } +#lpanel { + width: 620px; + float: left; +} +#rpanel ul { + list-style-type: none; + width: 300px; +} + #rpanel ul li { + line-height: 1.8em; + } +#rpanel { + background: #e7e7e7; + width: 360px; + float: right; +} + +#rpanel div { + width: 300px; +}