From d64a65ec89a5cd88456f780c6964e307932f2d33 Mon Sep 17 00:00:00 2001 From: Ewen Date: Sun, 26 Apr 2020 10:34:50 +1000 Subject: [PATCH] readme.md, Help file and Dos window size. --- CodeLinker2/Help.cs | 56 +++++++++------ CodeLinker2/Program.cs | 1 + CodeLinker2/Properties/CommonAssemblyInfo.cs | 4 +- readme.md | 72 ++++++++++++-------- 4 files changed, 82 insertions(+), 51 deletions(-) diff --git a/CodeLinker2/Help.cs b/CodeLinker2/Help.cs index 7f4f853..866dcbb 100644 --- a/CodeLinker2/Help.cs +++ b/CodeLinker2/Help.cs @@ -9,6 +9,8 @@ internal static class Help { public static void Write() { + Log.WriteToConsole = false; + WriteLine("Code Linker v2 - because v1 confused even me and I wrote it"); WriteLine("Links Source code in CSPROJ and/or VBPROJ files to outside projects"); WriteLine("Does NOT Convert C# / VB between CSPROJ and VBPROJ files."); @@ -16,60 +18,74 @@ public static void Write() WriteLine("Anywhere this mentions CSPROJ you can also use VBPROJ."); WriteLine(); WriteLine("Usages..."); - WriteLine("CODELINKER /? tis help file", ConsoleColor.White, ConsoleColor.DarkBlue); - WriteLine("CODELINKER [Destination.csproj]", ConsoleColor.White, ConsoleColor.DarkBlue); + WriteLine("CodeLinker.exe /? this help file", ConsoleColor.White, ConsoleColor.DarkBlue); + WriteLine("CodeLinker.exe [Destination.csproj]", ConsoleColor.White, ConsoleColor.DarkBlue); WriteLine("Destination.csproj Path to the existing Destination project."); WriteLine(); WriteLine(" - Wrap paths with spaces in double quotes."); - WriteLine(" - Paths can (should!) be relative."); - WriteLine(" You need to have the source project in the placeholder."); + WriteLine(" - Paths can (probably should!) be relative."); + WriteLine(" - You need to have the source project(s) in the placeholder."); WriteLine(); WriteLine(); - WriteLine("The Destination CSPROJ file uses this XML comment placeholder...", ConsoleColor.White, ConsoleColor.DarkBlue); - WriteLine("If it doesn't have the placeholder then it soon will., I will add one for you on the first run"); + WriteLine("CodeLinker puts your linked code between these XML comment placeholders in the Destination CSPROJ file ...", ConsoleColor.White, ConsoleColor.DarkBlue); WriteLine(); WriteLine(); WriteLine("", ConsoleColor.Yellow); WriteLine(); - WriteLine("Exclude: PathTo\\FileToBeExcluded.cs <== optional - a partial match will exlude it", ConsoleColor.Yellow); + WriteLine("", ConsoleColor.Yellow); WriteLine(); - WriteLine("Include: PathTo\\FileToBeIncluded.cs <== optional but it ONLY includes matches", ConsoleColor.Yellow); - WriteLine("-->"); WriteLine(); - WriteLine(""); + WriteLine("If your destination project doesn't have the placeholders then it soon will, I will add them for you on the first run."); WriteLine(); + WriteLine("To populate the information, edit your project file in a text editor. Git is your friend."); WriteLine(); WriteLine(" - You may specify multiple Source: projects. No wildcards."); - WriteLine(" - File name if in the same folder, or relative or absolute path. Wildcards are OK."); + WriteLine(" - just the File name if it's in the same folder, or relative or absolute path."); WriteLine(); WriteLine(" - You may specify multiple Exclude: &/or Include: items. They all apply to all Sour es"); WriteLine(" - In/Exclusions are a simple VB LIKE String wildcard match, same as file system wildcard matches so * and ? work"); WriteLine(" - Protip -- Folder\\OtherFolder\\* is a valid wildcard"); - WriteLine(" - Exclusions override Any Inclusions."); + WriteLine(" - Exclusions override all Inclusions."); WriteLine(" - If you specify no Inclusions then everything is an Inclusion."); WriteLine(" - If you do specify any Inclusions then ONLY they are Included."); - WriteLine(" - Multiple Source: or Exclude: or Include: are ok - must be on separate lines."); - WriteLine(" - Source: order matters, this will not add a link to a file path that already exists in the Destination project."); + WriteLine(" - Source: order matters, CodeLinker will not add a link to a file path that already exists in the Destination project."); WriteLine(" - In/Exclude: order doesn't matter."); WriteLine(); WriteLine(" The folder structures of the Source(s) are preserved. If the source file is nested, the link will be nested"); WriteLine(); - WriteLine(" - Every run of ProjectLinker will re-Link the source project(s)"); - WriteLine(" into the space between the XML comment placeholders."); - WriteLine(" - ALL code links inside the placeholders are refreshed every time. OK?"); + WriteLine(" - Every run of ProjectLinker will re-Link the source project(s) into their space between the XML comment placeholders."); + WriteLine(" - so ALL code links inside the placeholders are refreshed every time. OK?"); + WriteLine(); + WriteLine("to automate this linking process ..."); + WriteLine("add the CodeLinker.exe to your project can call it in our post-build commands with something like..."); + WriteLine(); + WriteLine("CodeLinker.exe \"Path\\to\\Your.csproj\"", ConsoleColor.Yellow); + WriteLine(); + WriteLine("If your destination project has any changes Visual Studio will ask you to reload it. This is normal, don't panic"); + WriteLine(); + WriteLine("There is a log file called *CodeLinkerLog.txt* saved in the same folder as the executable. " + + "If you use this as a *pre/post-build process* The Visual Studio output window will have some summary information " + + "but the details will be in the log file. Good luck finding anything in the output window anyway "); WriteLine(); WriteLine("More Info & Source at " + Settings.SourceCodeUrl, ConsoleColor.Green); - WriteLine("Code Linker 2 by CADbloke", ConsoleColor.Cyan); + WriteLine("Code Linker v2 by CADbloke", ConsoleColor.Cyan); WriteLine(); - WriteLine("any key to continue"); + WriteLine("any key to get on ith your Life"); + Log.WriteToConsole = true; Console.ReadKey(); } private static void WriteLine(string line = "", ConsoleColor foreground = ConsoleColor.White, ConsoleColor background = ConsoleColor.Black) { + Console.ForegroundColor = foreground; Console.BackgroundColor = background; diff --git a/CodeLinker2/Program.cs b/CodeLinker2/Program.cs index b869db0..56d4aa5 100644 --- a/CodeLinker2/Program.cs +++ b/CodeLinker2/Program.cs @@ -11,6 +11,7 @@ internal class Program private static void Main(string[] args) { System.AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionTrapper; + Console.WindowHeight = Console.LargestWindowHeight -4; App.ParseCommands(args); App.Finish(); } diff --git a/CodeLinker2/Properties/CommonAssemblyInfo.cs b/CodeLinker2/Properties/CommonAssemblyInfo.cs index fd61951..c2a18be 100644 --- a/CodeLinker2/Properties/CommonAssemblyInfo.cs +++ b/CodeLinker2/Properties/CommonAssemblyInfo.cs @@ -28,5 +28,5 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.52.20117")] -[assembly: AssemblyFileVersion("2.0.52.20117")] +[assembly: AssemblyVersion("2.0.54.20117")] +[assembly: AssemblyFileVersion("2.0.54.20117")] diff --git a/readme.md b/readme.md index 930414c..cfeae82 100644 --- a/readme.md +++ b/readme.md @@ -6,49 +6,67 @@ Code Linker creates links in the destination `.csproj` project file to the code The original version was a fustercluck example of YAGNI. CodeLinker2 is the one you want. Here is how that works .... # Code Linker v2 - because v1 confused even me and I wrote it -Links Source code from CSPROJ and/or VBPROJ files +Links Source code in CSPROJ and/or VBPROJ files to outside projects Does NOT Convert C# / VB between CSPROJ and VBPROJ files. Don't cross the streams. Anywhere this mentions CSPROJ you can also use VBPROJ. -Anywhere this mentions .CS you can also use .VB, or any file you need. -Usages... -CODELINKER /? -CODELINKER [Destination.csproj] -Destination.csproj Path to the existing Destination project.", ConsoleColor.White, ConsoleColor.DarkBlue); +#### Usages... +- `CodeLinker.exe /?`` this help file +- `CodeLinker.exe` [Destination.csproj] +- `Destination.csproj` Path to the existing Destination project. - Wrap paths with spaces in double quotes. - - Paths can (should!) be relative. - You need to have the source project in the placeholder. + - Paths can (probably should!) be relative. + - You need to have the source project(s) in the placeholder. -The Destination CSPROJ file needs this XML comment placeholder...", ConsoleColor.White, ConsoleColor.DarkRed); -If it doesn't have the placeholder then it soon will., I will add one for you - +#### CodeLinker puts your linked code between these XML comment placeholders in the Destination CSPROJ file ... +```xml - +``` +```xml +``` + +If your destination project doesn't have the placeholders then it soon will, I will add them for you on the first run. - - You may specify multiple Source: projects. No wildcards. // todo: orly ??? - - You may specify multiple Exclude: &/or Include: items. The all apply to all projects - - File name if in the same folder, or relative or absolute path. Wildcards are OK. - - In/Exclusions are a simple VB LIKE String wildcard match. - - Exclusions override Any Inclusions. +#### To populate the information, edit your project file in a text editor. `Git` is your friend. + + - You may specify multiple Source: projects. No wildcards. + - just the File name if it's in the same folder, or relative or absolute path. + - You may specify multiple `Exclude:`` &/or `Include:`` items. They all apply to all Sour es + - In/Exclusions are a simple VB LIKE String wildcard match, same as file system wildcard matches so * and ? work + - Protip -- `Folder\\OtherFolder\\*`` is a valid wildcard + - Exclusions override all Inclusions. - If you specify no Inclusions then everything is an Inclusion. + - If you do specify any Inclusions then ONLY they are Included. + - Multiple `Source:`` or `Exclude:`` or `Include:`` are ok - must be on separate lines. + - `Source:` order matters, CodeLinker will not add a link to a file path that already exists in the Destination project. + - `In/Exclude:`` order doesn't matter. + +#### The folder structures of the Source(s) are preserved. If the source file is nested, the link will be nested - - Multiple Source: or Exclude: or Include: are ok - must be on separate lines. - The order doesn't matter as long as they are all in teh 1st XML comment. - - Every run of ProjectLinker will re-Link the source CSPROJ - into the space between the XML comment placeholders. - - ALL code links inside the placeholders are refreshed every time. OK? + - Every run of ProjectLinker will re-Link the source project(s) into their space between the XML comment placeholders. + - so ALL code links inside the placeholders are refreshed every time. OK? + +#### to automate this linking process ... +add the CodeLinker.exe to your project can call it in our post-build commands with something like... +```batch +CodeLinker.exe \"Path\\to\\Your.csproj\" +```` + +If your destination project has any changes Visual Studio will ask you to reload it. This is normal, **don't panic** + +There is a log file called *CodeLinkerLog.txt* saved in the same folder as the executable. If you use this as a *pre/post-build process* The Visual Studio output window will have some summary information but the details will be in the log file. Good luck finding anything in the VS output window anyway --------------------- @@ -60,7 +78,3 @@ See the [Wiki](https://github.com/CADbloke/CodeLinker/wiki) for more detailed in There's a [page on the GUI app](https://github.com/CADbloke/CodeLinker/wiki/Using-the-GUI-App) and one for the [Command line app](https://github.com/CADbloke/CodeLinker/wiki/Command-Line). More instructions coming soon. Your [feedback](https://github.com/CADbloke/CodeLinker/issues) would be more than welcome. - -There is a log file called *CodeLinkerLog.txt* saved in the same folder as the executable. If you use this as a *pre/post-build process* The Visual Studio output window will have some summary information but the details will be in the log file. Good luck finding anything in the output window anyway - -[![Join the chat at https://gitter.im/CADbloke/CodeLinker](https://badges.gitter.im/CADbloke/CodeLinker.svg)](https://gitter.im/CADbloke/CodeLinker?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) \ No newline at end of file