Skip to content

Commit

Permalink
readme.md, Help file and Dos window size.
Browse files Browse the repository at this point in the history
  • Loading branch information
CADbloke committed Apr 26, 2020
1 parent 88abfb5 commit d64a65e
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 51 deletions.
56 changes: 36 additions & 20 deletions CodeLinker2/Help.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,67 +9,83 @@ 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.");
WriteLine("Don't cross the streams.");
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("<!-- CodeLinker", ConsoleColor.Yellow);
WriteLine();
WriteLine("Source: PathTo\\NameOfProject.csproj <== this is NOT optional. You have multiples of these", ConsoleColor.Yellow);
WriteLine("Source: PathTo\\NameOfProject.csproj <== this is NOT optional. You can have multiples of these", ConsoleColor.Yellow);
WriteLine();
WriteLine("Exclude: PathTo\\FileToBeExcluded.cs <== optional - a partial match will exclude it", ConsoleColor.Yellow);
WriteLine();
WriteLine("Include: PathTo\\FileToBeIncluded.cs <== optional but if used it ONLY includes matches", ConsoleColor.Yellow);
WriteLine("-->", ConsoleColor.Yellow);
WriteLine();
WriteLine("Exclude: PathTo\\FileToBeExcluded.cs <== optional - a partial match will exlude it", ConsoleColor.Yellow);
WriteLine("<!-- EndCodeLinker -->", ConsoleColor.Yellow);
WriteLine();
WriteLine("Include: PathTo\\FileToBeIncluded.cs <== optional but it ONLY includes matches", ConsoleColor.Yellow);
WriteLine("-->");
WriteLine();
WriteLine("<!-- EndCodeLinker -->");
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;

Expand Down
1 change: 1 addition & 0 deletions CodeLinker2/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
4 changes: 2 additions & 2 deletions CodeLinker2/Properties/CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
72 changes: 43 additions & 29 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<!-- CodeLinker
Source: PathTo\\NameOfProject.csproj <== this is NOT optional. You have multiples of these
Source: PathTo\\NameOfProject.csproj <== this is NOT optional. You can have multiples of these
Exclude: PathTo\\FileToBeExcluded.cs <== optional - a partial match will exlude it
Exclude: PathTo\\FileToBeExcluded.cs <== optional - a partial match will exclude it
Include: PathTo\\FileToBeIncluded.cs <== optional but it ONLY includes matches
Include: PathTo\\FileToBeIncluded.cs <== optional but if used it ONLY includes matches
-->

```
```xml
<!-- EndCodeLinker -->
```

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

---------------------

Expand All @@ -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)

0 comments on commit d64a65e

Please sign in to comment.